2 * Copyright 2016 Andrey Gusev
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #ifndef __D3DX11TEX_H__
22 #define __D3DX11TEX_H__
24 typedef enum D3DX11_IMAGE_FILE_FORMAT
33 D3DX11_IFF_FORCE_DWORD
= 0x7fffffff
34 } D3DX11_IMAGE_FILE_FORMAT
;
36 typedef struct D3DX11_IMAGE_INFO
45 D3D11_RESOURCE_DIMENSION ResourceDimension
;
46 D3DX11_IMAGE_FILE_FORMAT ImageFileFormat
;
49 typedef struct D3DX11_IMAGE_LOAD_INFO
63 D3DX11_IMAGE_INFO
*pSrcInfo
;
66 D3DX11_IMAGE_LOAD_INFO()
68 Width
= D3DX11_DEFAULT
;
69 Height
= D3DX11_DEFAULT
;
70 Depth
= D3DX11_DEFAULT
;
71 FirstMipLevel
= D3DX11_DEFAULT
;
72 MipLevels
= D3DX11_DEFAULT
;
73 Usage
= (D3D11_USAGE
)D3DX11_DEFAULT
;
74 BindFlags
= D3DX11_DEFAULT
;
75 CpuAccessFlags
= D3DX11_DEFAULT
;
76 MiscFlags
= D3DX11_DEFAULT
;
77 Format
= DXGI_FORMAT_FROM_FILE
;
78 Filter
= D3DX11_DEFAULT
;
79 MipFilter
= D3DX11_DEFAULT
;
83 } D3DX11_IMAGE_LOAD_INFO
;
89 HRESULT WINAPI
D3DX11CreateTextureFromMemory(ID3D11Device
*device
, const void *src_data
, SIZE_T src_data_size
,
90 D3DX11_IMAGE_LOAD_INFO
*loadinfo
, ID3DX11ThreadPump
*pump
, ID3D11Resource
**texture
, HRESULT
*hresult
);
92 HRESULT WINAPI
D3DX11GetImageInfoFromMemory(const void *src_data
, SIZE_T src_data_size
, ID3DX11ThreadPump
*pump
,
93 D3DX11_IMAGE_INFO
*img_info
, HRESULT
*hresult
);
95 HRESULT WINAPI
D3DX11SaveTextureToMemory(ID3D11DeviceContext
*context
, ID3D11Resource
*texture
,
96 D3DX11_IMAGE_FILE_FORMAT format
, ID3D10Blob
**buffer
, UINT flags
);