dsrc isn't necessary for this repo
[client-tools.git] / src / external / 3rd / library / directx9 / include / d3dx9tex.h
blob0d62b6996973ad564fc95e063e94355039e4b7fe
1 //////////////////////////////////////////////////////////////////////////////
2 //
3 // Copyright (C) Microsoft Corporation. All Rights Reserved.
4 //
5 // File: d3dx9tex.h
6 // Content: D3DX texturing APIs
7 //
8 //////////////////////////////////////////////////////////////////////////////
10 #include "d3dx9.h"
12 #ifndef __D3DX9TEX_H__
13 #define __D3DX9TEX_H__
16 //----------------------------------------------------------------------------
17 // D3DX_FILTER flags:
18 // ------------------
20 // A valid filter must contain one of these values:
22 // D3DX_FILTER_NONE
23 // No scaling or filtering will take place. Pixels outside the bounds
24 // of the source image are assumed to be transparent black.
25 // D3DX_FILTER_POINT
26 // Each destination pixel is computed by sampling the nearest pixel
27 // from the source image.
28 // D3DX_FILTER_LINEAR
29 // Each destination pixel is computed by linearly interpolating between
30 // the nearest pixels in the source image. This filter works best
31 // when the scale on each axis is less than 2.
32 // D3DX_FILTER_TRIANGLE
33 // Every pixel in the source image contributes equally to the
34 // destination image. This is the slowest of all the filters.
35 // D3DX_FILTER_BOX
36 // Each pixel is computed by averaging a 2x2(x2) box pixels from
37 // the source image. Only works when the dimensions of the
38 // destination are half those of the source. (as with mip maps)
40 // And can be OR'd with any of these optional flags:
42 // D3DX_FILTER_MIRROR_U
43 // Indicates that pixels off the edge of the texture on the U-axis
44 // should be mirrored, not wraped.
45 // D3DX_FILTER_MIRROR_V
46 // Indicates that pixels off the edge of the texture on the V-axis
47 // should be mirrored, not wraped.
48 // D3DX_FILTER_MIRROR_W
49 // Indicates that pixels off the edge of the texture on the W-axis
50 // should be mirrored, not wraped.
51 // D3DX_FILTER_MIRROR
52 // Same as specifying D3DX_FILTER_MIRROR_U | D3DX_FILTER_MIRROR_V |
53 // D3DX_FILTER_MIRROR_V
54 // D3DX_FILTER_DITHER
55 // Dithers the resulting image using a 4x4 order dither pattern.
56 // D3DX_FILTER_SRGB_IN
57 // Denotes that the input data is in sRGB (gamma 2.2) colorspace.
58 // D3DX_FILTER_SRGB_OUT
59 // Denotes that the output data is in sRGB (gamma 2.2) colorspace.
60 // D3DX_FILTER_SRGB
61 // Same as specifying D3DX_FILTER_SRGB_IN | D3DX_FILTER_SRGB_OUT
63 //----------------------------------------------------------------------------
65 #define D3DX_FILTER_NONE (1 << 0)
66 #define D3DX_FILTER_POINT (2 << 0)
67 #define D3DX_FILTER_LINEAR (3 << 0)
68 #define D3DX_FILTER_TRIANGLE (4 << 0)
69 #define D3DX_FILTER_BOX (5 << 0)
71 #define D3DX_FILTER_MIRROR_U (1 << 16)
72 #define D3DX_FILTER_MIRROR_V (2 << 16)
73 #define D3DX_FILTER_MIRROR_W (4 << 16)
74 #define D3DX_FILTER_MIRROR (7 << 16)
76 #define D3DX_FILTER_DITHER (1 << 19)
77 #define D3DX_FILTER_DITHER_DIFFUSION (2 << 19)
79 #define D3DX_FILTER_SRGB_IN (1 << 21)
80 #define D3DX_FILTER_SRGB_OUT (2 << 21)
81 #define D3DX_FILTER_SRGB (3 << 21)
84 //----------------------------------------------------------------------------
85 // D3DX_NORMALMAP flags:
86 // ---------------------
87 // These flags are used to control how D3DXComputeNormalMap generates normal
88 // maps. Any number of these flags may be OR'd together in any combination.
90 // D3DX_NORMALMAP_MIRROR_U
91 // Indicates that pixels off the edge of the texture on the U-axis
92 // should be mirrored, not wraped.
93 // D3DX_NORMALMAP_MIRROR_V
94 // Indicates that pixels off the edge of the texture on the V-axis
95 // should be mirrored, not wraped.
96 // D3DX_NORMALMAP_MIRROR
97 // Same as specifying D3DX_NORMALMAP_MIRROR_U | D3DX_NORMALMAP_MIRROR_V
98 // D3DX_NORMALMAP_INVERTSIGN
99 // Inverts the direction of each normal
100 // D3DX_NORMALMAP_COMPUTE_OCCLUSION
101 // Compute the per pixel Occlusion term and encodes it into the alpha.
102 // An Alpha of 1 means that the pixel is not obscured in anyway, and
103 // an alpha of 0 would mean that the pixel is completly obscured.
105 //----------------------------------------------------------------------------
107 //----------------------------------------------------------------------------
109 #define D3DX_NORMALMAP_MIRROR_U (1 << 16)
110 #define D3DX_NORMALMAP_MIRROR_V (2 << 16)
111 #define D3DX_NORMALMAP_MIRROR (3 << 16)
112 #define D3DX_NORMALMAP_INVERTSIGN (8 << 16)
113 #define D3DX_NORMALMAP_COMPUTE_OCCLUSION (16 << 16)
118 //----------------------------------------------------------------------------
119 // D3DX_CHANNEL flags:
120 // -------------------
121 // These flags are used by functions which operate on or more channels
122 // in a texture.
124 // D3DX_CHANNEL_RED
125 // Indicates the red channel should be used
126 // D3DX_CHANNEL_BLUE
127 // Indicates the blue channel should be used
128 // D3DX_CHANNEL_GREEN
129 // Indicates the green channel should be used
130 // D3DX_CHANNEL_ALPHA
131 // Indicates the alpha channel should be used
132 // D3DX_CHANNEL_LUMINANCE
133 // Indicates the luminaces of the red green and blue channels should be
134 // used.
136 //----------------------------------------------------------------------------
138 #define D3DX_CHANNEL_RED (1 << 0)
139 #define D3DX_CHANNEL_BLUE (1 << 1)
140 #define D3DX_CHANNEL_GREEN (1 << 2)
141 #define D3DX_CHANNEL_ALPHA (1 << 3)
142 #define D3DX_CHANNEL_LUMINANCE (1 << 4)
147 //----------------------------------------------------------------------------
148 // D3DXIMAGE_FILEFORMAT:
149 // ---------------------
150 // This enum is used to describe supported image file formats.
152 //----------------------------------------------------------------------------
154 typedef enum _D3DXIMAGE_FILEFORMAT
156 D3DXIFF_BMP = 0,
157 D3DXIFF_JPG = 1,
158 D3DXIFF_TGA = 2,
159 D3DXIFF_PNG = 3,
160 D3DXIFF_DDS = 4,
161 D3DXIFF_PPM = 5,
162 D3DXIFF_DIB = 6,
163 D3DXIFF_HDR = 7, //high dynamic range formats
164 D3DXIFF_PFM = 8, //
165 D3DXIFF_FORCE_DWORD = 0x7fffffff
167 } D3DXIMAGE_FILEFORMAT;
170 //----------------------------------------------------------------------------
171 // LPD3DXFILL2D and LPD3DXFILL3D:
172 // ------------------------------
173 // Function types used by the texture fill functions.
175 // Parameters:
176 // pOut
177 // Pointer to a vector which the function uses to return its result.
178 // X,Y,Z,W will be mapped to R,G,B,A respectivly.
179 // pTexCoord
180 // Pointer to a vector containing the coordinates of the texel currently
181 // being evaluated. Textures and VolumeTexture texcoord components
182 // range from 0 to 1. CubeTexture texcoord component range from -1 to 1.
183 // pTexelSize
184 // Pointer to a vector containing the dimensions of the current texel.
185 // pData
186 // Pointer to user data.
188 //----------------------------------------------------------------------------
190 typedef VOID (WINAPI *LPD3DXFILL2D)(D3DXVECTOR4 *pOut,
191 CONST D3DXVECTOR2 *pTexCoord, CONST D3DXVECTOR2 *pTexelSize, LPVOID pData);
193 typedef VOID (WINAPI *LPD3DXFILL3D)(D3DXVECTOR4 *pOut,
194 CONST D3DXVECTOR3 *pTexCoord, CONST D3DXVECTOR3 *pTexelSize, LPVOID pData);
198 //----------------------------------------------------------------------------
199 // D3DXIMAGE_INFO:
200 // ---------------
201 // This structure is used to return a rough description of what the
202 // the original contents of an image file looked like.
204 // Width
205 // Width of original image in pixels
206 // Height
207 // Height of original image in pixels
208 // Depth
209 // Depth of original image in pixels
210 // MipLevels
211 // Number of mip levels in original image
212 // Format
213 // D3D format which most closely describes the data in original image
214 // ResourceType
215 // D3DRESOURCETYPE representing the type of texture stored in the file.
216 // D3DRTYPE_TEXTURE, D3DRTYPE_VOLUMETEXTURE, or D3DRTYPE_CUBETEXTURE.
217 // ImageFileFormat
218 // D3DXIMAGE_FILEFORMAT representing the format of the image file.
220 //----------------------------------------------------------------------------
222 typedef struct _D3DXIMAGE_INFO
224 UINT Width;
225 UINT Height;
226 UINT Depth;
227 UINT MipLevels;
228 D3DFORMAT Format;
229 D3DRESOURCETYPE ResourceType;
230 D3DXIMAGE_FILEFORMAT ImageFileFormat;
232 } D3DXIMAGE_INFO;
238 #ifdef __cplusplus
239 extern "C" {
240 #endif //__cplusplus
244 //////////////////////////////////////////////////////////////////////////////
245 // Image File APIs ///////////////////////////////////////////////////////////
246 //////////////////////////////////////////////////////////////////////////////
248 //----------------------------------------------------------------------------
249 // GetImageInfoFromFile/Resource:
250 // ------------------------------
251 // Fills in a D3DXIMAGE_INFO struct with information about an image file.
253 // Parameters:
254 // pSrcFile
255 // File name of the source image.
256 // pSrcModule
257 // Module where resource is located, or NULL for module associated
258 // with image the os used to create the current process.
259 // pSrcResource
260 // Resource name
261 // pSrcData
262 // Pointer to file in memory.
263 // SrcDataSize
264 // Size in bytes of file in memory.
265 // pSrcInfo
266 // Pointer to a D3DXIMAGE_INFO structure to be filled in with the
267 // description of the data in the source image file.
269 //----------------------------------------------------------------------------
271 HRESULT WINAPI
272 D3DXGetImageInfoFromFileA(
273 LPCSTR pSrcFile,
274 D3DXIMAGE_INFO* pSrcInfo);
276 HRESULT WINAPI
277 D3DXGetImageInfoFromFileW(
278 LPCWSTR pSrcFile,
279 D3DXIMAGE_INFO* pSrcInfo);
281 #ifdef UNICODE
282 #define D3DXGetImageInfoFromFile D3DXGetImageInfoFromFileW
283 #else
284 #define D3DXGetImageInfoFromFile D3DXGetImageInfoFromFileA
285 #endif
288 HRESULT WINAPI
289 D3DXGetImageInfoFromResourceA(
290 HMODULE hSrcModule,
291 LPCSTR pSrcResource,
292 D3DXIMAGE_INFO* pSrcInfo);
294 HRESULT WINAPI
295 D3DXGetImageInfoFromResourceW(
296 HMODULE hSrcModule,
297 LPCWSTR pSrcResource,
298 D3DXIMAGE_INFO* pSrcInfo);
300 #ifdef UNICODE
301 #define D3DXGetImageInfoFromResource D3DXGetImageInfoFromResourceW
302 #else
303 #define D3DXGetImageInfoFromResource D3DXGetImageInfoFromResourceA
304 #endif
307 HRESULT WINAPI
308 D3DXGetImageInfoFromFileInMemory(
309 LPCVOID pSrcData,
310 UINT SrcDataSize,
311 D3DXIMAGE_INFO* pSrcInfo);
316 //////////////////////////////////////////////////////////////////////////////
317 // Load/Save Surface APIs ////////////////////////////////////////////////////
318 //////////////////////////////////////////////////////////////////////////////
320 //----------------------------------------------------------------------------
321 // D3DXLoadSurfaceFromFile/Resource:
322 // ---------------------------------
323 // Load surface from a file or resource
325 // Parameters:
326 // pDestSurface
327 // Destination surface, which will receive the image.
328 // pDestPalette
329 // Destination palette of 256 colors, or NULL
330 // pDestRect
331 // Destination rectangle, or NULL for entire surface
332 // pSrcFile
333 // File name of the source image.
334 // pSrcModule
335 // Module where resource is located, or NULL for module associated
336 // with image the os used to create the current process.
337 // pSrcResource
338 // Resource name
339 // pSrcData
340 // Pointer to file in memory.
341 // SrcDataSize
342 // Size in bytes of file in memory.
343 // pSrcRect
344 // Source rectangle, or NULL for entire image
345 // Filter
346 // D3DX_FILTER flags controlling how the image is filtered.
347 // Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
348 // ColorKey
349 // Color to replace with transparent black, or 0 to disable colorkey.
350 // This is always a 32-bit ARGB color, independent of the source image
351 // format. Alpha is significant, and should usually be set to FF for
352 // opaque colorkeys. (ex. Opaque black == 0xff000000)
353 // pSrcInfo
354 // Pointer to a D3DXIMAGE_INFO structure to be filled in with the
355 // description of the data in the source image file, or NULL.
357 //----------------------------------------------------------------------------
359 HRESULT WINAPI
360 D3DXLoadSurfaceFromFileA(
361 LPDIRECT3DSURFACE9 pDestSurface,
362 CONST PALETTEENTRY* pDestPalette,
363 CONST RECT* pDestRect,
364 LPCSTR pSrcFile,
365 CONST RECT* pSrcRect,
366 DWORD Filter,
367 D3DCOLOR ColorKey,
368 D3DXIMAGE_INFO* pSrcInfo);
370 HRESULT WINAPI
371 D3DXLoadSurfaceFromFileW(
372 LPDIRECT3DSURFACE9 pDestSurface,
373 CONST PALETTEENTRY* pDestPalette,
374 CONST RECT* pDestRect,
375 LPCWSTR pSrcFile,
376 CONST RECT* pSrcRect,
377 DWORD Filter,
378 D3DCOLOR ColorKey,
379 D3DXIMAGE_INFO* pSrcInfo);
381 #ifdef UNICODE
382 #define D3DXLoadSurfaceFromFile D3DXLoadSurfaceFromFileW
383 #else
384 #define D3DXLoadSurfaceFromFile D3DXLoadSurfaceFromFileA
385 #endif
389 HRESULT WINAPI
390 D3DXLoadSurfaceFromResourceA(
391 LPDIRECT3DSURFACE9 pDestSurface,
392 CONST PALETTEENTRY* pDestPalette,
393 CONST RECT* pDestRect,
394 HMODULE hSrcModule,
395 LPCSTR pSrcResource,
396 CONST RECT* pSrcRect,
397 DWORD Filter,
398 D3DCOLOR ColorKey,
399 D3DXIMAGE_INFO* pSrcInfo);
401 HRESULT WINAPI
402 D3DXLoadSurfaceFromResourceW(
403 LPDIRECT3DSURFACE9 pDestSurface,
404 CONST PALETTEENTRY* pDestPalette,
405 CONST RECT* pDestRect,
406 HMODULE hSrcModule,
407 LPCWSTR pSrcResource,
408 CONST RECT* pSrcRect,
409 DWORD Filter,
410 D3DCOLOR ColorKey,
411 D3DXIMAGE_INFO* pSrcInfo);
414 #ifdef UNICODE
415 #define D3DXLoadSurfaceFromResource D3DXLoadSurfaceFromResourceW
416 #else
417 #define D3DXLoadSurfaceFromResource D3DXLoadSurfaceFromResourceA
418 #endif
422 HRESULT WINAPI
423 D3DXLoadSurfaceFromFileInMemory(
424 LPDIRECT3DSURFACE9 pDestSurface,
425 CONST PALETTEENTRY* pDestPalette,
426 CONST RECT* pDestRect,
427 LPCVOID pSrcData,
428 UINT SrcDataSize,
429 CONST RECT* pSrcRect,
430 DWORD Filter,
431 D3DCOLOR ColorKey,
432 D3DXIMAGE_INFO* pSrcInfo);
436 //----------------------------------------------------------------------------
437 // D3DXLoadSurfaceFromSurface:
438 // ---------------------------
439 // Load surface from another surface (with color conversion)
441 // Parameters:
442 // pDestSurface
443 // Destination surface, which will receive the image.
444 // pDestPalette
445 // Destination palette of 256 colors, or NULL
446 // pDestRect
447 // Destination rectangle, or NULL for entire surface
448 // pSrcSurface
449 // Source surface
450 // pSrcPalette
451 // Source palette of 256 colors, or NULL
452 // pSrcRect
453 // Source rectangle, or NULL for entire surface
454 // Filter
455 // D3DX_FILTER flags controlling how the image is filtered.
456 // Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
457 // ColorKey
458 // Color to replace with transparent black, or 0 to disable colorkey.
459 // This is always a 32-bit ARGB color, independent of the source image
460 // format. Alpha is significant, and should usually be set to FF for
461 // opaque colorkeys. (ex. Opaque black == 0xff000000)
463 //----------------------------------------------------------------------------
465 HRESULT WINAPI
466 D3DXLoadSurfaceFromSurface(
467 LPDIRECT3DSURFACE9 pDestSurface,
468 CONST PALETTEENTRY* pDestPalette,
469 CONST RECT* pDestRect,
470 LPDIRECT3DSURFACE9 pSrcSurface,
471 CONST PALETTEENTRY* pSrcPalette,
472 CONST RECT* pSrcRect,
473 DWORD Filter,
474 D3DCOLOR ColorKey);
477 //----------------------------------------------------------------------------
478 // D3DXLoadSurfaceFromMemory:
479 // --------------------------
480 // Load surface from memory.
482 // Parameters:
483 // pDestSurface
484 // Destination surface, which will receive the image.
485 // pDestPalette
486 // Destination palette of 256 colors, or NULL
487 // pDestRect
488 // Destination rectangle, or NULL for entire surface
489 // pSrcMemory
490 // Pointer to the top-left corner of the source image in memory
491 // SrcFormat
492 // Pixel format of the source image.
493 // SrcPitch
494 // Pitch of source image, in bytes. For DXT formats, this number
495 // should represent the width of one row of cells, in bytes.
496 // pSrcPalette
497 // Source palette of 256 colors, or NULL
498 // pSrcRect
499 // Source rectangle.
500 // Filter
501 // D3DX_FILTER flags controlling how the image is filtered.
502 // Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
503 // ColorKey
504 // Color to replace with transparent black, or 0 to disable colorkey.
505 // This is always a 32-bit ARGB color, independent of the source image
506 // format. Alpha is significant, and should usually be set to FF for
507 // opaque colorkeys. (ex. Opaque black == 0xff000000)
509 //----------------------------------------------------------------------------
511 HRESULT WINAPI
512 D3DXLoadSurfaceFromMemory(
513 LPDIRECT3DSURFACE9 pDestSurface,
514 CONST PALETTEENTRY* pDestPalette,
515 CONST RECT* pDestRect,
516 LPCVOID pSrcMemory,
517 D3DFORMAT SrcFormat,
518 UINT SrcPitch,
519 CONST PALETTEENTRY* pSrcPalette,
520 CONST RECT* pSrcRect,
521 DWORD Filter,
522 D3DCOLOR ColorKey);
525 //----------------------------------------------------------------------------
526 // D3DXSaveSurfaceToFile:
527 // ----------------------
528 // Save a surface to a image file.
530 // Parameters:
531 // pDestFile
532 // File name of the destination file
533 // DestFormat
534 // D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
535 // pSrcSurface
536 // Source surface, containing the image to be saved
537 // pSrcPalette
538 // Source palette of 256 colors, or NULL
539 // pSrcRect
540 // Source rectangle, or NULL for the entire image
542 //----------------------------------------------------------------------------
544 HRESULT WINAPI
545 D3DXSaveSurfaceToFileA(
546 LPCSTR pDestFile,
547 D3DXIMAGE_FILEFORMAT DestFormat,
548 LPDIRECT3DSURFACE9 pSrcSurface,
549 CONST PALETTEENTRY* pSrcPalette,
550 CONST RECT* pSrcRect);
552 HRESULT WINAPI
553 D3DXSaveSurfaceToFileW(
554 LPCWSTR pDestFile,
555 D3DXIMAGE_FILEFORMAT DestFormat,
556 LPDIRECT3DSURFACE9 pSrcSurface,
557 CONST PALETTEENTRY* pSrcPalette,
558 CONST RECT* pSrcRect);
560 #ifdef UNICODE
561 #define D3DXSaveSurfaceToFile D3DXSaveSurfaceToFileW
562 #else
563 #define D3DXSaveSurfaceToFile D3DXSaveSurfaceToFileA
564 #endif
566 //----------------------------------------------------------------------------
567 // D3DXSaveSurfaceToFileInMemory:
568 // ----------------------
569 // Save a surface to a image file.
571 // Parameters:
572 // ppDestBuf
573 // address of pointer to d3dxbuffer for returning data bits
574 // DestFormat
575 // D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
576 // pSrcSurface
577 // Source surface, containing the image to be saved
578 // pSrcPalette
579 // Source palette of 256 colors, or NULL
580 // pSrcRect
581 // Source rectangle, or NULL for the entire image
583 //----------------------------------------------------------------------------
585 HRESULT WINAPI
586 D3DXSaveSurfaceToFileInMemory(
587 LPD3DXBUFFER* ppDestBuf,
588 D3DXIMAGE_FILEFORMAT DestFormat,
589 LPDIRECT3DSURFACE9 pSrcSurface,
590 CONST PALETTEENTRY* pSrcPalette,
591 CONST RECT* pSrcRect);
594 //////////////////////////////////////////////////////////////////////////////
595 // Load/Save Volume APIs /////////////////////////////////////////////////////
596 //////////////////////////////////////////////////////////////////////////////
598 //----------------------------------------------------------------------------
599 // D3DXLoadVolumeFromFile/Resource:
600 // --------------------------------
601 // Load volume from a file or resource
603 // Parameters:
604 // pDestVolume
605 // Destination volume, which will receive the image.
606 // pDestPalette
607 // Destination palette of 256 colors, or NULL
608 // pDestBox
609 // Destination box, or NULL for entire volume
610 // pSrcFile
611 // File name of the source image.
612 // pSrcModule
613 // Module where resource is located, or NULL for module associated
614 // with image the os used to create the current process.
615 // pSrcResource
616 // Resource name
617 // pSrcData
618 // Pointer to file in memory.
619 // SrcDataSize
620 // Size in bytes of file in memory.
621 // pSrcBox
622 // Source box, or NULL for entire image
623 // Filter
624 // D3DX_FILTER flags controlling how the image is filtered.
625 // Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
626 // ColorKey
627 // Color to replace with transparent black, or 0 to disable colorkey.
628 // This is always a 32-bit ARGB color, independent of the source image
629 // format. Alpha is significant, and should usually be set to FF for
630 // opaque colorkeys. (ex. Opaque black == 0xff000000)
631 // pSrcInfo
632 // Pointer to a D3DXIMAGE_INFO structure to be filled in with the
633 // description of the data in the source image file, or NULL.
635 //----------------------------------------------------------------------------
637 HRESULT WINAPI
638 D3DXLoadVolumeFromFileA(
639 LPDIRECT3DVOLUME9 pDestVolume,
640 CONST PALETTEENTRY* pDestPalette,
641 CONST D3DBOX* pDestBox,
642 LPCSTR pSrcFile,
643 CONST D3DBOX* pSrcBox,
644 DWORD Filter,
645 D3DCOLOR ColorKey,
646 D3DXIMAGE_INFO* pSrcInfo);
648 HRESULT WINAPI
649 D3DXLoadVolumeFromFileW(
650 LPDIRECT3DVOLUME9 pDestVolume,
651 CONST PALETTEENTRY* pDestPalette,
652 CONST D3DBOX* pDestBox,
653 LPCWSTR pSrcFile,
654 CONST D3DBOX* pSrcBox,
655 DWORD Filter,
656 D3DCOLOR ColorKey,
657 D3DXIMAGE_INFO* pSrcInfo);
659 #ifdef UNICODE
660 #define D3DXLoadVolumeFromFile D3DXLoadVolumeFromFileW
661 #else
662 #define D3DXLoadVolumeFromFile D3DXLoadVolumeFromFileA
663 #endif
666 HRESULT WINAPI
667 D3DXLoadVolumeFromResourceA(
668 LPDIRECT3DVOLUME9 pDestVolume,
669 CONST PALETTEENTRY* pDestPalette,
670 CONST D3DBOX* pDestBox,
671 HMODULE hSrcModule,
672 LPCSTR pSrcResource,
673 CONST D3DBOX* pSrcBox,
674 DWORD Filter,
675 D3DCOLOR ColorKey,
676 D3DXIMAGE_INFO* pSrcInfo);
678 HRESULT WINAPI
679 D3DXLoadVolumeFromResourceW(
680 LPDIRECT3DVOLUME9 pDestVolume,
681 CONST PALETTEENTRY* pDestPalette,
682 CONST D3DBOX* pDestBox,
683 HMODULE hSrcModule,
684 LPCWSTR pSrcResource,
685 CONST D3DBOX* pSrcBox,
686 DWORD Filter,
687 D3DCOLOR ColorKey,
688 D3DXIMAGE_INFO* pSrcInfo);
690 #ifdef UNICODE
691 #define D3DXLoadVolumeFromResource D3DXLoadVolumeFromResourceW
692 #else
693 #define D3DXLoadVolumeFromResource D3DXLoadVolumeFromResourceA
694 #endif
698 HRESULT WINAPI
699 D3DXLoadVolumeFromFileInMemory(
700 LPDIRECT3DVOLUME9 pDestVolume,
701 CONST PALETTEENTRY* pDestPalette,
702 CONST D3DBOX* pDestBox,
703 LPCVOID pSrcData,
704 UINT SrcDataSize,
705 CONST D3DBOX* pSrcBox,
706 DWORD Filter,
707 D3DCOLOR ColorKey,
708 D3DXIMAGE_INFO* pSrcInfo);
712 //----------------------------------------------------------------------------
713 // D3DXLoadVolumeFromVolume:
714 // -------------------------
715 // Load volume from another volume (with color conversion)
717 // Parameters:
718 // pDestVolume
719 // Destination volume, which will receive the image.
720 // pDestPalette
721 // Destination palette of 256 colors, or NULL
722 // pDestBox
723 // Destination box, or NULL for entire volume
724 // pSrcVolume
725 // Source volume
726 // pSrcPalette
727 // Source palette of 256 colors, or NULL
728 // pSrcBox
729 // Source box, or NULL for entire volume
730 // Filter
731 // D3DX_FILTER flags controlling how the image is filtered.
732 // Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
733 // ColorKey
734 // Color to replace with transparent black, or 0 to disable colorkey.
735 // This is always a 32-bit ARGB color, independent of the source image
736 // format. Alpha is significant, and should usually be set to FF for
737 // opaque colorkeys. (ex. Opaque black == 0xff000000)
739 //----------------------------------------------------------------------------
741 HRESULT WINAPI
742 D3DXLoadVolumeFromVolume(
743 LPDIRECT3DVOLUME9 pDestVolume,
744 CONST PALETTEENTRY* pDestPalette,
745 CONST D3DBOX* pDestBox,
746 LPDIRECT3DVOLUME9 pSrcVolume,
747 CONST PALETTEENTRY* pSrcPalette,
748 CONST D3DBOX* pSrcBox,
749 DWORD Filter,
750 D3DCOLOR ColorKey);
754 //----------------------------------------------------------------------------
755 // D3DXLoadVolumeFromMemory:
756 // -------------------------
757 // Load volume from memory.
759 // Parameters:
760 // pDestVolume
761 // Destination volume, which will receive the image.
762 // pDestPalette
763 // Destination palette of 256 colors, or NULL
764 // pDestBox
765 // Destination box, or NULL for entire volume
766 // pSrcMemory
767 // Pointer to the top-left corner of the source volume in memory
768 // SrcFormat
769 // Pixel format of the source volume.
770 // SrcRowPitch
771 // Pitch of source image, in bytes. For DXT formats, this number
772 // should represent the size of one row of cells, in bytes.
773 // SrcSlicePitch
774 // Pitch of source image, in bytes. For DXT formats, this number
775 // should represent the size of one slice of cells, in bytes.
776 // pSrcPalette
777 // Source palette of 256 colors, or NULL
778 // pSrcBox
779 // Source box.
780 // Filter
781 // D3DX_FILTER flags controlling how the image is filtered.
782 // Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
783 // ColorKey
784 // Color to replace with transparent black, or 0 to disable colorkey.
785 // This is always a 32-bit ARGB color, independent of the source image
786 // format. Alpha is significant, and should usually be set to FF for
787 // opaque colorkeys. (ex. Opaque black == 0xff000000)
789 //----------------------------------------------------------------------------
791 HRESULT WINAPI
792 D3DXLoadVolumeFromMemory(
793 LPDIRECT3DVOLUME9 pDestVolume,
794 CONST PALETTEENTRY* pDestPalette,
795 CONST D3DBOX* pDestBox,
796 LPCVOID pSrcMemory,
797 D3DFORMAT SrcFormat,
798 UINT SrcRowPitch,
799 UINT SrcSlicePitch,
800 CONST PALETTEENTRY* pSrcPalette,
801 CONST D3DBOX* pSrcBox,
802 DWORD Filter,
803 D3DCOLOR ColorKey);
807 //----------------------------------------------------------------------------
808 // D3DXSaveVolumeToFile:
809 // ---------------------
810 // Save a volume to a image file.
812 // Parameters:
813 // pDestFile
814 // File name of the destination file
815 // DestFormat
816 // D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
817 // pSrcVolume
818 // Source volume, containing the image to be saved
819 // pSrcPalette
820 // Source palette of 256 colors, or NULL
821 // pSrcBox
822 // Source box, or NULL for the entire volume
824 //----------------------------------------------------------------------------
826 HRESULT WINAPI
827 D3DXSaveVolumeToFileA(
828 LPCSTR pDestFile,
829 D3DXIMAGE_FILEFORMAT DestFormat,
830 LPDIRECT3DVOLUME9 pSrcVolume,
831 CONST PALETTEENTRY* pSrcPalette,
832 CONST D3DBOX* pSrcBox);
834 HRESULT WINAPI
835 D3DXSaveVolumeToFileW(
836 LPCWSTR pDestFile,
837 D3DXIMAGE_FILEFORMAT DestFormat,
838 LPDIRECT3DVOLUME9 pSrcVolume,
839 CONST PALETTEENTRY* pSrcPalette,
840 CONST D3DBOX* pSrcBox);
842 #ifdef UNICODE
843 #define D3DXSaveVolumeToFile D3DXSaveVolumeToFileW
844 #else
845 #define D3DXSaveVolumeToFile D3DXSaveVolumeToFileA
846 #endif
849 //----------------------------------------------------------------------------
850 // D3DXSaveVolumeToFileInMemory:
851 // ---------------------
852 // Save a volume to a image file.
854 // Parameters:
855 // pDestFile
856 // File name of the destination file
857 // DestFormat
858 // D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
859 // pSrcVolume
860 // Source volume, containing the image to be saved
861 // pSrcPalette
862 // Source palette of 256 colors, or NULL
863 // pSrcBox
864 // Source box, or NULL for the entire volume
866 //----------------------------------------------------------------------------
868 HRESULT WINAPI
869 D3DXSaveVolumeToFileInMemory(
870 LPD3DXBUFFER* ppDestBuf,
871 D3DXIMAGE_FILEFORMAT DestFormat,
872 LPDIRECT3DVOLUME9 pSrcVolume,
873 CONST PALETTEENTRY* pSrcPalette,
874 CONST D3DBOX* pSrcBox);
876 //////////////////////////////////////////////////////////////////////////////
877 // Create/Save Texture APIs //////////////////////////////////////////////////
878 //////////////////////////////////////////////////////////////////////////////
880 //----------------------------------------------------------------------------
881 // D3DXCheckTextureRequirements:
882 // -----------------------------
883 // Checks texture creation parameters. If parameters are invalid, this
884 // function returns corrected parameters.
886 // Parameters:
888 // pDevice
889 // The D3D device to be used
890 // pWidth, pHeight, pDepth, pSize
891 // Desired size in pixels, or NULL. Returns corrected size.
892 // pNumMipLevels
893 // Number of desired mipmap levels, or NULL. Returns corrected number.
894 // Usage
895 // Texture usage flags
896 // pFormat
897 // Desired pixel format, or NULL. Returns corrected format.
898 // Pool
899 // Memory pool to be used to create texture
901 //----------------------------------------------------------------------------
903 HRESULT WINAPI
904 D3DXCheckTextureRequirements(
905 LPDIRECT3DDEVICE9 pDevice,
906 UINT* pWidth,
907 UINT* pHeight,
908 UINT* pNumMipLevels,
909 DWORD Usage,
910 D3DFORMAT* pFormat,
911 D3DPOOL Pool);
913 HRESULT WINAPI
914 D3DXCheckCubeTextureRequirements(
915 LPDIRECT3DDEVICE9 pDevice,
916 UINT* pSize,
917 UINT* pNumMipLevels,
918 DWORD Usage,
919 D3DFORMAT* pFormat,
920 D3DPOOL Pool);
922 HRESULT WINAPI
923 D3DXCheckVolumeTextureRequirements(
924 LPDIRECT3DDEVICE9 pDevice,
925 UINT* pWidth,
926 UINT* pHeight,
927 UINT* pDepth,
928 UINT* pNumMipLevels,
929 DWORD Usage,
930 D3DFORMAT* pFormat,
931 D3DPOOL Pool);
934 //----------------------------------------------------------------------------
935 // D3DXCreateTexture:
936 // ------------------
937 // Create an empty texture
939 // Parameters:
941 // pDevice
942 // The D3D device with which the texture is going to be used.
943 // Width, Height, Depth, Size
944 // size in pixels. these must be non-zero
945 // MipLevels
946 // number of mip levels desired. if zero or D3DX_DEFAULT, a complete
947 // mipmap chain will be created.
948 // Usage
949 // Texture usage flags
950 // Format
951 // Pixel format.
952 // Pool
953 // Memory pool to be used to create texture
954 // ppTexture, ppCubeTexture, ppVolumeTexture
955 // The texture object that will be created
957 //----------------------------------------------------------------------------
959 HRESULT WINAPI
960 D3DXCreateTexture(
961 LPDIRECT3DDEVICE9 pDevice,
962 UINT Width,
963 UINT Height,
964 UINT MipLevels,
965 DWORD Usage,
966 D3DFORMAT Format,
967 D3DPOOL Pool,
968 LPDIRECT3DTEXTURE9* ppTexture);
970 HRESULT WINAPI
971 D3DXCreateCubeTexture(
972 LPDIRECT3DDEVICE9 pDevice,
973 UINT Size,
974 UINT MipLevels,
975 DWORD Usage,
976 D3DFORMAT Format,
977 D3DPOOL Pool,
978 LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
980 HRESULT WINAPI
981 D3DXCreateVolumeTexture(
982 LPDIRECT3DDEVICE9 pDevice,
983 UINT Width,
984 UINT Height,
985 UINT Depth,
986 UINT MipLevels,
987 DWORD Usage,
988 D3DFORMAT Format,
989 D3DPOOL Pool,
990 LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
994 //----------------------------------------------------------------------------
995 // D3DXCreateTextureFromFile/Resource:
996 // -----------------------------------
997 // Create a texture object from a file or resource.
999 // Parameters:
1001 // pDevice
1002 // The D3D device with which the texture is going to be used.
1003 // pSrcFile
1004 // File name.
1005 // hSrcModule
1006 // Module handle. if NULL, current module will be used.
1007 // pSrcResource
1008 // Resource name in module
1009 // pvSrcData
1010 // Pointer to file in memory.
1011 // SrcDataSize
1012 // Size in bytes of file in memory.
1013 // Width, Height, Depth, Size
1014 // Size in pixels. If zero or D3DX_DEFAULT, the size will be taken from
1015 // the file and rounded up to a power of two. If D3DX_DEFAULT_NONPOW2,
1016 // and the device supports NONPOW2 textures, the size will not be rounded.
1017 // If D3DX_FROM_FILE, the size will be taken exactly as it is in the file,
1018 // and the call will fail if this violates device capabilities.
1019 // MipLevels
1020 // Number of mip levels. If zero or D3DX_DEFAULT, a complete mipmap
1021 // chain will be created. If D3DX_FROM_FILE, the size will be taken
1022 // exactly as it is in the file, and the call will fail if this violates
1023 // device capabilities.
1024 // Usage
1025 // Texture usage flags
1026 // Format
1027 // Desired pixel format. If D3DFMT_UNKNOWN, the format will be
1028 // taken from the file. If D3DFMT_FROM_FILE, the format will be taken
1029 // exactly as it is in the file, and the call will fail if the device does
1030 // not support the given format.
1031 // Pool
1032 // Memory pool to be used to create texture
1033 // Filter
1034 // D3DX_FILTER flags controlling how the image is filtered.
1035 // Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
1036 // MipFilter
1037 // D3DX_FILTER flags controlling how each miplevel is filtered.
1038 // Or D3DX_DEFAULT for D3DX_FILTER_BOX,
1039 // ColorKey
1040 // Color to replace with transparent black, or 0 to disable colorkey.
1041 // This is always a 32-bit ARGB color, independent of the source image
1042 // format. Alpha is significant, and should usually be set to FF for
1043 // opaque colorkeys. (ex. Opaque black == 0xff000000)
1044 // pSrcInfo
1045 // Pointer to a D3DXIMAGE_INFO structure to be filled in with the
1046 // description of the data in the source image file, or NULL.
1047 // pPalette
1048 // 256 color palette to be filled in, or NULL
1049 // ppTexture, ppCubeTexture, ppVolumeTexture
1050 // The texture object that will be created
1052 //----------------------------------------------------------------------------
1055 // FromFile
1057 HRESULT WINAPI
1058 D3DXCreateTextureFromFileA(
1059 LPDIRECT3DDEVICE9 pDevice,
1060 LPCSTR pSrcFile,
1061 LPDIRECT3DTEXTURE9* ppTexture);
1063 HRESULT WINAPI
1064 D3DXCreateTextureFromFileW(
1065 LPDIRECT3DDEVICE9 pDevice,
1066 LPCWSTR pSrcFile,
1067 LPDIRECT3DTEXTURE9* ppTexture);
1069 #ifdef UNICODE
1070 #define D3DXCreateTextureFromFile D3DXCreateTextureFromFileW
1071 #else
1072 #define D3DXCreateTextureFromFile D3DXCreateTextureFromFileA
1073 #endif
1076 HRESULT WINAPI
1077 D3DXCreateCubeTextureFromFileA(
1078 LPDIRECT3DDEVICE9 pDevice,
1079 LPCSTR pSrcFile,
1080 LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
1082 HRESULT WINAPI
1083 D3DXCreateCubeTextureFromFileW(
1084 LPDIRECT3DDEVICE9 pDevice,
1085 LPCWSTR pSrcFile,
1086 LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
1088 #ifdef UNICODE
1089 #define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileW
1090 #else
1091 #define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileA
1092 #endif
1095 HRESULT WINAPI
1096 D3DXCreateVolumeTextureFromFileA(
1097 LPDIRECT3DDEVICE9 pDevice,
1098 LPCSTR pSrcFile,
1099 LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
1101 HRESULT WINAPI
1102 D3DXCreateVolumeTextureFromFileW(
1103 LPDIRECT3DDEVICE9 pDevice,
1104 LPCWSTR pSrcFile,
1105 LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
1107 #ifdef UNICODE
1108 #define D3DXCreateVolumeTextureFromFile D3DXCreateVolumeTextureFromFileW
1109 #else
1110 #define D3DXCreateVolumeTextureFromFile D3DXCreateVolumeTextureFromFileA
1111 #endif
1114 // FromResource
1116 HRESULT WINAPI
1117 D3DXCreateTextureFromResourceA(
1118 LPDIRECT3DDEVICE9 pDevice,
1119 HMODULE hSrcModule,
1120 LPCSTR pSrcResource,
1121 LPDIRECT3DTEXTURE9* ppTexture);
1123 HRESULT WINAPI
1124 D3DXCreateTextureFromResourceW(
1125 LPDIRECT3DDEVICE9 pDevice,
1126 HMODULE hSrcModule,
1127 LPCWSTR pSrcResource,
1128 LPDIRECT3DTEXTURE9* ppTexture);
1130 #ifdef UNICODE
1131 #define D3DXCreateTextureFromResource D3DXCreateTextureFromResourceW
1132 #else
1133 #define D3DXCreateTextureFromResource D3DXCreateTextureFromResourceA
1134 #endif
1137 HRESULT WINAPI
1138 D3DXCreateCubeTextureFromResourceA(
1139 LPDIRECT3DDEVICE9 pDevice,
1140 HMODULE hSrcModule,
1141 LPCSTR pSrcResource,
1142 LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
1144 HRESULT WINAPI
1145 D3DXCreateCubeTextureFromResourceW(
1146 LPDIRECT3DDEVICE9 pDevice,
1147 HMODULE hSrcModule,
1148 LPCWSTR pSrcResource,
1149 LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
1151 #ifdef UNICODE
1152 #define D3DXCreateCubeTextureFromResource D3DXCreateCubeTextureFromResourceW
1153 #else
1154 #define D3DXCreateCubeTextureFromResource D3DXCreateCubeTextureFromResourceA
1155 #endif
1158 HRESULT WINAPI
1159 D3DXCreateVolumeTextureFromResourceA(
1160 LPDIRECT3DDEVICE9 pDevice,
1161 HMODULE hSrcModule,
1162 LPCSTR pSrcResource,
1163 LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
1165 HRESULT WINAPI
1166 D3DXCreateVolumeTextureFromResourceW(
1167 LPDIRECT3DDEVICE9 pDevice,
1168 HMODULE hSrcModule,
1169 LPCWSTR pSrcResource,
1170 LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
1172 #ifdef UNICODE
1173 #define D3DXCreateVolumeTextureFromResource D3DXCreateVolumeTextureFromResourceW
1174 #else
1175 #define D3DXCreateVolumeTextureFromResource D3DXCreateVolumeTextureFromResourceA
1176 #endif
1179 // FromFileEx
1181 HRESULT WINAPI
1182 D3DXCreateTextureFromFileExA(
1183 LPDIRECT3DDEVICE9 pDevice,
1184 LPCSTR pSrcFile,
1185 UINT Width,
1186 UINT Height,
1187 UINT MipLevels,
1188 DWORD Usage,
1189 D3DFORMAT Format,
1190 D3DPOOL Pool,
1191 DWORD Filter,
1192 DWORD MipFilter,
1193 D3DCOLOR ColorKey,
1194 D3DXIMAGE_INFO* pSrcInfo,
1195 PALETTEENTRY* pPalette,
1196 LPDIRECT3DTEXTURE9* ppTexture);
1198 HRESULT WINAPI
1199 D3DXCreateTextureFromFileExW(
1200 LPDIRECT3DDEVICE9 pDevice,
1201 LPCWSTR pSrcFile,
1202 UINT Width,
1203 UINT Height,
1204 UINT MipLevels,
1205 DWORD Usage,
1206 D3DFORMAT Format,
1207 D3DPOOL Pool,
1208 DWORD Filter,
1209 DWORD MipFilter,
1210 D3DCOLOR ColorKey,
1211 D3DXIMAGE_INFO* pSrcInfo,
1212 PALETTEENTRY* pPalette,
1213 LPDIRECT3DTEXTURE9* ppTexture);
1215 #ifdef UNICODE
1216 #define D3DXCreateTextureFromFileEx D3DXCreateTextureFromFileExW
1217 #else
1218 #define D3DXCreateTextureFromFileEx D3DXCreateTextureFromFileExA
1219 #endif
1222 HRESULT WINAPI
1223 D3DXCreateCubeTextureFromFileExA(
1224 LPDIRECT3DDEVICE9 pDevice,
1225 LPCSTR pSrcFile,
1226 UINT Size,
1227 UINT MipLevels,
1228 DWORD Usage,
1229 D3DFORMAT Format,
1230 D3DPOOL Pool,
1231 DWORD Filter,
1232 DWORD MipFilter,
1233 D3DCOLOR ColorKey,
1234 D3DXIMAGE_INFO* pSrcInfo,
1235 PALETTEENTRY* pPalette,
1236 LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
1238 HRESULT WINAPI
1239 D3DXCreateCubeTextureFromFileExW(
1240 LPDIRECT3DDEVICE9 pDevice,
1241 LPCWSTR pSrcFile,
1242 UINT Size,
1243 UINT MipLevels,
1244 DWORD Usage,
1245 D3DFORMAT Format,
1246 D3DPOOL Pool,
1247 DWORD Filter,
1248 DWORD MipFilter,
1249 D3DCOLOR ColorKey,
1250 D3DXIMAGE_INFO* pSrcInfo,
1251 PALETTEENTRY* pPalette,
1252 LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
1254 #ifdef UNICODE
1255 #define D3DXCreateCubeTextureFromFileEx D3DXCreateCubeTextureFromFileExW
1256 #else
1257 #define D3DXCreateCubeTextureFromFileEx D3DXCreateCubeTextureFromFileExA
1258 #endif
1261 HRESULT WINAPI
1262 D3DXCreateVolumeTextureFromFileExA(
1263 LPDIRECT3DDEVICE9 pDevice,
1264 LPCSTR pSrcFile,
1265 UINT Width,
1266 UINT Height,
1267 UINT Depth,
1268 UINT MipLevels,
1269 DWORD Usage,
1270 D3DFORMAT Format,
1271 D3DPOOL Pool,
1272 DWORD Filter,
1273 DWORD MipFilter,
1274 D3DCOLOR ColorKey,
1275 D3DXIMAGE_INFO* pSrcInfo,
1276 PALETTEENTRY* pPalette,
1277 LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
1279 HRESULT WINAPI
1280 D3DXCreateVolumeTextureFromFileExW(
1281 LPDIRECT3DDEVICE9 pDevice,
1282 LPCWSTR pSrcFile,
1283 UINT Width,
1284 UINT Height,
1285 UINT Depth,
1286 UINT MipLevels,
1287 DWORD Usage,
1288 D3DFORMAT Format,
1289 D3DPOOL Pool,
1290 DWORD Filter,
1291 DWORD MipFilter,
1292 D3DCOLOR ColorKey,
1293 D3DXIMAGE_INFO* pSrcInfo,
1294 PALETTEENTRY* pPalette,
1295 LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
1297 #ifdef UNICODE
1298 #define D3DXCreateVolumeTextureFromFileEx D3DXCreateVolumeTextureFromFileExW
1299 #else
1300 #define D3DXCreateVolumeTextureFromFileEx D3DXCreateVolumeTextureFromFileExA
1301 #endif
1304 // FromResourceEx
1306 HRESULT WINAPI
1307 D3DXCreateTextureFromResourceExA(
1308 LPDIRECT3DDEVICE9 pDevice,
1309 HMODULE hSrcModule,
1310 LPCSTR pSrcResource,
1311 UINT Width,
1312 UINT Height,
1313 UINT MipLevels,
1314 DWORD Usage,
1315 D3DFORMAT Format,
1316 D3DPOOL Pool,
1317 DWORD Filter,
1318 DWORD MipFilter,
1319 D3DCOLOR ColorKey,
1320 D3DXIMAGE_INFO* pSrcInfo,
1321 PALETTEENTRY* pPalette,
1322 LPDIRECT3DTEXTURE9* ppTexture);
1324 HRESULT WINAPI
1325 D3DXCreateTextureFromResourceExW(
1326 LPDIRECT3DDEVICE9 pDevice,
1327 HMODULE hSrcModule,
1328 LPCWSTR pSrcResource,
1329 UINT Width,
1330 UINT Height,
1331 UINT MipLevels,
1332 DWORD Usage,
1333 D3DFORMAT Format,
1334 D3DPOOL Pool,
1335 DWORD Filter,
1336 DWORD MipFilter,
1337 D3DCOLOR ColorKey,
1338 D3DXIMAGE_INFO* pSrcInfo,
1339 PALETTEENTRY* pPalette,
1340 LPDIRECT3DTEXTURE9* ppTexture);
1342 #ifdef UNICODE
1343 #define D3DXCreateTextureFromResourceEx D3DXCreateTextureFromResourceExW
1344 #else
1345 #define D3DXCreateTextureFromResourceEx D3DXCreateTextureFromResourceExA
1346 #endif
1349 HRESULT WINAPI
1350 D3DXCreateCubeTextureFromResourceExA(
1351 LPDIRECT3DDEVICE9 pDevice,
1352 HMODULE hSrcModule,
1353 LPCSTR pSrcResource,
1354 UINT Size,
1355 UINT MipLevels,
1356 DWORD Usage,
1357 D3DFORMAT Format,
1358 D3DPOOL Pool,
1359 DWORD Filter,
1360 DWORD MipFilter,
1361 D3DCOLOR ColorKey,
1362 D3DXIMAGE_INFO* pSrcInfo,
1363 PALETTEENTRY* pPalette,
1364 LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
1366 HRESULT WINAPI
1367 D3DXCreateCubeTextureFromResourceExW(
1368 LPDIRECT3DDEVICE9 pDevice,
1369 HMODULE hSrcModule,
1370 LPCWSTR pSrcResource,
1371 UINT Size,
1372 UINT MipLevels,
1373 DWORD Usage,
1374 D3DFORMAT Format,
1375 D3DPOOL Pool,
1376 DWORD Filter,
1377 DWORD MipFilter,
1378 D3DCOLOR ColorKey,
1379 D3DXIMAGE_INFO* pSrcInfo,
1380 PALETTEENTRY* pPalette,
1381 LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
1383 #ifdef UNICODE
1384 #define D3DXCreateCubeTextureFromResourceEx D3DXCreateCubeTextureFromResourceExW
1385 #else
1386 #define D3DXCreateCubeTextureFromResourceEx D3DXCreateCubeTextureFromResourceExA
1387 #endif
1390 HRESULT WINAPI
1391 D3DXCreateVolumeTextureFromResourceExA(
1392 LPDIRECT3DDEVICE9 pDevice,
1393 HMODULE hSrcModule,
1394 LPCSTR pSrcResource,
1395 UINT Width,
1396 UINT Height,
1397 UINT Depth,
1398 UINT MipLevels,
1399 DWORD Usage,
1400 D3DFORMAT Format,
1401 D3DPOOL Pool,
1402 DWORD Filter,
1403 DWORD MipFilter,
1404 D3DCOLOR ColorKey,
1405 D3DXIMAGE_INFO* pSrcInfo,
1406 PALETTEENTRY* pPalette,
1407 LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
1409 HRESULT WINAPI
1410 D3DXCreateVolumeTextureFromResourceExW(
1411 LPDIRECT3DDEVICE9 pDevice,
1412 HMODULE hSrcModule,
1413 LPCWSTR pSrcResource,
1414 UINT Width,
1415 UINT Height,
1416 UINT Depth,
1417 UINT MipLevels,
1418 DWORD Usage,
1419 D3DFORMAT Format,
1420 D3DPOOL Pool,
1421 DWORD Filter,
1422 DWORD MipFilter,
1423 D3DCOLOR ColorKey,
1424 D3DXIMAGE_INFO* pSrcInfo,
1425 PALETTEENTRY* pPalette,
1426 LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
1428 #ifdef UNICODE
1429 #define D3DXCreateVolumeTextureFromResourceEx D3DXCreateVolumeTextureFromResourceExW
1430 #else
1431 #define D3DXCreateVolumeTextureFromResourceEx D3DXCreateVolumeTextureFromResourceExA
1432 #endif
1435 // FromFileInMemory
1437 HRESULT WINAPI
1438 D3DXCreateTextureFromFileInMemory(
1439 LPDIRECT3DDEVICE9 pDevice,
1440 LPCVOID pSrcData,
1441 UINT SrcDataSize,
1442 LPDIRECT3DTEXTURE9* ppTexture);
1444 HRESULT WINAPI
1445 D3DXCreateCubeTextureFromFileInMemory(
1446 LPDIRECT3DDEVICE9 pDevice,
1447 LPCVOID pSrcData,
1448 UINT SrcDataSize,
1449 LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
1451 HRESULT WINAPI
1452 D3DXCreateVolumeTextureFromFileInMemory(
1453 LPDIRECT3DDEVICE9 pDevice,
1454 LPCVOID pSrcData,
1455 UINT SrcDataSize,
1456 LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
1459 // FromFileInMemoryEx
1461 HRESULT WINAPI
1462 D3DXCreateTextureFromFileInMemoryEx(
1463 LPDIRECT3DDEVICE9 pDevice,
1464 LPCVOID pSrcData,
1465 UINT SrcDataSize,
1466 UINT Width,
1467 UINT Height,
1468 UINT MipLevels,
1469 DWORD Usage,
1470 D3DFORMAT Format,
1471 D3DPOOL Pool,
1472 DWORD Filter,
1473 DWORD MipFilter,
1474 D3DCOLOR ColorKey,
1475 D3DXIMAGE_INFO* pSrcInfo,
1476 PALETTEENTRY* pPalette,
1477 LPDIRECT3DTEXTURE9* ppTexture);
1479 HRESULT WINAPI
1480 D3DXCreateCubeTextureFromFileInMemoryEx(
1481 LPDIRECT3DDEVICE9 pDevice,
1482 LPCVOID pSrcData,
1483 UINT SrcDataSize,
1484 UINT Size,
1485 UINT MipLevels,
1486 DWORD Usage,
1487 D3DFORMAT Format,
1488 D3DPOOL Pool,
1489 DWORD Filter,
1490 DWORD MipFilter,
1491 D3DCOLOR ColorKey,
1492 D3DXIMAGE_INFO* pSrcInfo,
1493 PALETTEENTRY* pPalette,
1494 LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
1496 HRESULT WINAPI
1497 D3DXCreateVolumeTextureFromFileInMemoryEx(
1498 LPDIRECT3DDEVICE9 pDevice,
1499 LPCVOID pSrcData,
1500 UINT SrcDataSize,
1501 UINT Width,
1502 UINT Height,
1503 UINT Depth,
1504 UINT MipLevels,
1505 DWORD Usage,
1506 D3DFORMAT Format,
1507 D3DPOOL Pool,
1508 DWORD Filter,
1509 DWORD MipFilter,
1510 D3DCOLOR ColorKey,
1511 D3DXIMAGE_INFO* pSrcInfo,
1512 PALETTEENTRY* pPalette,
1513 LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
1517 //----------------------------------------------------------------------------
1518 // D3DXSaveTextureToFile:
1519 // ----------------------
1520 // Save a texture to a file.
1522 // Parameters:
1523 // pDestFile
1524 // File name of the destination file
1525 // DestFormat
1526 // D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
1527 // pSrcTexture
1528 // Source texture, containing the image to be saved
1529 // pSrcPalette
1530 // Source palette of 256 colors, or NULL
1532 //----------------------------------------------------------------------------
1535 HRESULT WINAPI
1536 D3DXSaveTextureToFileA(
1537 LPCSTR pDestFile,
1538 D3DXIMAGE_FILEFORMAT DestFormat,
1539 LPDIRECT3DBASETEXTURE9 pSrcTexture,
1540 CONST PALETTEENTRY* pSrcPalette);
1542 HRESULT WINAPI
1543 D3DXSaveTextureToFileW(
1544 LPCWSTR pDestFile,
1545 D3DXIMAGE_FILEFORMAT DestFormat,
1546 LPDIRECT3DBASETEXTURE9 pSrcTexture,
1547 CONST PALETTEENTRY* pSrcPalette);
1549 #ifdef UNICODE
1550 #define D3DXSaveTextureToFile D3DXSaveTextureToFileW
1551 #else
1552 #define D3DXSaveTextureToFile D3DXSaveTextureToFileA
1553 #endif
1556 //----------------------------------------------------------------------------
1557 // D3DXSaveTextureToFileInMemory:
1558 // ----------------------
1559 // Save a texture to a file.
1561 // Parameters:
1562 // ppDestBuf
1563 // address of a d3dxbuffer pointer to return the image data
1564 // DestFormat
1565 // D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
1566 // pSrcTexture
1567 // Source texture, containing the image to be saved
1568 // pSrcPalette
1569 // Source palette of 256 colors, or NULL
1571 //----------------------------------------------------------------------------
1573 HRESULT WINAPI
1574 D3DXSaveTextureToFileInMemory(
1575 LPD3DXBUFFER* ppDestBuf,
1576 D3DXIMAGE_FILEFORMAT DestFormat,
1577 LPDIRECT3DBASETEXTURE9 pSrcTexture,
1578 CONST PALETTEENTRY* pSrcPalette);
1583 //////////////////////////////////////////////////////////////////////////////
1584 // Misc Texture APIs /////////////////////////////////////////////////////////
1585 //////////////////////////////////////////////////////////////////////////////
1587 //----------------------------------------------------------------------------
1588 // D3DXFilterTexture:
1589 // ------------------
1590 // Filters mipmaps levels of a texture.
1592 // Parameters:
1593 // pBaseTexture
1594 // The texture object to be filtered
1595 // pPalette
1596 // 256 color palette to be used, or NULL for non-palettized formats
1597 // SrcLevel
1598 // The level whose image is used to generate the subsequent levels.
1599 // Filter
1600 // D3DX_FILTER flags controlling how each miplevel is filtered.
1601 // Or D3DX_DEFAULT for D3DX_FILTER_BOX,
1603 //----------------------------------------------------------------------------
1605 HRESULT WINAPI
1606 D3DXFilterTexture(
1607 LPDIRECT3DBASETEXTURE9 pBaseTexture,
1608 CONST PALETTEENTRY* pPalette,
1609 UINT SrcLevel,
1610 DWORD Filter);
1612 #define D3DXFilterCubeTexture D3DXFilterTexture
1613 #define D3DXFilterVolumeTexture D3DXFilterTexture
1617 //----------------------------------------------------------------------------
1618 // D3DXFillTexture:
1619 // ----------------
1620 // Uses a user provided function to fill each texel of each mip level of a
1621 // given texture.
1623 // Paramters:
1624 // pTexture, pCubeTexture, pVolumeTexture
1625 // Pointer to the texture to be filled.
1626 // pFunction
1627 // Pointer to user provided evalutor function which will be used to
1628 // compute the value of each texel.
1629 // pData
1630 // Pointer to an arbitrary block of user defined data. This pointer
1631 // will be passed to the function provided in pFunction
1632 //-----------------------------------------------------------------------------
1634 HRESULT WINAPI
1635 D3DXFillTexture(
1636 LPDIRECT3DTEXTURE9 pTexture,
1637 LPD3DXFILL2D pFunction,
1638 LPVOID pData);
1640 HRESULT WINAPI
1641 D3DXFillCubeTexture(
1642 LPDIRECT3DCUBETEXTURE9 pCubeTexture,
1643 LPD3DXFILL3D pFunction,
1644 LPVOID pData);
1646 HRESULT WINAPI
1647 D3DXFillVolumeTexture(
1648 LPDIRECT3DVOLUMETEXTURE9 pVolumeTexture,
1649 LPD3DXFILL3D pFunction,
1650 LPVOID pData);
1652 //---------------------------------------------------------------------------
1653 // D3DXFillTextureTX:
1654 // ------------------
1655 // Uses a TX Shader target to function to fill each texel of each mip level
1656 // of a given texture. The TX Shader target should be a compiled function
1657 // taking 2 paramters and returning a float4 color.
1659 // Paramters:
1660 // pTexture, pCubeTexture, pVolumeTexture
1661 // Pointer to the texture to be filled.
1662 // pTextureShader
1663 // Pointer to the texture shader to be used to fill in the texture
1664 //----------------------------------------------------------------------------
1666 HRESULT WINAPI
1667 D3DXFillTextureTX(
1668 LPDIRECT3DTEXTURE9 pTexture,
1669 LPD3DXTEXTURESHADER pTextureShader);
1672 HRESULT WINAPI
1673 D3DXFillCubeTextureTX(
1674 LPDIRECT3DCUBETEXTURE9 pCubeTexture,
1675 LPD3DXTEXTURESHADER pTextureShader);
1678 HRESULT WINAPI
1679 D3DXFillVolumeTextureTX(
1680 LPDIRECT3DVOLUMETEXTURE9 pVolumeTexture,
1681 LPD3DXTEXTURESHADER pTextureShader);
1685 //----------------------------------------------------------------------------
1686 // D3DXComputeNormalMap:
1687 // ---------------------
1688 // Converts a height map into a normal map. The (x,y,z) components of each
1689 // normal are mapped to the (r,g,b) channels of the output texture.
1691 // Parameters
1692 // pTexture
1693 // Pointer to the destination texture
1694 // pSrcTexture
1695 // Pointer to the source heightmap texture
1696 // pSrcPalette
1697 // Source palette of 256 colors, or NULL
1698 // Flags
1699 // D3DX_NORMALMAP flags
1700 // Channel
1701 // D3DX_CHANNEL specifying source of height information
1702 // Amplitude
1703 // The constant value which the height information is multiplied by.
1704 //---------------------------------------------------------------------------
1706 HRESULT WINAPI
1707 D3DXComputeNormalMap(
1708 LPDIRECT3DTEXTURE9 pTexture,
1709 LPDIRECT3DTEXTURE9 pSrcTexture,
1710 CONST PALETTEENTRY* pSrcPalette,
1711 DWORD Flags,
1712 DWORD Channel,
1713 FLOAT Amplitude);
1718 #ifdef __cplusplus
1720 #endif //__cplusplus
1722 #endif //__D3DX9TEX_H__