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
68 D3DXIFF_FORCE_DWORD
= 0x7fffffff
69 } D3DXIMAGE_FILEFORMAT
;
71 typedef struct _D3DXIMAGE_INFO
78 D3DRESOURCETYPE ResourceType
;
79 D3DXIMAGE_FILEFORMAT ImageFileFormat
;
82 /**********************************************
83 ****************** Functions *****************
84 **********************************************/
85 /* Typedefs for callback functions */
86 typedef VOID (WINAPI
*LPD3DXFILL2D
)(D3DXVECTOR4
*out
, CONST D3DXVECTOR2
*texcoord
, CONST D3DXVECTOR2
*texelsize
, LPVOID data
);
87 typedef VOID (WINAPI
*LPD3DXFILL3D
)(D3DXVECTOR4
*out
, CONST D3DXVECTOR3
*texcoord
, CONST D3DXVECTOR3
*texelsize
, LPVOID data
);
94 /* Image Information */
95 HRESULT WINAPI
D3DXGetImageInfoFromFileA(LPCSTR file
, D3DXIMAGE_INFO
*info
);
96 HRESULT WINAPI
D3DXGetImageInfoFromFileW(LPCWSTR file
, D3DXIMAGE_INFO
*info
);
97 #define D3DXGetImageInfoFromFile WINELIB_NAME_AW(D3DXGetImageInfoFromFile)
99 HRESULT WINAPI
D3DXGetImageInfoFromResourceA(HMODULE module
, LPCSTR resource
, D3DXIMAGE_INFO
*info
);
100 HRESULT WINAPI
D3DXGetImageInfoFromResourceW(HMODULE module
, LPCWSTR resource
, D3DXIMAGE_INFO
*info
);
101 #define D3DXGetImageInfoFromResource WINELIB_NAME_AW(D3DXGetImageInfoFromResource)
103 HRESULT WINAPI
D3DXGetImageInfoFromFileInMemory(LPCVOID data
, UINT datasize
, D3DXIMAGE_INFO
*info
);
106 /* Surface Loading/Saving */
107 HRESULT WINAPI
D3DXLoadSurfaceFromFileA( LPDIRECT3DSURFACE9 destsurface
,
108 CONST PALETTEENTRY
*destpalette
,
109 CONST RECT
*destrect
,
114 D3DXIMAGE_INFO
*srcinfo
);
116 HRESULT WINAPI
D3DXLoadSurfaceFromFileW( LPDIRECT3DSURFACE9 destsurface
,
117 CONST PALETTEENTRY
*destpalette
,
118 CONST RECT
*destrect
,
123 D3DXIMAGE_INFO
*srcinfo
);
124 #define D3DXLoadSurfaceFromFile WINELIB_NAME_AW(D3DXLoadSurfaceFromFile)
126 HRESULT WINAPI
D3DXLoadSurfaceFromResourceA( LPDIRECT3DSURFACE9 destsurface
,
127 CONST PALETTEENTRY
*destpalette
,
128 CONST RECT
*destrect
,
134 D3DXIMAGE_INFO
*srcinfo
);
136 HRESULT WINAPI
D3DXLoadSurfaceFromResourceW( LPDIRECT3DSURFACE9 destsurface
,
137 CONST PALETTEENTRY
*destpalette
,
138 CONST RECT
*destrect
,
144 D3DXIMAGE_INFO
*srcinfo
);
145 #define D3DXLoadSurfaceFromResource WINELIB_NAME_AW(D3DXLoadSurfaceFromResource)
147 HRESULT WINAPI
D3DXLoadSurfaceFromFileInMemory(LPDIRECT3DSURFACE9 destsurface
,
148 CONST PALETTEENTRY
*destpalette
,
155 D3DXIMAGE_INFO
*srcinfo
);
157 HRESULT WINAPI
D3DXLoadSurfaceFromSurface( LPDIRECT3DSURFACE9 destsurface
,
158 CONST PALETTEENTRY
*destpalette
,
159 CONST RECT
*destrect
,
160 LPDIRECT3DSURFACE9 srcsurface
,
161 CONST PALETTEENTRY
*srcpalette
,
166 HRESULT WINAPI
D3DXLoadSurfaceFromMemory(IDirect3DSurface9
*dst_surface
,
167 const PALETTEENTRY
*dst_palette
, const RECT
*dst_rect
, const void *src_memory
,
168 D3DFORMAT src_format
, UINT src_pitch
, const PALETTEENTRY
*src_palette
, const RECT
*src_rect
,
169 DWORD filter
, D3DCOLOR color_key
);
171 HRESULT WINAPI
D3DXSaveSurfaceToFileInMemory( LPD3DXBUFFER
*destbuffer
,
172 D3DXIMAGE_FILEFORMAT destformat
,
173 LPDIRECT3DSURFACE9 srcsurface
,
174 CONST PALETTEENTRY
*srcpalette
,
175 CONST RECT
*srcrect
);
177 HRESULT WINAPI
D3DXSaveSurfaceToFileA( LPCSTR destfile
,
178 D3DXIMAGE_FILEFORMAT destformat
,
179 LPDIRECT3DSURFACE9 srcsurface
,
180 CONST PALETTEENTRY
*srcpalette
,
181 CONST RECT
*srcrect
);
183 HRESULT WINAPI
D3DXSaveSurfaceToFileW( LPCWSTR destfile
,
184 D3DXIMAGE_FILEFORMAT destformat
,
185 LPDIRECT3DSURFACE9 srcsurface
,
186 CONST PALETTEENTRY
*srcpalette
,
187 CONST RECT
*srcrect
);
188 #define D3DXSaveSurfaceToFile WINELIB_NAME_AW(D3DXSaveSurfaceToFile)
191 /* Volume Loading/Saving */
192 HRESULT WINAPI
D3DXLoadVolumeFromFileA( LPDIRECT3DVOLUME9 destvolume
,
193 CONST PALETTEENTRY
*destpalette
,
194 CONST D3DBOX
*destbox
,
196 CONST D3DBOX
*srcbox
,
199 D3DXIMAGE_INFO
*srcinfo
);
201 HRESULT WINAPI
D3DXLoadVolumeFromFileW( LPDIRECT3DVOLUME9 destVolume
,
202 CONST PALETTEENTRY
*destpalette
,
203 CONST D3DBOX
*destbox
,
205 CONST D3DBOX
*srcbox
,
208 D3DXIMAGE_INFO
*srcinfo
);
209 #define D3DXLoadVolumeFromFile WINELIB_NAME_AW(D3DXLoadVolumeFromFile)
211 HRESULT WINAPI
D3DXLoadVolumeFromResourceA( LPDIRECT3DVOLUME9 destVolume
,
212 CONST PALETTEENTRY
*destpalette
,
213 CONST D3DBOX
*destbox
,
216 CONST D3DBOX
*srcbox
,
219 D3DXIMAGE_INFO
*srcinfo
);
221 HRESULT WINAPI
D3DXLoadVolumeFromResourceW( LPDIRECT3DVOLUME9 destVolume
,
222 CONST PALETTEENTRY
*destpalette
,
223 CONST D3DBOX
*destbox
,
226 CONST D3DBOX
*srcbox
,
229 D3DXIMAGE_INFO
*srcinfo
);
230 #define D3DXLoadVolumeFromResource WINELIB_NAME_AW(D3DXLoadVolumeFromResource)
232 HRESULT WINAPI
D3DXLoadVolumeFromFileInMemory(LPDIRECT3DVOLUME9 destvolume
,
233 CONST PALETTEENTRY
*destpalette
,
234 CONST D3DBOX
*destbox
,
237 CONST D3DBOX
*srcbox
,
240 D3DXIMAGE_INFO
*srcinfo
);
242 HRESULT WINAPI
D3DXLoadVolumeFromVolume( LPDIRECT3DVOLUME9 destvolume
,
243 CONST PALETTEENTRY
*destpalette
,
244 CONST D3DBOX
*destbox
,
245 LPDIRECT3DVOLUME9 srcvolume
,
246 CONST PALETTEENTRY
*srcpalette
,
247 CONST D3DBOX
*srcbox
,
251 HRESULT WINAPI
D3DXLoadVolumeFromMemory( LPDIRECT3DVOLUME9 destvolume
,
252 CONST PALETTEENTRY
*destpalette
,
253 CONST D3DBOX
*destbox
,
258 CONST PALETTEENTRY
*srcpalette
,
259 CONST D3DBOX
*srcbox
,
263 HRESULT WINAPI
D3DXSaveVolumeToFileA( LPCSTR destfile
,
264 D3DXIMAGE_FILEFORMAT destformat
,
265 LPDIRECT3DVOLUME9 srcvolume
,
266 CONST PALETTEENTRY
*srcpalette
,
267 CONST D3DBOX
*srcbox
);
269 HRESULT WINAPI
D3DXSaveVolumeToFileW( LPCWSTR destfile
,
270 D3DXIMAGE_FILEFORMAT destformat
,
271 LPDIRECT3DVOLUME9 srcvolume
,
272 CONST PALETTEENTRY
*srcpalette
,
273 CONST D3DBOX
*srcbox
);
274 #define D3DXSaveVolumeToFile WINELIB_NAME_AW(D3DXSaveVolumeToFile)
277 /* Texture, cube texture and volume texture creation */
278 HRESULT WINAPI
D3DXCheckTextureRequirements( LPDIRECT3DDEVICE9 device
,
285 HRESULT WINAPI
D3DXCheckCubeTextureRequirements( LPDIRECT3DDEVICE9 device
,
292 HRESULT WINAPI
D3DXCheckVolumeTextureRequirements(LPDIRECT3DDEVICE9 device
,
301 HRESULT WINAPI
D3DXCreateTexture( LPDIRECT3DDEVICE9 device
,
308 LPDIRECT3DTEXTURE9
*texture
);
310 HRESULT WINAPI
D3DXCreateCubeTexture( LPDIRECT3DDEVICE9 device
,
316 LPDIRECT3DCUBETEXTURE9
*cube
);
318 HRESULT WINAPI
D3DXCreateVolumeTexture(LPDIRECT3DDEVICE9 device
,
326 LPDIRECT3DVOLUMETEXTURE9
*volume
);
328 HRESULT WINAPI
D3DXCreateTextureFromFileA( LPDIRECT3DDEVICE9 device
,
330 LPDIRECT3DTEXTURE9
*texture
);
332 HRESULT WINAPI
D3DXCreateTextureFromFileW( LPDIRECT3DDEVICE9 device
,
334 LPDIRECT3DTEXTURE9
*texture
);
335 #define D3DXCreateTextureFromFile WINELIB_NAME_AW(D3DXCreateTextureFromFile)
337 HRESULT WINAPI
D3DXCreateCubeTextureFromFileA( LPDIRECT3DDEVICE9 device
,
339 LPDIRECT3DCUBETEXTURE9
*cube
);
341 HRESULT WINAPI
D3DXCreateCubeTextureFromFileW( LPDIRECT3DDEVICE9 device
,
343 LPDIRECT3DCUBETEXTURE9
*cube
);
344 #define D3DXCreateCubeTextureFromFile WINELIB_NAME_AW(D3DXCreateCubeTextureFromFile)
346 HRESULT WINAPI
D3DXCreateVolumeTextureFromFileA(LPDIRECT3DDEVICE9 device
,
348 LPDIRECT3DVOLUMETEXTURE9
*volume
);
350 HRESULT WINAPI
D3DXCreateVolumeTextureFromFileW(LPDIRECT3DDEVICE9 device
,
352 LPDIRECT3DVOLUMETEXTURE9
*volume
);
353 #define D3DXCreateVolumeTextureFromFile WINELIB_NAME_AW(D3DXCreateVolumeTextureFromFile)
355 HRESULT WINAPI
D3DXCreateTextureFromResourceA( LPDIRECT3DDEVICE9 device
,
358 LPDIRECT3DTEXTURE9
*texture
);
360 HRESULT WINAPI
D3DXCreateTextureFromResourceW( LPDIRECT3DDEVICE9 device
,
363 LPDIRECT3DTEXTURE9
*texture
);
364 #define D3DXCreateTextureFromResource WINELIB_NAME_AW(D3DXCreateTextureFromResource)
366 HRESULT WINAPI
D3DXCreateCubeTextureFromResourceA( LPDIRECT3DDEVICE9 device
,
369 LPDIRECT3DCUBETEXTURE9
*cube
);
370 HRESULT WINAPI
D3DXCreateCubeTextureFromResourceW( LPDIRECT3DDEVICE9 device
,
373 LPDIRECT3DCUBETEXTURE9
*cube
);
374 #define D3DXCreateCubeTextureFromResource WINELIB_NAME_AW(D3DXCreateCubeTextureFromResource)
376 HRESULT WINAPI
D3DXCreateVolumeTextureFromResourceA(LPDIRECT3DDEVICE9 device
,
379 LPDIRECT3DVOLUMETEXTURE9
*volume
);
380 HRESULT WINAPI
D3DXCreateVolumeTextureFromResourceW(LPDIRECT3DDEVICE9 device
,
383 LPDIRECT3DVOLUMETEXTURE9
*volume
);
384 #define D3DXCreateVolumeTextureFromResource WINELIB_NAME_AW(D3DXCreateVolumeTextureFromResource)
386 HRESULT WINAPI
D3DXCreateTextureFromFileExA( LPDIRECT3DDEVICE9 device
,
397 D3DXIMAGE_INFO
*srcinfo
,
398 PALETTEENTRY
*palette
,
399 LPDIRECT3DTEXTURE9
*texture
);
401 HRESULT WINAPI
D3DXCreateTextureFromFileExW( LPDIRECT3DDEVICE9 device
,
412 D3DXIMAGE_INFO
*srcinfo
,
413 PALETTEENTRY
*palette
,
414 LPDIRECT3DTEXTURE9
*texture
);
415 #define D3DXCreateTextureFromFileEx WINELIB_NAME_AW(D3DXCreateTextureFromFileEx)
417 HRESULT WINAPI
D3DXCreateCubeTextureFromFileExA( LPDIRECT3DDEVICE9 device
,
427 D3DXIMAGE_INFO
*srcinfo
,
428 PALETTEENTRY
*palette
,
429 LPDIRECT3DCUBETEXTURE9
*cube
);
431 HRESULT WINAPI
D3DXCreateCubeTextureFromFileExW( LPDIRECT3DDEVICE9 device
,
441 D3DXIMAGE_INFO
*srcinfo
,
442 PALETTEENTRY
*palette
,
443 LPDIRECT3DCUBETEXTURE9
*cube
);
444 #define D3DXCreateCubeTextureFromFileEx WINELIB_NAME_AW(D3DXCreateCubeTextureFromFileEx)
446 HRESULT WINAPI
D3DXCreateVolumeTextureFromFileExA(LPDIRECT3DDEVICE9 device
,
458 D3DXIMAGE_INFO
*srcinfo
,
459 PALETTEENTRY
*palette
,
460 LPDIRECT3DVOLUMETEXTURE9
*volume
);
462 HRESULT WINAPI
D3DXCreateVolumeTextureFromFileExW(LPDIRECT3DDEVICE9 device
,
474 D3DXIMAGE_INFO
*srcinfo
,
475 PALETTEENTRY
*palette
,
476 LPDIRECT3DVOLUMETEXTURE9
*volume
);
477 #define D3DXCreateVolumeTextureFromFileEx WINELIB_NAME_AW(D3DXCreateVolumeTextureFromFileEx)
479 HRESULT WINAPI
D3DXCreateTextureFromResourceExA( LPDIRECT3DDEVICE9 device
,
491 D3DXIMAGE_INFO
*srcinfo
,
492 PALETTEENTRY
*palette
,
493 LPDIRECT3DTEXTURE9
*texture
);
495 HRESULT WINAPI
D3DXCreateTextureFromResourceExW( LPDIRECT3DDEVICE9 device
,
507 D3DXIMAGE_INFO
*srcinfo
,
508 PALETTEENTRY
*palette
,
509 LPDIRECT3DTEXTURE9
*texture
);
510 #define D3DXCreateTextureFromResourceEx WINELIB_NAME_AW(D3DXCreateTextureFromResourceEx)
512 HRESULT WINAPI
D3DXCreateCubeTextureFromResourceExA( LPDIRECT3DDEVICE9 device
,
523 D3DXIMAGE_INFO
*srcinfo
,
524 PALETTEENTRY
*palette
,
525 LPDIRECT3DCUBETEXTURE9
*cube
);
527 HRESULT WINAPI
D3DXCreateCubeTextureFromResourceExW( LPDIRECT3DDEVICE9 device
,
538 D3DXIMAGE_INFO
*srcinfo
,
539 PALETTEENTRY
*palette
,
540 LPDIRECT3DCUBETEXTURE9
*cube
);
541 #define D3DXCreateCubeTextureFromResourceEx WINELIB_NAME_AW(D3DXCreateCubeTextureFromResourceEx)
543 HRESULT WINAPI
D3DXCreateVolumeTextureFromResourceExA(LPDIRECT3DDEVICE9 device
,
556 D3DXIMAGE_INFO
*srcinfo
,
557 PALETTEENTRY
*palette
,
558 LPDIRECT3DVOLUMETEXTURE9
*volume
);
560 HRESULT WINAPI
D3DXCreateVolumeTextureFromResourceExW(LPDIRECT3DDEVICE9 device
,
573 D3DXIMAGE_INFO
*srcinfo
,
574 PALETTEENTRY
*palette
,
575 LPDIRECT3DVOLUMETEXTURE9
*volume
);
576 #define D3DXCreateVolumeTextureFromResourceEx WINELIB_NAME_AW(D3DXCreateVolumeTextureFromResourceEx)
578 HRESULT WINAPI
D3DXCreateTextureFromFileInMemory( LPDIRECT3DDEVICE9 device
,
581 LPDIRECT3DTEXTURE9
* texture
);
583 HRESULT WINAPI
D3DXCreateCubeTextureFromFileInMemory( LPDIRECT3DDEVICE9 device
,
586 LPDIRECT3DCUBETEXTURE9
* cube
);
588 HRESULT WINAPI
D3DXCreateVolumeTextureFromFileInMemory(LPDIRECT3DDEVICE9 device
,
591 LPDIRECT3DVOLUMETEXTURE9
*volume
);
593 HRESULT WINAPI
D3DXCreateTextureFromFileInMemoryEx( LPDIRECT3DDEVICE9 device
,
605 D3DXIMAGE_INFO
*srcinfo
,
606 PALETTEENTRY
*palette
,
607 LPDIRECT3DTEXTURE9
*texture
);
609 HRESULT WINAPI
D3DXCreateCubeTextureFromFileInMemoryEx( LPDIRECT3DDEVICE9 device
,
620 D3DXIMAGE_INFO
*srcinfo
,
621 PALETTEENTRY
*palette
,
622 LPDIRECT3DCUBETEXTURE9
*cube
);
624 HRESULT WINAPI
D3DXCreateVolumeTextureFromFileInMemoryEx(LPDIRECT3DDEVICE9 device
,
637 D3DXIMAGE_INFO
*srcinfo
,
638 PALETTEENTRY
*palette
,
639 LPDIRECT3DVOLUMETEXTURE9
*volume
);
641 HRESULT WINAPI
D3DXSaveTextureToFileInMemory(LPD3DXBUFFER
*destbuffer
,
642 D3DXIMAGE_FILEFORMAT destformat
,
643 LPDIRECT3DBASETEXTURE9 srctexture
,
644 CONST PALETTEENTRY
*srcpalette
);
646 HRESULT WINAPI
D3DXSaveTextureToFileA(LPCSTR destfile
,
647 D3DXIMAGE_FILEFORMAT destformat
,
648 LPDIRECT3DBASETEXTURE9 srctexture
,
649 CONST PALETTEENTRY
*srcpalette
);
650 HRESULT WINAPI
D3DXSaveTextureToFileW(LPCWSTR destfile
,
651 D3DXIMAGE_FILEFORMAT destformat
,
652 LPDIRECT3DBASETEXTURE9 srctexture
,
653 CONST PALETTEENTRY
*srcpalette
);
654 #define D3DXSaveTextureToFile WINELIB_NAME_AW(D3DXSaveTextureToFile)
657 /* Other functions */
658 HRESULT WINAPI
D3DXFilterTexture( LPDIRECT3DBASETEXTURE9 texture
,
659 CONST PALETTEENTRY
*palette
,
662 #define D3DXFilterCubeTexture D3DXFilterTexture
663 #define D3DXFilterVolumeTexture D3DXFilterTexture
665 HRESULT WINAPI
D3DXFillTexture( LPDIRECT3DTEXTURE9 texture
,
666 LPD3DXFILL2D function
,
669 HRESULT WINAPI
D3DXFillCubeTexture( LPDIRECT3DCUBETEXTURE9 cube
,
670 LPD3DXFILL3D function
,
673 HRESULT WINAPI
D3DXFillVolumeTexture( LPDIRECT3DVOLUMETEXTURE9 volume
,
674 LPD3DXFILL3D function
,
677 HRESULT WINAPI
D3DXFillTextureTX( LPDIRECT3DTEXTURE9 texture
,
678 CONST DWORD
*function
,
679 CONST D3DXVECTOR4
*constants
,
682 HRESULT WINAPI
D3DXFillCubeTextureTX( LPDIRECT3DCUBETEXTURE9 cube
,
683 CONST DWORD
*function
,
684 CONST D3DXVECTOR4
*constants
,
687 HRESULT WINAPI
D3DXFillVolumeTextureTX(LPDIRECT3DVOLUMETEXTURE9 volume
,
688 CONST DWORD
*function
,
689 CONST D3DXVECTOR4
*constants
,
692 HRESULT WINAPI
D3DXComputeNormalMap( LPDIRECT3DTEXTURE9 texture
,
693 LPDIRECT3DTEXTURE9 srctexture
,
694 CONST PALETTEENTRY
*srcpalette
,
704 #endif /* __WINE_D3DX9TEX_H */