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_FILTER_FLAG
26 D3DX11_FILTER_NONE
= 0x00000001,
27 D3DX11_FILTER_POINT
= 0x00000002,
28 D3DX11_FILTER_LINEAR
= 0x00000003,
29 D3DX11_FILTER_TRIANGLE
= 0x00000004,
30 D3DX11_FILTER_BOX
= 0x00000005,
32 D3DX11_FILTER_MIRROR_U
= 0x00010000,
33 D3DX11_FILTER_MIRROR_V
= 0x00020000,
34 D3DX11_FILTER_MIRROR_W
= 0x00040000,
35 D3DX11_FILTER_MIRROR
= 0x00070000,
37 D3DX11_FILTER_DITHER
= 0x00080000,
38 D3DX11_FILTER_DITHER_DIFFUSION
= 0x00100000,
40 D3DX11_FILTER_SRGB_IN
= 0x00200000,
41 D3DX11_FILTER_SRGB_OUT
= 0x00400000,
42 D3DX11_FILTER_SRGB
= 0x00600000,
45 typedef enum D3DX11_IMAGE_FILE_FORMAT
54 D3DX11_IFF_FORCE_DWORD
= 0x7fffffff
55 } D3DX11_IMAGE_FILE_FORMAT
;
57 typedef struct D3DX11_IMAGE_INFO
66 D3D11_RESOURCE_DIMENSION ResourceDimension
;
67 D3DX11_IMAGE_FILE_FORMAT ImageFileFormat
;
70 typedef struct D3DX11_IMAGE_LOAD_INFO
84 D3DX11_IMAGE_INFO
*pSrcInfo
;
87 D3DX11_IMAGE_LOAD_INFO()
89 Width
= D3DX11_DEFAULT
;
90 Height
= D3DX11_DEFAULT
;
91 Depth
= D3DX11_DEFAULT
;
92 FirstMipLevel
= D3DX11_DEFAULT
;
93 MipLevels
= D3DX11_DEFAULT
;
94 Usage
= (D3D11_USAGE
)D3DX11_DEFAULT
;
95 BindFlags
= D3DX11_DEFAULT
;
96 CpuAccessFlags
= D3DX11_DEFAULT
;
97 MiscFlags
= D3DX11_DEFAULT
;
98 Format
= DXGI_FORMAT_FROM_FILE
;
99 Filter
= D3DX11_DEFAULT
;
100 MipFilter
= D3DX11_DEFAULT
;
104 } D3DX11_IMAGE_LOAD_INFO
;
110 HRESULT WINAPI
D3DX11CreateShaderResourceViewFromMemory(ID3D11Device
*device
, const void *data
,
111 SIZE_T data_size
, D3DX11_IMAGE_LOAD_INFO
*load_info
, ID3DX11ThreadPump
*pump
,
112 ID3D11ShaderResourceView
**view
, HRESULT
*hresult
);
113 HRESULT WINAPI
D3DX11CreateTextureFromFileA(ID3D11Device
*device
, const char *filename
,
114 D3DX11_IMAGE_LOAD_INFO
*load_info
, ID3DX11ThreadPump
*pump
, ID3D11Resource
**texture
,
116 HRESULT WINAPI
D3DX11CreateTextureFromFileW(ID3D11Device
*device
, const WCHAR
*filename
,
117 D3DX11_IMAGE_LOAD_INFO
*load_info
, ID3DX11ThreadPump
*pump
, ID3D11Resource
**texture
,
119 HRESULT WINAPI
D3DX11CreateTextureFromMemory(ID3D11Device
*device
, const void *src_data
, SIZE_T src_data_size
,
120 D3DX11_IMAGE_LOAD_INFO
*loadinfo
, ID3DX11ThreadPump
*pump
, ID3D11Resource
**texture
, HRESULT
*hresult
);
121 HRESULT WINAPI
D3DX11FilterTexture(ID3D11DeviceContext
*context
, ID3D11Resource
*texture
, UINT src_level
, UINT filter
);
122 HRESULT WINAPI
D3DX11GetImageInfoFromMemory(const void *src_data
, SIZE_T src_data_size
, ID3DX11ThreadPump
*pump
,
123 D3DX11_IMAGE_INFO
*img_info
, HRESULT
*hresult
);
124 HRESULT WINAPI
D3DX11SaveTextureToFileA(ID3D11DeviceContext
*context
, ID3D11Resource
*texture
,
125 D3DX11_IMAGE_FILE_FORMAT format
, const char *filename
);
126 HRESULT WINAPI
D3DX11SaveTextureToFileW(ID3D11DeviceContext
*context
, ID3D11Resource
*texture
,
127 D3DX11_IMAGE_FILE_FORMAT format
, const WCHAR
*filename
);
128 HRESULT WINAPI
D3DX11SaveTextureToMemory(ID3D11DeviceContext
*context
, ID3D11Resource
*texture
,
129 D3DX11_IMAGE_FILE_FORMAT format
, ID3D10Blob
**buffer
, UINT flags
);