2 * Copyright (C) 2008 Tony Wasserka
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 __WINE_D3DX9TEX_H
22 #define __WINE_D3DX9TEX_H
24 /**********************************************
25 ***************** Definitions ****************
26 **********************************************/
27 #define D3DX_FILTER_NONE 0x00000001
28 #define D3DX_FILTER_POINT 0x00000002
29 #define D3DX_FILTER_LINEAR 0x00000003
30 #define D3DX_FILTER_TRIANGLE 0x00000004
31 #define D3DX_FILTER_BOX 0x00000005
32 #define D3DX_FILTER_MIRROR_U 0x00010000
33 #define D3DX_FILTER_MIRROR_V 0x00020000
34 #define D3DX_FILTER_MIRROR_W 0x00040000
35 #define D3DX_FILTER_MIRROR 0x00070000
36 #define D3DX_FILTER_DITHER 0x00080000
37 #define D3DX_FILTER_DITHER_DIFFUSION 0x00100000
38 #define D3DX_FILTER_SRGB_IN 0x00200000
39 #define D3DX_FILTER_SRGB_OUT 0x00400000
40 #define D3DX_FILTER_SRGB 0x00600000
42 #define D3DX_NORMALMAP_MIRROR_U 0x00010000
43 #define D3DX_NORMALMAP_MIRROR_V 0x00020000
44 #define D3DX_NORMALMAP_MIRROR 0x00030000
45 #define D3DX_NORMALMAP_INVERTSIGN 0x00080000
46 #define D3DX_NORMALMAP_COMPUTE_OCCLUSION 0x00100000
48 #define D3DX_CHANNEL_RED 0x00000001
49 #define D3DX_CHANNEL_BLUE 0x00000002
50 #define D3DX_CHANNEL_GREEN 0x00000004
51 #define D3DX_CHANNEL_ALPHA 0x00000008
52 #define D3DX_CHANNEL_LUMINANCE 0x00000010
54 /**********************************************
55 **************** Typedefs ****************
56 **********************************************/
57 typedef enum _D3DXIMAGE_FILEFORMAT
66 D3DXIFF_FORCE_DWORD
= 0x7fffffff
67 } D3DXIMAGE_FILEFORMAT
;
69 typedef struct _D3DXIMAGE_INFO
76 D3DRESOURCETYPE ResourceType
;
77 D3DXIMAGE_FILEFORMAT ImageFileFormat
;
80 /**********************************************
81 ****************** Functions *****************
82 **********************************************/
83 /* Typedefs for callback functions */
84 typedef VOID (WINAPI
*LPD3DXFILL2D
)(D3DXVECTOR4
*out
, CONST D3DXVECTOR2
*texcoord
, CONST D3DXVECTOR2
*texelsize
, LPVOID data
);
85 typedef VOID (WINAPI
*LPD3DXFILL3D
)(D3DXVECTOR4
*out
, CONST D3DXVECTOR3
*texcoord
, CONST D3DXVECTOR3
*texelsize
, LPVOID data
);
92 /* Image Information */
93 HRESULT WINAPI
D3DXGetImageInfoFromFileA(LPCSTR file
, D3DXIMAGE_INFO
*info
);
94 HRESULT WINAPI
D3DXGetImageInfoFromFileW(LPCWSTR file
, D3DXIMAGE_INFO
*info
);
95 #define D3DXGetImageInfoFromFile WINELIB_NAME_AW(D3DXGetImageInfoFromFile)
97 HRESULT WINAPI
D3DXGetImageInfoFromResourceA(HMODULE module
, LPCSTR resource
, D3DXIMAGE_INFO
*info
);
98 HRESULT WINAPI
D3DXGetImageInfoFromResourceW(HMODULE module
, LPCWSTR resource
, D3DXIMAGE_INFO
*info
);
99 #define D3DXGetImageInfoFromResource WINELIB_NAME_AW(D3DXGetImageInfoFromResource)
101 HRESULT WINAPI
D3DXGetImageInfoFromFileInMemory(LPCVOID data
, UINT datasize
, D3DXIMAGE_INFO
*info
);
104 /* Surface Loading/Saving */
105 HRESULT WINAPI
D3DXLoadSurfaceFromFileA( LPDIRECT3DSURFACE9 destsurface
,
106 CONST PALETTEENTRY
*destpalette
,
107 CONST RECT
*destrect
,
112 D3DXIMAGE_INFO
*srcinfo
);
114 HRESULT WINAPI
D3DXLoadSurfaceFromFileW( LPDIRECT3DSURFACE9 destsurface
,
115 CONST PALETTEENTRY
*destpalette
,
116 CONST RECT
*destrect
,
121 D3DXIMAGE_INFO
*srcinfo
);
122 #define D3DXLoadSurfaceFromFile WINELIB_NAME_AW(D3DXLoadSurfaceFromFile)
124 HRESULT WINAPI
D3DXLoadSurfaceFromResourceA( LPDIRECT3DSURFACE9 destsurface
,
125 CONST PALETTEENTRY
*destpalette
,
126 CONST RECT
*destrect
,
132 D3DXIMAGE_INFO
*srcinfo
);
134 HRESULT WINAPI
D3DXLoadSurfaceFromResourceW( LPDIRECT3DSURFACE9 destsurface
,
135 CONST PALETTEENTRY
*destpalette
,
136 CONST RECT
*destrect
,
142 D3DXIMAGE_INFO
*srcinfo
);
143 #define D3DXLoadSurfaceFromResource WINELIB_NAME_AW(D3DXLoadSurfaceFromResource)
145 HRESULT WINAPI
D3DXLoadSurfaceFromFileInMemory(LPDIRECT3DSURFACE9 destsurface
,
146 CONST PALETTEENTRY
*destpalette
,
153 D3DXIMAGE_INFO
*srcinfo
);
155 HRESULT WINAPI
D3DXLoadSurfaceFromSurface( LPDIRECT3DSURFACE9 destsurface
,
156 CONST PALETTEENTRY
*destpalette
,
157 CONST RECT
*destrect
,
158 LPDIRECT3DSURFACE9 srcsurface
,
159 CONST PALETTEENTRY
*srcpalette
,
164 HRESULT WINAPI
D3DXLoadSurfaceFromMemory( LPDIRECT3DSURFACE9 destsurface
,
165 CONST PALETTEENTRY
*destpalette
,
166 CONST RECT
*destrect
,
170 CONST PALETTEENTRY
*srcpalette
,
175 HRESULT WINAPI
D3DXSaveSurfaceToFileA( LPCSTR destfile
,
176 D3DXIMAGE_FILEFORMAT destformat
,
177 LPDIRECT3DSURFACE9 srcsurface
,
178 CONST PALETTEENTRY
*srcpalette
,
179 CONST RECT
*srcrect
);
181 HRESULT WINAPI
D3DXSaveSurfaceToFileW( LPCWSTR destfile
,
182 D3DXIMAGE_FILEFORMAT destformat
,
183 LPDIRECT3DSURFACE9 srcsurface
,
184 CONST PALETTEENTRY
*srcpalette
,
185 CONST RECT
*srcrect
);
186 #define D3DXSaveSurfaceToFile WINELIB_NAME_AW(D3DXSaveSurfaceToFile)
189 /* Volume Loading/Saving */
190 HRESULT WINAPI
D3DXLoadVolumeFromFileA( LPDIRECT3DVOLUME9 destvolume
,
191 CONST PALETTEENTRY
*destpalette
,
192 CONST D3DBOX
*destbox
,
194 CONST D3DBOX
*srcbox
,
197 D3DXIMAGE_INFO
*srcinfo
);
199 HRESULT WINAPI
D3DXLoadVolumeFromFileW( LPDIRECT3DVOLUME9 destVolume
,
200 CONST PALETTEENTRY
*destpalette
,
201 CONST D3DBOX
*destbox
,
203 CONST D3DBOX
*srcbox
,
206 D3DXIMAGE_INFO
*srcinfo
);
207 #define D3DXLoadVolumeFromFile WINELIB_NAME_AW(D3DXLoadVolumeFromFile)
209 HRESULT WINAPI
D3DXLoadVolumeFromResourceA( LPDIRECT3DVOLUME9 destVolume
,
210 CONST PALETTEENTRY
*destpalette
,
211 CONST D3DBOX
*destbox
,
214 CONST D3DBOX
*srcbox
,
217 D3DXIMAGE_INFO
*srcinfo
);
219 HRESULT WINAPI
D3DXLoadVolumeFromResourceW( LPDIRECT3DVOLUME9 destVolume
,
220 CONST PALETTEENTRY
*destpalette
,
221 CONST D3DBOX
*destbox
,
224 CONST D3DBOX
*srcbox
,
227 D3DXIMAGE_INFO
*srcinfo
);
228 #define D3DXLoadVolumeFromResource WINELIB_NAME_AW(D3DXLoadVolumeFromResource)
230 HRESULT WINAPI
D3DXLoadVolumeFromFileInMemory(LPDIRECT3DVOLUME9 destvolume
,
231 CONST PALETTEENTRY
*destpalette
,
232 CONST D3DBOX
*destbox
,
235 CONST D3DBOX
*srcbox
,
238 D3DXIMAGE_INFO
*srcinfo
);
240 HRESULT WINAPI
D3DXLoadVolumeFromVolume( LPDIRECT3DVOLUME9 destvolume
,
241 CONST PALETTEENTRY
*destpalette
,
242 CONST D3DBOX
*destbox
,
243 LPDIRECT3DVOLUME9 srcvolume
,
244 CONST PALETTEENTRY
*srcpalette
,
245 CONST D3DBOX
*srcbox
,
249 HRESULT WINAPI
D3DXLoadVolumeFromMemory( LPDIRECT3DVOLUME9 destvolume
,
250 CONST PALETTEENTRY
*destpalette
,
251 CONST D3DBOX
*destbox
,
256 CONST PALETTEENTRY
*srcpalette
,
257 CONST D3DBOX
*srcbox
,
261 HRESULT WINAPI
D3DXSaveVolumeToFileA( LPCSTR destfile
,
262 D3DXIMAGE_FILEFORMAT destformat
,
263 LPDIRECT3DVOLUME9 srcvolume
,
264 CONST PALETTEENTRY
*srcpalette
,
265 CONST D3DBOX
*srcbox
);
267 HRESULT WINAPI
D3DXSaveVolumeToFileW( LPCWSTR destfile
,
268 D3DXIMAGE_FILEFORMAT destformat
,
269 LPDIRECT3DVOLUME9 srcvolume
,
270 CONST PALETTEENTRY
*srcpalette
,
271 CONST D3DBOX
*srcbox
);
272 #define D3DXSaveVolumeToFile WINELIB_NAME_AW(D3DXSaveVolumeToFile)
275 /* Texture, cube texture and volume texture creation */
276 HRESULT WINAPI
D3DXCheckTextureRequirements( LPDIRECT3DDEVICE9 device
,
283 HRESULT WINAPI
D3DXCheckCubeTextureRequirements( LPDIRECT3DDEVICE9 device
,
290 HRESULT WINAPI
D3DXCheckVolumeTextureRequirements(LPDIRECT3DDEVICE9 device
,
299 HRESULT WINAPI
D3DXCreateTexture( LPDIRECT3DDEVICE9 device
,
306 LPDIRECT3DTEXTURE9
*texture
);
308 HRESULT WINAPI
D3DXCreateCubeTexture( LPDIRECT3DDEVICE9 device
,
314 LPDIRECT3DCUBETEXTURE9
*cube
);
316 HRESULT WINAPI
D3DXCreateVolumeTexture(LPDIRECT3DDEVICE9 device
,
324 LPDIRECT3DVOLUMETEXTURE9
*volume
);
326 HRESULT WINAPI
D3DXCreateTextureFromFileA( LPDIRECT3DDEVICE9 device
,
328 LPDIRECT3DTEXTURE9
*texture
);
330 HRESULT WINAPI
D3DXCreateTextureFromFileW( LPDIRECT3DDEVICE9 device
,
332 LPDIRECT3DTEXTURE9
*texture
);
333 #define D3DXCreateTextureFromFile WINELIB_NAME_AW(D3DXCreateTextureFromFile)
335 HRESULT WINAPI
D3DXCreateCubeTextureFromFileA( LPDIRECT3DDEVICE9 device
,
337 LPDIRECT3DCUBETEXTURE9
*cube
);
339 HRESULT WINAPI
D3DXCreateCubeTextureFromFileW( LPDIRECT3DDEVICE9 device
,
341 LPDIRECT3DCUBETEXTURE9
*cube
);
342 #define D3DXCreateCubeTextureFromFile WINELIB_NAME_AW(D3DXCreateCubeTextureFromFile)
344 HRESULT WINAPI
D3DXCreateVolumeTextureFromFileA(LPDIRECT3DDEVICE9 device
,
346 LPDIRECT3DVOLUMETEXTURE9
*volume
);
348 HRESULT WINAPI
D3DXCreateVolumeTextureFromFileW(LPDIRECT3DDEVICE9 device
,
350 LPDIRECT3DVOLUMETEXTURE9
*volume
);
351 #define D3DXCreateVolumeTextureFromFile WINELIB_NAME_AW(D3DXCreateVolumeTextureFromFile)
353 HRESULT WINAPI
D3DXCreateTextureFromResourceA( LPDIRECT3DDEVICE9 device
,
356 LPDIRECT3DTEXTURE9
*texture
);
358 HRESULT WINAPI
D3DXCreateTextureFromResourceW( LPDIRECT3DDEVICE9 device
,
361 LPDIRECT3DTEXTURE9
*texture
);
362 #define D3DXCreateTextureFromResource WINELIB_NAME_AW(D3DXCreateTextureFromResource)
364 HRESULT WINAPI
D3DXCreateCubeTextureFromResourceA( LPDIRECT3DDEVICE9 device
,
367 LPDIRECT3DCUBETEXTURE9
*cube
);
368 HRESULT WINAPI
D3DXCreateCubeTextureFromResourceW( LPDIRECT3DDEVICE9 device
,
371 LPDIRECT3DCUBETEXTURE9
*cube
);
372 #define D3DXCreateCubeTextureFromResource WINELIB_NAME_AW(D3DXCreateCubeTextureFromResource)
374 HRESULT WINAPI
D3DXCreateVolumeTextureFromResourceA(LPDIRECT3DDEVICE9 device
,
377 LPDIRECT3DVOLUMETEXTURE9
*volume
);
378 HRESULT WINAPI
D3DXCreateVolumeTextureFromResourceW(LPDIRECT3DDEVICE9 device
,
381 LPDIRECT3DVOLUMETEXTURE9
*volume
);
382 #define D3DXCreateVolumeTextureFromResource WINELIB_NAME_AW(D3DXCreateVolumeTextureFromResource)
384 HRESULT WINAPI
D3DXCreateTextureFromFileExA( LPDIRECT3DDEVICE9 device
,
395 D3DXIMAGE_INFO
*srcinfo
,
396 PALETTEENTRY
*palette
,
397 LPDIRECT3DTEXTURE9
*texture
);
399 HRESULT WINAPI
D3DXCreateTextureFromFileExW( LPDIRECT3DDEVICE9 device
,
410 D3DXIMAGE_INFO
*srcinfo
,
411 PALETTEENTRY
*palette
,
412 LPDIRECT3DTEXTURE9
*texture
);
413 #define D3DXCreateTextureFromFileEx WINELIB_NAME_AW(D3DXCreateTextureFromFileEx)
415 HRESULT WINAPI
D3DXCreateCubeTextureFromFileExA( LPDIRECT3DDEVICE9 device
,
425 D3DXIMAGE_INFO
*srcinfo
,
426 PALETTEENTRY
*palette
,
427 LPDIRECT3DCUBETEXTURE9
*cube
);
429 HRESULT WINAPI
D3DXCreateCubeTextureFromFileExW( LPDIRECT3DDEVICE9 device
,
439 D3DXIMAGE_INFO
*srcinfo
,
440 PALETTEENTRY
*palette
,
441 LPDIRECT3DCUBETEXTURE9
*cube
);
442 #define D3DXCreateCubeTextureFromFileEx WINELIB_NAME_AW(D3DXCreateCubeTextureFromFileEx)
444 HRESULT WINAPI
D3DXCreateVolumeTextureFromFileExA(LPDIRECT3DDEVICE9 device
,
456 D3DXIMAGE_INFO
*srcinfo
,
457 PALETTEENTRY
*palette
,
458 LPDIRECT3DVOLUMETEXTURE9
*volume
);
460 HRESULT WINAPI
D3DXCreateVolumeTextureFromFileExW(LPDIRECT3DDEVICE9 device
,
472 D3DXIMAGE_INFO
*srcinfo
,
473 PALETTEENTRY
*palette
,
474 LPDIRECT3DVOLUMETEXTURE9
*volume
);
475 #define D3DXCreateVolumeTextureFromFileEx WINELIB_NAME_AW(D3DXCreateVolumeTextureFromFileEx)
477 HRESULT WINAPI
D3DXCreateTextureFromResourceExA( LPDIRECT3DDEVICE9 device
,
489 D3DXIMAGE_INFO
*srcinfo
,
490 PALETTEENTRY
*palette
,
491 LPDIRECT3DTEXTURE9
*texture
);
493 HRESULT WINAPI
D3DXCreateTextureFromResourceExW( LPDIRECT3DDEVICE9 device
,
505 D3DXIMAGE_INFO
*srcinfo
,
506 PALETTEENTRY
*palette
,
507 LPDIRECT3DTEXTURE9
*texture
);
508 #define D3DXCreateTextureFromResourceEx WINELIB_NAME_AW(D3DXCreateTextureFromResourceEx)
510 HRESULT WINAPI
D3DXCreateCubeTextureFromResourceExA( LPDIRECT3DDEVICE9 device
,
521 D3DXIMAGE_INFO
*srcinfo
,
522 PALETTEENTRY
*palette
,
523 LPDIRECT3DCUBETEXTURE9
*cube
);
525 HRESULT WINAPI
D3DXCreateCubeTextureFromResourceExW( LPDIRECT3DDEVICE9 device
,
536 D3DXIMAGE_INFO
*srcinfo
,
537 PALETTEENTRY
*palette
,
538 LPDIRECT3DCUBETEXTURE9
*cube
);
539 #define D3DXCreateCubeTextureFromResourceEx WINELIB_NAME_AW(D3DXCreateCubeTextureFromResourceEx)
541 HRESULT WINAPI
D3DXCreateVolumeTextureFromResourceExA(LPDIRECT3DDEVICE9 device
,
554 D3DXIMAGE_INFO
*srcinfo
,
555 PALETTEENTRY
*palette
,
556 LPDIRECT3DVOLUMETEXTURE9
*volume
);
558 HRESULT WINAPI
D3DXCreateVolumeTextureFromResourceExW(LPDIRECT3DDEVICE9 device
,
571 D3DXIMAGE_INFO
*srcinfo
,
572 PALETTEENTRY
*palette
,
573 LPDIRECT3DVOLUMETEXTURE9
*volume
);
574 #define D3DXCreateVolumeTextureFromResourceEx WINELIB_NAME_AW(D3DXCreateVolumeTextureFromResourceEx)
576 HRESULT WINAPI
D3DXCreateTextureFromFileInMemory( LPDIRECT3DDEVICE9 device
,
579 LPDIRECT3DTEXTURE9
* texture
);
581 HRESULT WINAPI
D3DXCreateCubeTextureFromFileInMemory( LPDIRECT3DDEVICE9 device
,
584 LPDIRECT3DCUBETEXTURE9
* cube
);
586 HRESULT WINAPI
D3DXCreateVolumeTextureFromFileInMemory(LPDIRECT3DDEVICE9 device
,
589 LPDIRECT3DVOLUMETEXTURE9
*volume
);
591 HRESULT WINAPI
D3DXCreateTextureFromFileInMemoryEx( LPDIRECT3DDEVICE9 device
,
603 D3DXIMAGE_INFO
*srcinfo
,
604 PALETTEENTRY
*palette
,
605 LPDIRECT3DTEXTURE9
*texture
);
607 HRESULT WINAPI
D3DXCreateCubeTextureFromFileInMemoryEx( LPDIRECT3DDEVICE9 device
,
618 D3DXIMAGE_INFO
*srcinfo
,
619 PALETTEENTRY
*palette
,
620 LPDIRECT3DCUBETEXTURE9
*cube
);
622 HRESULT WINAPI
D3DXCreateVolumeTextureFromFileInMemoryEx(LPDIRECT3DDEVICE9 device
,
635 D3DXIMAGE_INFO
*srcinfo
,
636 PALETTEENTRY
*palette
,
637 LPDIRECT3DVOLUMETEXTURE9
*volume
);
639 HRESULT WINAPI
D3DXSaveTextureToFileA(LPCSTR destfile
,
640 D3DXIMAGE_FILEFORMAT destformat
,
641 LPDIRECT3DBASETEXTURE9 srctexture
,
642 CONST PALETTEENTRY
*srcpalette
);
643 HRESULT WINAPI
D3DXSaveTextureToFileW(LPCWSTR destfile
,
644 D3DXIMAGE_FILEFORMAT destformat
,
645 LPDIRECT3DBASETEXTURE9 srctexture
,
646 CONST PALETTEENTRY
*srcpalette
);
647 #define D3DXSaveTextureToFile WINELIB_NAME_AW(D3DXSaveTextureToFile)
650 /* Other functions */
651 HRESULT WINAPI
D3DXFilterTexture( LPDIRECT3DBASETEXTURE9 texture
,
652 CONST PALETTEENTRY
*palette
,
655 #define D3DXFilterCubeTexture D3DXFilterTexture
656 #define D3DXFilterVolumeTexture D3DXFilterTexture
658 HRESULT WINAPI
D3DXFillTexture( LPDIRECT3DTEXTURE9 texture
,
659 LPD3DXFILL2D function
,
662 HRESULT WINAPI
D3DXFillCubeTexture( LPDIRECT3DCUBETEXTURE9 cube
,
663 LPD3DXFILL3D function
,
666 HRESULT WINAPI
D3DXFillVolumeTexture( LPDIRECT3DVOLUMETEXTURE9 volume
,
667 LPD3DXFILL3D function
,
670 HRESULT WINAPI
D3DXFillTextureTX( LPDIRECT3DTEXTURE9 texture
,
671 CONST DWORD
*function
,
672 CONST D3DXVECTOR4
*constants
,
675 HRESULT WINAPI
D3DXFillCubeTextureTX( LPDIRECT3DCUBETEXTURE9 cube
,
676 CONST DWORD
*function
,
677 CONST D3DXVECTOR4
*constants
,
680 HRESULT WINAPI
D3DXFillVolumeTextureTX(LPDIRECT3DVOLUMETEXTURE9 volume
,
681 CONST DWORD
*function
,
682 CONST D3DXVECTOR4
*constants
,
685 HRESULT WINAPI
D3DXComputeNormalMap( LPDIRECT3DTEXTURE9 texture
,
686 LPDIRECT3DTEXTURE9 srctexture
,
687 CONST PALETTEENTRY
*srcpalette
,
697 #endif /* __WINE_D3DX9TEX_H */