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 D3DXSaveSurfaceToFileA( LPCSTR destfile,
172 D3DXIMAGE_FILEFORMAT destformat,
173 LPDIRECT3DSURFACE9 srcsurface,
174 CONST PALETTEENTRY *srcpalette,
175 CONST RECT *srcrect);
177 HRESULT WINAPI D3DXSaveSurfaceToFileW( LPCWSTR destfile,
178 D3DXIMAGE_FILEFORMAT destformat,
179 LPDIRECT3DSURFACE9 srcsurface,
180 CONST PALETTEENTRY *srcpalette,
181 CONST RECT *srcrect);
182 #define D3DXSaveSurfaceToFile WINELIB_NAME_AW(D3DXSaveSurfaceToFile)
185 /* Volume Loading/Saving */
186 HRESULT WINAPI D3DXLoadVolumeFromFileA( LPDIRECT3DVOLUME9 destvolume,
187 CONST PALETTEENTRY *destpalette,
188 CONST D3DBOX *destbox,
190 CONST D3DBOX *srcbox,
193 D3DXIMAGE_INFO *srcinfo);
195 HRESULT WINAPI D3DXLoadVolumeFromFileW( LPDIRECT3DVOLUME9 destVolume,
196 CONST PALETTEENTRY *destpalette,
197 CONST D3DBOX *destbox,
199 CONST D3DBOX *srcbox,
202 D3DXIMAGE_INFO *srcinfo);
203 #define D3DXLoadVolumeFromFile WINELIB_NAME_AW(D3DXLoadVolumeFromFile)
205 HRESULT WINAPI D3DXLoadVolumeFromResourceA( LPDIRECT3DVOLUME9 destVolume,
206 CONST PALETTEENTRY *destpalette,
207 CONST D3DBOX *destbox,
210 CONST D3DBOX *srcbox,
213 D3DXIMAGE_INFO *srcinfo);
215 HRESULT WINAPI D3DXLoadVolumeFromResourceW( LPDIRECT3DVOLUME9 destVolume,
216 CONST PALETTEENTRY *destpalette,
217 CONST D3DBOX *destbox,
220 CONST D3DBOX *srcbox,
223 D3DXIMAGE_INFO *srcinfo);
224 #define D3DXLoadVolumeFromResource WINELIB_NAME_AW(D3DXLoadVolumeFromResource)
226 HRESULT WINAPI D3DXLoadVolumeFromFileInMemory(LPDIRECT3DVOLUME9 destvolume,
227 CONST PALETTEENTRY *destpalette,
228 CONST D3DBOX *destbox,
231 CONST D3DBOX *srcbox,
234 D3DXIMAGE_INFO *srcinfo);
236 HRESULT WINAPI D3DXLoadVolumeFromVolume( LPDIRECT3DVOLUME9 destvolume,
237 CONST PALETTEENTRY *destpalette,
238 CONST D3DBOX *destbox,
239 LPDIRECT3DVOLUME9 srcvolume,
240 CONST PALETTEENTRY *srcpalette,
241 CONST D3DBOX *srcbox,
245 HRESULT WINAPI D3DXLoadVolumeFromMemory( LPDIRECT3DVOLUME9 destvolume,
246 CONST PALETTEENTRY *destpalette,
247 CONST D3DBOX *destbox,
252 CONST PALETTEENTRY *srcpalette,
253 CONST D3DBOX *srcbox,
257 HRESULT WINAPI D3DXSaveVolumeToFileA( LPCSTR destfile,
258 D3DXIMAGE_FILEFORMAT destformat,
259 LPDIRECT3DVOLUME9 srcvolume,
260 CONST PALETTEENTRY *srcpalette,
261 CONST D3DBOX *srcbox);
263 HRESULT WINAPI D3DXSaveVolumeToFileW( LPCWSTR destfile,
264 D3DXIMAGE_FILEFORMAT destformat,
265 LPDIRECT3DVOLUME9 srcvolume,
266 CONST PALETTEENTRY *srcpalette,
267 CONST D3DBOX *srcbox);
268 #define D3DXSaveVolumeToFile WINELIB_NAME_AW(D3DXSaveVolumeToFile)
271 /* Texture, cube texture and volume texture creation */
272 HRESULT WINAPI D3DXCheckTextureRequirements( LPDIRECT3DDEVICE9 device,
279 HRESULT WINAPI D3DXCheckCubeTextureRequirements( LPDIRECT3DDEVICE9 device,
286 HRESULT WINAPI D3DXCheckVolumeTextureRequirements(LPDIRECT3DDEVICE9 device,
295 HRESULT WINAPI D3DXCreateTexture( LPDIRECT3DDEVICE9 device,
302 LPDIRECT3DTEXTURE9 *texture);
304 HRESULT WINAPI D3DXCreateCubeTexture( LPDIRECT3DDEVICE9 device,
310 LPDIRECT3DCUBETEXTURE9 *cube);
312 HRESULT WINAPI D3DXCreateVolumeTexture(LPDIRECT3DDEVICE9 device,
320 LPDIRECT3DVOLUMETEXTURE9 *volume);
322 HRESULT WINAPI D3DXCreateTextureFromFileA( LPDIRECT3DDEVICE9 device,
324 LPDIRECT3DTEXTURE9 *texture);
326 HRESULT WINAPI D3DXCreateTextureFromFileW( LPDIRECT3DDEVICE9 device,
328 LPDIRECT3DTEXTURE9 *texture);
329 #define D3DXCreateTextureFromFile WINELIB_NAME_AW(D3DXCreateTextureFromFile)
331 HRESULT WINAPI D3DXCreateCubeTextureFromFileA( LPDIRECT3DDEVICE9 device,
333 LPDIRECT3DCUBETEXTURE9 *cube);
335 HRESULT WINAPI D3DXCreateCubeTextureFromFileW( LPDIRECT3DDEVICE9 device,
337 LPDIRECT3DCUBETEXTURE9 *cube);
338 #define D3DXCreateCubeTextureFromFile WINELIB_NAME_AW(D3DXCreateCubeTextureFromFile)
340 HRESULT WINAPI D3DXCreateVolumeTextureFromFileA(LPDIRECT3DDEVICE9 device,
342 LPDIRECT3DVOLUMETEXTURE9 *volume);
344 HRESULT WINAPI D3DXCreateVolumeTextureFromFileW(LPDIRECT3DDEVICE9 device,
346 LPDIRECT3DVOLUMETEXTURE9 *volume);
347 #define D3DXCreateVolumeTextureFromFile WINELIB_NAME_AW(D3DXCreateVolumeTextureFromFile)
349 HRESULT WINAPI D3DXCreateTextureFromResourceA( LPDIRECT3DDEVICE9 device,
352 LPDIRECT3DTEXTURE9 *texture);
354 HRESULT WINAPI D3DXCreateTextureFromResourceW( LPDIRECT3DDEVICE9 device,
357 LPDIRECT3DTEXTURE9 *texture);
358 #define D3DXCreateTextureFromResource WINELIB_NAME_AW(D3DXCreateTextureFromResource)
360 HRESULT WINAPI D3DXCreateCubeTextureFromResourceA( LPDIRECT3DDEVICE9 device,
363 LPDIRECT3DCUBETEXTURE9 *cube);
364 HRESULT WINAPI D3DXCreateCubeTextureFromResourceW( LPDIRECT3DDEVICE9 device,
367 LPDIRECT3DCUBETEXTURE9 *cube);
368 #define D3DXCreateCubeTextureFromResource WINELIB_NAME_AW(D3DXCreateCubeTextureFromResource)
370 HRESULT WINAPI D3DXCreateVolumeTextureFromResourceA(LPDIRECT3DDEVICE9 device,
373 LPDIRECT3DVOLUMETEXTURE9 *volume);
374 HRESULT WINAPI D3DXCreateVolumeTextureFromResourceW(LPDIRECT3DDEVICE9 device,
377 LPDIRECT3DVOLUMETEXTURE9 *volume);
378 #define D3DXCreateVolumeTextureFromResource WINELIB_NAME_AW(D3DXCreateVolumeTextureFromResource)
380 HRESULT WINAPI D3DXCreateTextureFromFileExA( LPDIRECT3DDEVICE9 device,
391 D3DXIMAGE_INFO *srcinfo,
392 PALETTEENTRY *palette,
393 LPDIRECT3DTEXTURE9 *texture);
395 HRESULT WINAPI D3DXCreateTextureFromFileExW( LPDIRECT3DDEVICE9 device,
406 D3DXIMAGE_INFO *srcinfo,
407 PALETTEENTRY *palette,
408 LPDIRECT3DTEXTURE9 *texture);
409 #define D3DXCreateTextureFromFileEx WINELIB_NAME_AW(D3DXCreateTextureFromFileEx)
411 HRESULT WINAPI D3DXCreateCubeTextureFromFileExA( LPDIRECT3DDEVICE9 device,
421 D3DXIMAGE_INFO *srcinfo,
422 PALETTEENTRY *palette,
423 LPDIRECT3DCUBETEXTURE9 *cube);
425 HRESULT WINAPI D3DXCreateCubeTextureFromFileExW( LPDIRECT3DDEVICE9 device,
435 D3DXIMAGE_INFO *srcinfo,
436 PALETTEENTRY *palette,
437 LPDIRECT3DCUBETEXTURE9 *cube);
438 #define D3DXCreateCubeTextureFromFileEx WINELIB_NAME_AW(D3DXCreateCubeTextureFromFileEx)
440 HRESULT WINAPI D3DXCreateVolumeTextureFromFileExA(LPDIRECT3DDEVICE9 device,
452 D3DXIMAGE_INFO *srcinfo,
453 PALETTEENTRY *palette,
454 LPDIRECT3DVOLUMETEXTURE9 *volume);
456 HRESULT WINAPI D3DXCreateVolumeTextureFromFileExW(LPDIRECT3DDEVICE9 device,
468 D3DXIMAGE_INFO *srcinfo,
469 PALETTEENTRY *palette,
470 LPDIRECT3DVOLUMETEXTURE9 *volume);
471 #define D3DXCreateVolumeTextureFromFileEx WINELIB_NAME_AW(D3DXCreateVolumeTextureFromFileEx)
473 HRESULT WINAPI D3DXCreateTextureFromResourceExA( LPDIRECT3DDEVICE9 device,
485 D3DXIMAGE_INFO *srcinfo,
486 PALETTEENTRY *palette,
487 LPDIRECT3DTEXTURE9 *texture);
489 HRESULT WINAPI D3DXCreateTextureFromResourceExW( LPDIRECT3DDEVICE9 device,
501 D3DXIMAGE_INFO *srcinfo,
502 PALETTEENTRY *palette,
503 LPDIRECT3DTEXTURE9 *texture);
504 #define D3DXCreateTextureFromResourceEx WINELIB_NAME_AW(D3DXCreateTextureFromResourceEx)
506 HRESULT WINAPI D3DXCreateCubeTextureFromResourceExA( LPDIRECT3DDEVICE9 device,
517 D3DXIMAGE_INFO *srcinfo,
518 PALETTEENTRY *palette,
519 LPDIRECT3DCUBETEXTURE9 *cube);
521 HRESULT WINAPI D3DXCreateCubeTextureFromResourceExW( LPDIRECT3DDEVICE9 device,
532 D3DXIMAGE_INFO *srcinfo,
533 PALETTEENTRY *palette,
534 LPDIRECT3DCUBETEXTURE9 *cube);
535 #define D3DXCreateCubeTextureFromResourceEx WINELIB_NAME_AW(D3DXCreateCubeTextureFromResourceEx)
537 HRESULT WINAPI D3DXCreateVolumeTextureFromResourceExA(LPDIRECT3DDEVICE9 device,
550 D3DXIMAGE_INFO *srcinfo,
551 PALETTEENTRY *palette,
552 LPDIRECT3DVOLUMETEXTURE9 *volume);
554 HRESULT WINAPI D3DXCreateVolumeTextureFromResourceExW(LPDIRECT3DDEVICE9 device,
567 D3DXIMAGE_INFO *srcinfo,
568 PALETTEENTRY *palette,
569 LPDIRECT3DVOLUMETEXTURE9 *volume);
570 #define D3DXCreateVolumeTextureFromResourceEx WINELIB_NAME_AW(D3DXCreateVolumeTextureFromResourceEx)
572 HRESULT WINAPI D3DXCreateTextureFromFileInMemory( LPDIRECT3DDEVICE9 device,
575 LPDIRECT3DTEXTURE9* texture);
577 HRESULT WINAPI D3DXCreateCubeTextureFromFileInMemory( LPDIRECT3DDEVICE9 device,
580 LPDIRECT3DCUBETEXTURE9* cube);
582 HRESULT WINAPI D3DXCreateVolumeTextureFromFileInMemory(LPDIRECT3DDEVICE9 device,
585 LPDIRECT3DVOLUMETEXTURE9 *volume);
587 HRESULT WINAPI D3DXCreateTextureFromFileInMemoryEx( LPDIRECT3DDEVICE9 device,
599 D3DXIMAGE_INFO *srcinfo,
600 PALETTEENTRY *palette,
601 LPDIRECT3DTEXTURE9 *texture);
603 HRESULT WINAPI D3DXCreateCubeTextureFromFileInMemoryEx( LPDIRECT3DDEVICE9 device,
614 D3DXIMAGE_INFO *srcinfo,
615 PALETTEENTRY *palette,
616 LPDIRECT3DCUBETEXTURE9 *cube);
618 HRESULT WINAPI D3DXCreateVolumeTextureFromFileInMemoryEx(LPDIRECT3DDEVICE9 device,
631 D3DXIMAGE_INFO *srcinfo,
632 PALETTEENTRY *palette,
633 LPDIRECT3DVOLUMETEXTURE9 *volume);
635 HRESULT WINAPI D3DXSaveTextureToFileA(LPCSTR destfile,
636 D3DXIMAGE_FILEFORMAT destformat,
637 LPDIRECT3DBASETEXTURE9 srctexture,
638 CONST PALETTEENTRY *srcpalette);
639 HRESULT WINAPI D3DXSaveTextureToFileW(LPCWSTR destfile,
640 D3DXIMAGE_FILEFORMAT destformat,
641 LPDIRECT3DBASETEXTURE9 srctexture,
642 CONST PALETTEENTRY *srcpalette);
643 #define D3DXSaveTextureToFile WINELIB_NAME_AW(D3DXSaveTextureToFile)
646 /* Other functions */
647 HRESULT WINAPI D3DXFilterTexture( LPDIRECT3DBASETEXTURE9 texture,
648 CONST PALETTEENTRY *palette,
651 #define D3DXFilterCubeTexture D3DXFilterTexture
652 #define D3DXFilterVolumeTexture D3DXFilterTexture
654 HRESULT WINAPI D3DXFillTexture( LPDIRECT3DTEXTURE9 texture,
655 LPD3DXFILL2D function,
658 HRESULT WINAPI D3DXFillCubeTexture( LPDIRECT3DCUBETEXTURE9 cube,
659 LPD3DXFILL3D function,
662 HRESULT WINAPI D3DXFillVolumeTexture( LPDIRECT3DVOLUMETEXTURE9 volume,
663 LPD3DXFILL3D function,
666 HRESULT WINAPI D3DXFillTextureTX( LPDIRECT3DTEXTURE9 texture,
667 CONST DWORD *function,
668 CONST D3DXVECTOR4 *constants,
671 HRESULT WINAPI D3DXFillCubeTextureTX( LPDIRECT3DCUBETEXTURE9 cube,
672 CONST DWORD *function,
673 CONST D3DXVECTOR4 *constants,
676 HRESULT WINAPI D3DXFillVolumeTextureTX(LPDIRECT3DVOLUMETEXTURE9 volume,
677 CONST DWORD *function,
678 CONST D3DXVECTOR4 *constants,
681 HRESULT WINAPI D3DXComputeNormalMap( LPDIRECT3DTEXTURE9 texture,
682 LPDIRECT3DTEXTURE9 srctexture,
683 CONST PALETTEENTRY *srcpalette,
693 #endif /* __WINE_D3DX9TEX_H */