d3dx8tex.h
上传用户:dzyhzl
上传日期:2019-04-29
资源大小:56270k
文件大小:55k
源码类别:

模拟服务器

开发平台:

C/C++

  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. //  Copyright (C) Microsoft Corporation.  All Rights Reserved.
  4. //
  5. //  File:       d3dx8tex.h
  6. //  Content:    D3DX texturing APIs
  7. //
  8. //////////////////////////////////////////////////////////////////////////////
  9. #include "d3dx8.h"
  10. #ifndef __D3DX8TEX_H__
  11. #define __D3DX8TEX_H__
  12. //----------------------------------------------------------------------------
  13. // D3DX_FILTER flags:
  14. // ------------------
  15. //
  16. // A valid filter must contain one of these values:
  17. //
  18. //  D3DX_FILTER_NONE
  19. //      No scaling or filtering will take place.  Pixels outside the bounds
  20. //      of the source image are assumed to be transparent black.
  21. //  D3DX_FILTER_POINT
  22. //      Each destination pixel is computed by sampling the nearest pixel
  23. //      from the source image.
  24. //  D3DX_FILTER_LINEAR
  25. //      Each destination pixel is computed by linearly interpolating between
  26. //      the nearest pixels in the source image.  This filter works best 
  27. //      when the scale on each axis is less than 2.
  28. //  D3DX_FILTER_TRIANGLE
  29. //      Every pixel in the source image contributes equally to the
  30. //      destination image.  This is the slowest of all the filters.
  31. //  D3DX_FILTER_BOX
  32. //      Each pixel is computed by averaging a 2x2(x2) box pixels from 
  33. //      the source image. Only works when the dimensions of the 
  34. //      destination are half those of the source. (as with mip maps)
  35. //
  36. // And can be OR'd with any of these optional flags:
  37. //
  38. //  D3DX_FILTER_MIRROR_U
  39. //      Indicates that pixels off the edge of the texture on the U-axis
  40. //      should be mirrored, not wraped.
  41. //  D3DX_FILTER_MIRROR_V
  42. //      Indicates that pixels off the edge of the texture on the V-axis
  43. //      should be mirrored, not wraped.
  44. //  D3DX_FILTER_MIRROR_W
  45. //      Indicates that pixels off the edge of the texture on the W-axis
  46. //      should be mirrored, not wraped.
  47. //  D3DX_FILTER_MIRROR
  48. //      Same as specifying D3DX_FILTER_MIRROR_U | D3DX_FILTER_MIRROR_V |
  49. //      D3DX_FILTER_MIRROR_V
  50. //  D3DX_FILTER_DITHER
  51. //      Dithers the resulting image.
  52. //
  53. //----------------------------------------------------------------------------
  54. #define D3DX_FILTER_NONE            (1 << 0)
  55. #define D3DX_FILTER_POINT           (2 << 0)
  56. #define D3DX_FILTER_LINEAR          (3 << 0)
  57. #define D3DX_FILTER_TRIANGLE        (4 << 0)
  58. #define D3DX_FILTER_BOX             (5 << 0)
  59. #define D3DX_FILTER_MIRROR_U        (1 << 16)
  60. #define D3DX_FILTER_MIRROR_V        (2 << 16)
  61. #define D3DX_FILTER_MIRROR_W        (4 << 16)
  62. #define D3DX_FILTER_MIRROR          (7 << 16)
  63. #define D3DX_FILTER_DITHER          (8 << 16)
  64. //----------------------------------------------------------------------------
  65. // D3DX_NORMALMAP flags:
  66. // ---------------------
  67. // These flags are used to control how D3DXComputeNormalMap generates normal
  68. // maps.  Any number of these flags may be OR'd together in any combination.
  69. //
  70. //  D3DX_NORMALMAP_MIRROR_U
  71. //      Indicates that pixels off the edge of the texture on the U-axis
  72. //      should be mirrored, not wraped.
  73. //  D3DX_NORMALMAP_MIRROR_V
  74. //      Indicates that pixels off the edge of the texture on the V-axis
  75. //      should be mirrored, not wraped.
  76. //  D3DX_NORMALMAP_MIRROR
  77. //      Same as specifying D3DX_NORMALMAP_MIRROR_U | D3DX_NORMALMAP_MIRROR_V
  78. //  D3DX_NORMALMAP_INVERTSIGN
  79. //      Inverts the direction of each normal 
  80. //  D3DX_NORMALMAP_COMPUTE_OCCLUSION
  81. //      Compute the per pixel Occlusion term and encodes it into the alpha.
  82. //      An Alpha of 1 means that the pixel is not obscured in anyway, and
  83. //      an alpha of 0 would mean that the pixel is completly obscured.
  84. //
  85. //----------------------------------------------------------------------------
  86. //----------------------------------------------------------------------------
  87. #define D3DX_NORMALMAP_MIRROR_U     (1 << 16)
  88. #define D3DX_NORMALMAP_MIRROR_V     (2 << 16)
  89. #define D3DX_NORMALMAP_MIRROR       (3 << 16)
  90. #define D3DX_NORMALMAP_INVERTSIGN   (8 << 16)
  91. #define D3DX_NORMALMAP_COMPUTE_OCCLUSION (16 << 16)
  92. //----------------------------------------------------------------------------
  93. // D3DX_CHANNEL flags:
  94. // -------------------
  95. // These flags are used by functions which operate on or more channels
  96. // in a texture.
  97. //
  98. // D3DX_CHANNEL_RED
  99. //     Indicates the red channel should be used
  100. // D3DX_CHANNEL_BLUE
  101. //     Indicates the blue channel should be used
  102. // D3DX_CHANNEL_GREEN
  103. //     Indicates the green channel should be used
  104. // D3DX_CHANNEL_ALPHA
  105. //     Indicates the alpha channel should be used
  106. // D3DX_CHANNEL_LUMINANCE
  107. //     Indicates the luminaces of the red green and blue channels should be 
  108. //     used.
  109. //
  110. //----------------------------------------------------------------------------
  111. #define D3DX_CHANNEL_RED            (1 << 0)
  112. #define D3DX_CHANNEL_BLUE           (1 << 1)
  113. #define D3DX_CHANNEL_GREEN          (1 << 2)
  114. #define D3DX_CHANNEL_ALPHA          (1 << 3)
  115. #define D3DX_CHANNEL_LUMINANCE      (1 << 4)
  116. //----------------------------------------------------------------------------
  117. // D3DXIMAGE_FILEFORMAT:
  118. // ---------------------
  119. // This enum is used to describe supported image file formats.
  120. //
  121. //----------------------------------------------------------------------------
  122. typedef enum _D3DXIMAGE_FILEFORMAT
  123. {
  124.     D3DXIFF_BMP         = 0,
  125.     D3DXIFF_JPG         = 1,
  126.     D3DXIFF_TGA         = 2,
  127.     D3DXIFF_PNG         = 3,
  128.     D3DXIFF_DDS         = 4,
  129.     D3DXIFF_PPM         = 5,
  130.     D3DXIFF_DIB         = 6,
  131.     D3DXIFF_FORCE_DWORD = 0x7fffffff
  132. } D3DXIMAGE_FILEFORMAT;
  133. //----------------------------------------------------------------------------
  134. // LPD3DXFILL2D and LPD3DXFILL3D:
  135. // ------------------------------
  136. // Function types used by the texture fill functions.
  137. //
  138. // Parameters:
  139. //  pOut
  140. //      Pointer to a vector which the function uses to return its result.
  141. //      X,Y,Z,W will be mapped to R,G,B,A respectivly. 
  142. //  pTexCoord
  143. //      Pointer to a vector containing the coordinates of the texel currently 
  144. //      being evaluated.  Textures and VolumeTexture texcoord components 
  145. //      range from 0 to 1. CubeTexture texcoord component range from -1 to 1.
  146. //  pTexelSize
  147. //      Pointer to a vector containing the dimensions of the current texel.
  148. //  pData
  149. //      Pointer to user data.
  150. //
  151. //----------------------------------------------------------------------------
  152. typedef VOID (*LPD3DXFILL2D)(D3DXVECTOR4 *pOut, D3DXVECTOR2 *pTexCoord, D3DXVECTOR2 *pTexelSize, LPVOID pData);
  153. typedef VOID (*LPD3DXFILL3D)(D3DXVECTOR4 *pOut, D3DXVECTOR3 *pTexCoord, D3DXVECTOR3 *pTexelSize, LPVOID pData);
  154.  
  155. //----------------------------------------------------------------------------
  156. // D3DXIMAGE_INFO:
  157. // ---------------
  158. // This structure is used to return a rough description of what the
  159. // the original contents of an image file looked like.
  160. // 
  161. //  Width
  162. //      Width of original image in pixels
  163. //  Height
  164. //      Height of original image in pixels
  165. //  Depth
  166. //      Depth of original image in pixels
  167. //  MipLevels
  168. //      Number of mip levels in original image
  169. //  Format
  170. //      D3D format which most closely describes the data in original image
  171. //  ResourceType
  172. //      D3DRESOURCETYPE representing the type of texture stored in the file.
  173. //      D3DRTYPE_TEXTURE, D3DRTYPE_VOLUMETEXTURE, or D3DRTYPE_CUBETEXTURE.
  174. //  ImageFileFormat
  175. //      D3DXIMAGE_FILEFORMAT representing the format of the image file.
  176. //
  177. //----------------------------------------------------------------------------
  178. typedef struct _D3DXIMAGE_INFO
  179. {
  180.     UINT                    Width;
  181.     UINT                    Height;
  182.     UINT                    Depth;
  183.     UINT                    MipLevels;
  184.     D3DFORMAT               Format;
  185.     D3DRESOURCETYPE         ResourceType;
  186.     D3DXIMAGE_FILEFORMAT    ImageFileFormat;
  187. } D3DXIMAGE_INFO;
  188. #ifdef __cplusplus
  189. extern "C" {
  190. #endif //__cplusplus
  191. //////////////////////////////////////////////////////////////////////////////
  192. // Image File APIs ///////////////////////////////////////////////////////////
  193. //////////////////////////////////////////////////////////////////////////////
  194. ;
  195. //----------------------------------------------------------------------------
  196. // GetImageInfoFromFile/Resource:
  197. // ------------------------------
  198. // Fills in a D3DXIMAGE_INFO struct with information about an image file.
  199. //
  200. // Parameters:
  201. //  pSrcFile
  202. //      File name of the source image.
  203. //  pSrcModule
  204. //      Module where resource is located, or NULL for module associated
  205. //      with image the os used to create the current process.
  206. //  pSrcResource
  207. //      Resource name
  208. //  pSrcData
  209. //      Pointer to file in memory.
  210. //  SrcDataSize
  211. //      Size in bytes of file in memory.
  212. //  pSrcInfo
  213. //      Pointer to a D3DXIMAGE_INFO structure to be filled in with the 
  214. //      description of the data in the source image file.
  215. //
  216. //----------------------------------------------------------------------------
  217. HRESULT WINAPI
  218.     D3DXGetImageInfoFromFileA(
  219.         LPCSTR                    pSrcFile,
  220.         D3DXIMAGE_INFO*           pSrcInfo);
  221. HRESULT WINAPI
  222.     D3DXGetImageInfoFromFileW(
  223.         LPCWSTR                   pSrcFile,
  224.         D3DXIMAGE_INFO*           pSrcInfo);
  225. #ifdef UNICODE
  226. #define D3DXGetImageInfoFromFile D3DXGetImageInfoFromFileW
  227. #else
  228. #define D3DXGetImageInfoFromFile D3DXGetImageInfoFromFileA
  229. #endif
  230. HRESULT WINAPI
  231.     D3DXGetImageInfoFromResourceA(
  232.         HMODULE                   hSrcModule,
  233.         LPCSTR                    pSrcResource,
  234.         D3DXIMAGE_INFO*           pSrcInfo);
  235. HRESULT WINAPI
  236.     D3DXGetImageInfoFromResourceW(
  237.         HMODULE                   hSrcModule,
  238.         LPCWSTR                   pSrcResource,
  239.         D3DXIMAGE_INFO*           pSrcInfo);
  240. #ifdef UNICODE
  241. #define D3DXGetImageInfoFromResource D3DXGetImageInfoFromResourceW
  242. #else
  243. #define D3DXGetImageInfoFromResource D3DXGetImageInfoFromResourceA
  244. #endif
  245. HRESULT WINAPI
  246.     D3DXGetImageInfoFromFileInMemory(
  247.         LPCVOID                   pSrcData,
  248.         UINT                      SrcDataSize,
  249.         D3DXIMAGE_INFO*           pSrcInfo);
  250. //////////////////////////////////////////////////////////////////////////////
  251. // Load/Save Surface APIs ////////////////////////////////////////////////////
  252. //////////////////////////////////////////////////////////////////////////////
  253. //----------------------------------------------------------------------------
  254. // D3DXLoadSurfaceFromFile/Resource:
  255. // ---------------------------------
  256. // Load surface from a file or resource
  257. //
  258. // Parameters:
  259. //  pDestSurface
  260. //      Destination surface, which will receive the image.
  261. //  pDestPalette
  262. //      Destination palette of 256 colors, or NULL
  263. //  pDestRect
  264. //      Destination rectangle, or NULL for entire surface
  265. //  pSrcFile
  266. //      File name of the source image.
  267. //  pSrcModule
  268. //      Module where resource is located, or NULL for module associated
  269. //      with image the os used to create the current process.
  270. //  pSrcResource
  271. //      Resource name
  272. //  pSrcData
  273. //      Pointer to file in memory.
  274. //  SrcDataSize
  275. //      Size in bytes of file in memory.
  276. //  pSrcRect
  277. //      Source rectangle, or NULL for entire image
  278. //  Filter
  279. //      D3DX_FILTER flags controlling how the image is filtered.
  280. //      Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
  281. //  ColorKey
  282. //      Color to replace with transparent black, or 0 to disable colorkey.
  283. //      This is always a 32-bit ARGB color, independent of the source image
  284. //      format.  Alpha is significant, and should usually be set to FF for 
  285. //      opaque colorkeys.  (ex. Opaque black == 0xff000000)
  286. //  pSrcInfo
  287. //      Pointer to a D3DXIMAGE_INFO structure to be filled in with the 
  288. //      description of the data in the source image file, or NULL.
  289. //
  290. //----------------------------------------------------------------------------
  291. HRESULT WINAPI
  292.     D3DXLoadSurfaceFromFileA(
  293.         LPDIRECT3DSURFACE8        pDestSurface,
  294.         CONST PALETTEENTRY*       pDestPalette,
  295.         CONST RECT*               pDestRect,
  296.         LPCSTR                    pSrcFile,
  297.         CONST RECT*               pSrcRect,
  298.         DWORD                     Filter,
  299.         D3DCOLOR                  ColorKey,
  300.         D3DXIMAGE_INFO*           pSrcInfo);
  301. HRESULT WINAPI
  302.     D3DXLoadSurfaceFromFileW(
  303.         LPDIRECT3DSURFACE8        pDestSurface,
  304.         CONST PALETTEENTRY*       pDestPalette,
  305.         CONST RECT*               pDestRect,
  306.         LPCWSTR                   pSrcFile,
  307.         CONST RECT*               pSrcRect,
  308.         DWORD                     Filter,
  309.         D3DCOLOR                  ColorKey,
  310.         D3DXIMAGE_INFO*           pSrcInfo);
  311. #ifdef UNICODE
  312. #define D3DXLoadSurfaceFromFile D3DXLoadSurfaceFromFileW
  313. #else
  314. #define D3DXLoadSurfaceFromFile D3DXLoadSurfaceFromFileA
  315. #endif
  316. HRESULT WINAPI
  317.     D3DXLoadSurfaceFromResourceA(
  318.         LPDIRECT3DSURFACE8        pDestSurface,
  319.         CONST PALETTEENTRY*       pDestPalette,
  320.         CONST RECT*               pDestRect,
  321.         HMODULE                   hSrcModule,
  322.         LPCSTR                    pSrcResource,
  323.         CONST RECT*               pSrcRect,
  324.         DWORD                     Filter,
  325.         D3DCOLOR                  ColorKey,
  326.         D3DXIMAGE_INFO*           pSrcInfo);
  327. HRESULT WINAPI
  328.     D3DXLoadSurfaceFromResourceW(
  329.         LPDIRECT3DSURFACE8        pDestSurface,
  330.         CONST PALETTEENTRY*       pDestPalette,
  331.         CONST RECT*               pDestRect,
  332.         HMODULE                   hSrcModule,
  333.         LPCWSTR                   pSrcResource,
  334.         CONST RECT*               pSrcRect,
  335.         DWORD                     Filter,
  336.         D3DCOLOR                  ColorKey,
  337.         D3DXIMAGE_INFO*           pSrcInfo);
  338. #ifdef UNICODE
  339. #define D3DXLoadSurfaceFromResource D3DXLoadSurfaceFromResourceW
  340. #else
  341. #define D3DXLoadSurfaceFromResource D3DXLoadSurfaceFromResourceA
  342. #endif
  343. HRESULT WINAPI
  344.     D3DXLoadSurfaceFromFileInMemory(
  345.         LPDIRECT3DSURFACE8        pDestSurface,
  346.         CONST PALETTEENTRY*       pDestPalette,
  347.         CONST RECT*               pDestRect,
  348.         LPCVOID                   pSrcData,
  349.         UINT                      SrcDataSize,
  350.         CONST RECT*               pSrcRect,
  351.         DWORD                     Filter,
  352.         D3DCOLOR                  ColorKey,
  353.         D3DXIMAGE_INFO*           pSrcInfo);
  354. //----------------------------------------------------------------------------
  355. // D3DXLoadSurfaceFromSurface:
  356. // ---------------------------
  357. // Load surface from another surface (with color conversion)
  358. //
  359. // Parameters:
  360. //  pDestSurface
  361. //      Destination surface, which will receive the image.
  362. //  pDestPalette
  363. //      Destination palette of 256 colors, or NULL
  364. //  pDestRect
  365. //      Destination rectangle, or NULL for entire surface
  366. //  pSrcSurface
  367. //      Source surface
  368. //  pSrcPalette
  369. //      Source palette of 256 colors, or NULL
  370. //  pSrcRect
  371. //      Source rectangle, or NULL for entire surface
  372. //  Filter
  373. //      D3DX_FILTER flags controlling how the image is filtered.
  374. //      Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
  375. //  ColorKey
  376. //      Color to replace with transparent black, or 0 to disable colorkey.
  377. //      This is always a 32-bit ARGB color, independent of the source image
  378. //      format.  Alpha is significant, and should usually be set to FF for 
  379. //      opaque colorkeys.  (ex. Opaque black == 0xff000000)
  380. //
  381. //----------------------------------------------------------------------------
  382. HRESULT WINAPI
  383.     D3DXLoadSurfaceFromSurface(
  384.         LPDIRECT3DSURFACE8        pDestSurface,
  385.         CONST PALETTEENTRY*       pDestPalette,
  386.         CONST RECT*               pDestRect,
  387.         LPDIRECT3DSURFACE8        pSrcSurface,
  388.         CONST PALETTEENTRY*       pSrcPalette,
  389.         CONST RECT*               pSrcRect,
  390.         DWORD                     Filter,
  391.         D3DCOLOR                  ColorKey);
  392. //----------------------------------------------------------------------------
  393. // D3DXLoadSurfaceFromMemory:
  394. // --------------------------
  395. // Load surface from memory.
  396. //
  397. // Parameters:
  398. //  pDestSurface
  399. //      Destination surface, which will receive the image.
  400. //  pDestPalette
  401. //      Destination palette of 256 colors, or NULL
  402. //  pDestRect
  403. //      Destination rectangle, or NULL for entire surface
  404. //  pSrcMemory
  405. //      Pointer to the top-left corner of the source image in memory
  406. //  SrcFormat
  407. //      Pixel format of the source image.
  408. //  SrcPitch
  409. //      Pitch of source image, in bytes.  For DXT formats, this number
  410. //      should represent the width of one row of cells, in bytes.
  411. //  pSrcPalette
  412. //      Source palette of 256 colors, or NULL
  413. //  pSrcRect
  414. //      Source rectangle.
  415. //  Filter
  416. //      D3DX_FILTER flags controlling how the image is filtered.
  417. //      Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
  418. //  ColorKey
  419. //      Color to replace with transparent black, or 0 to disable colorkey.
  420. //      This is always a 32-bit ARGB color, independent of the source image
  421. //      format.  Alpha is significant, and should usually be set to FF for 
  422. //      opaque colorkeys.  (ex. Opaque black == 0xff000000)
  423. //
  424. //----------------------------------------------------------------------------
  425. HRESULT WINAPI
  426.     D3DXLoadSurfaceFromMemory(
  427.         LPDIRECT3DSURFACE8        pDestSurface,
  428.         CONST PALETTEENTRY*       pDestPalette,
  429.         CONST RECT*               pDestRect,
  430.         LPCVOID                   pSrcMemory,
  431.         D3DFORMAT                 SrcFormat,
  432.         UINT                      SrcPitch,
  433.         CONST PALETTEENTRY*       pSrcPalette,
  434.         CONST RECT*               pSrcRect,
  435.         DWORD                     Filter,
  436.         D3DCOLOR                  ColorKey);
  437. //----------------------------------------------------------------------------
  438. // D3DXSaveSurfaceToFile:
  439. // ----------------------
  440. // Save a surface to a image file.
  441. //
  442. // Parameters:
  443. //  pDestFile
  444. //      File name of the destination file
  445. //  DestFormat
  446. //      D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
  447. //  pSrcSurface
  448. //      Source surface, containing the image to be saved
  449. //  pSrcPalette
  450. //      Source palette of 256 colors, or NULL
  451. //  pSrcRect
  452. //      Source rectangle, or NULL for the entire image
  453. //
  454. //----------------------------------------------------------------------------
  455. HRESULT WINAPI
  456.     D3DXSaveSurfaceToFileA(
  457.         LPCSTR                    pDestFile,
  458.         D3DXIMAGE_FILEFORMAT      DestFormat,
  459.         LPDIRECT3DSURFACE8        pSrcSurface,
  460.         CONST PALETTEENTRY*       pSrcPalette,
  461.         CONST RECT*               pSrcRect);
  462. HRESULT WINAPI
  463.     D3DXSaveSurfaceToFileW(
  464.         LPCWSTR                   pDestFile,
  465.         D3DXIMAGE_FILEFORMAT      DestFormat,
  466.         LPDIRECT3DSURFACE8        pSrcSurface,
  467.         CONST PALETTEENTRY*       pSrcPalette,
  468.         CONST RECT*               pSrcRect);
  469. #ifdef UNICODE
  470. #define D3DXSaveSurfaceToFile D3DXSaveSurfaceToFileW
  471. #else
  472. #define D3DXSaveSurfaceToFile D3DXSaveSurfaceToFileA
  473. #endif
  474. //////////////////////////////////////////////////////////////////////////////
  475. // Load/Save Volume APIs /////////////////////////////////////////////////////
  476. //////////////////////////////////////////////////////////////////////////////
  477. //----------------------------------------------------------------------------
  478. // D3DXLoadVolumeFromFile/Resource:
  479. // --------------------------------
  480. // Load volume from a file or resource
  481. //
  482. // Parameters:
  483. //  pDestVolume
  484. //      Destination volume, which will receive the image.
  485. //  pDestPalette
  486. //      Destination palette of 256 colors, or NULL
  487. //  pDestBox
  488. //      Destination box, or NULL for entire volume
  489. //  pSrcFile
  490. //      File name of the source image.
  491. //  pSrcModule
  492. //      Module where resource is located, or NULL for module associated
  493. //      with image the os used to create the current process.
  494. //  pSrcResource
  495. //      Resource name
  496. //  pSrcData
  497. //      Pointer to file in memory.
  498. //  SrcDataSize
  499. //      Size in bytes of file in memory.
  500. //  pSrcBox
  501. //      Source box, or NULL for entire image
  502. //  Filter
  503. //      D3DX_FILTER flags controlling how the image is filtered.
  504. //      Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
  505. //  ColorKey
  506. //      Color to replace with transparent black, or 0 to disable colorkey.
  507. //      This is always a 32-bit ARGB color, independent of the source image
  508. //      format.  Alpha is significant, and should usually be set to FF for 
  509. //      opaque colorkeys.  (ex. Opaque black == 0xff000000)
  510. //  pSrcInfo
  511. //      Pointer to a D3DXIMAGE_INFO structure to be filled in with the 
  512. //      description of the data in the source image file, or NULL.
  513. //
  514. //----------------------------------------------------------------------------
  515. HRESULT WINAPI
  516.     D3DXLoadVolumeFromFileA(
  517.         LPDIRECT3DVOLUME8         pDestVolume,
  518.         CONST PALETTEENTRY*       pDestPalette,
  519.         CONST D3DBOX*             pDestBox,
  520.         LPCSTR                    pSrcFile,
  521.         CONST D3DBOX*             pSrcBox,
  522.         DWORD                     Filter,
  523.         D3DCOLOR                  ColorKey,
  524.         D3DXIMAGE_INFO*           pSrcInfo);
  525. HRESULT WINAPI
  526.     D3DXLoadVolumeFromFileW(
  527.         LPDIRECT3DVOLUME8         pDestVolume,
  528.         CONST PALETTEENTRY*       pDestPalette,
  529.         CONST D3DBOX*             pDestBox,
  530.         LPCWSTR                   pSrcFile,
  531.         CONST D3DBOX*             pSrcBox,
  532.         DWORD                     Filter,
  533.         D3DCOLOR                  ColorKey,
  534.         D3DXIMAGE_INFO*           pSrcInfo);
  535. #ifdef UNICODE
  536. #define D3DXLoadVolumeFromFile D3DXLoadVolumeFromFileW
  537. #else
  538. #define D3DXLoadVolumeFromFile D3DXLoadVolumeFromFileA
  539. #endif
  540. HRESULT WINAPI
  541.     D3DXLoadVolumeFromResourceA(
  542.         LPDIRECT3DVOLUME8         pDestVolume,
  543.         CONST PALETTEENTRY*       pDestPalette,
  544.         CONST D3DBOX*             pDestBox,
  545.         HMODULE                   hSrcModule,
  546.         LPCSTR                    pSrcResource,
  547.         CONST D3DBOX*             pSrcBox,
  548.         DWORD                     Filter,
  549.         D3DCOLOR                  ColorKey,
  550.         D3DXIMAGE_INFO*           pSrcInfo);
  551. HRESULT WINAPI
  552.     D3DXLoadVolumeFromResourceW(
  553.         LPDIRECT3DVOLUME8         pDestVolume,
  554.         CONST PALETTEENTRY*       pDestPalette,
  555.         CONST D3DBOX*             pDestBox,
  556.         HMODULE                   hSrcModule,
  557.         LPCWSTR                   pSrcResource,
  558.         CONST D3DBOX*             pSrcBox,
  559.         DWORD                     Filter,
  560.         D3DCOLOR                  ColorKey,
  561.         D3DXIMAGE_INFO*           pSrcInfo);
  562. #ifdef UNICODE
  563. #define D3DXLoadVolumeFromResource D3DXLoadVolumeFromResourceW
  564. #else
  565. #define D3DXLoadVolumeFromResource D3DXLoadVolumeFromResourceA
  566. #endif
  567. HRESULT WINAPI
  568.     D3DXLoadVolumeFromFileInMemory(
  569.         LPDIRECT3DVOLUME8         pDestVolume,
  570.         CONST PALETTEENTRY*       pDestPalette,
  571.         CONST D3DBOX*             pDestBox,
  572.         LPCVOID                   pSrcData,
  573.         UINT                      SrcDataSize,
  574.         CONST D3DBOX*             pSrcBox,
  575.         DWORD                     Filter,
  576.         D3DCOLOR                  ColorKey,
  577.         D3DXIMAGE_INFO*           pSrcInfo);
  578. //----------------------------------------------------------------------------
  579. // D3DXLoadVolumeFromVolume:
  580. // -------------------------
  581. // Load volume from another volume (with color conversion)
  582. //
  583. // Parameters:
  584. //  pDestVolume
  585. //      Destination volume, which will receive the image.
  586. //  pDestPalette
  587. //      Destination palette of 256 colors, or NULL
  588. //  pDestBox
  589. //      Destination box, or NULL for entire volume
  590. //  pSrcVolume
  591. //      Source volume
  592. //  pSrcPalette
  593. //      Source palette of 256 colors, or NULL
  594. //  pSrcBox
  595. //      Source box, or NULL for entire volume
  596. //  Filter
  597. //      D3DX_FILTER flags controlling how the image is filtered.
  598. //      Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
  599. //  ColorKey
  600. //      Color to replace with transparent black, or 0 to disable colorkey.
  601. //      This is always a 32-bit ARGB color, independent of the source image
  602. //      format.  Alpha is significant, and should usually be set to FF for 
  603. //      opaque colorkeys.  (ex. Opaque black == 0xff000000)
  604. //
  605. //----------------------------------------------------------------------------
  606. HRESULT WINAPI
  607.     D3DXLoadVolumeFromVolume(
  608.         LPDIRECT3DVOLUME8         pDestVolume,
  609.         CONST PALETTEENTRY*       pDestPalette,
  610.         CONST D3DBOX*             pDestBox,
  611.         LPDIRECT3DVOLUME8         pSrcVolume,
  612.         CONST PALETTEENTRY*       pSrcPalette,
  613.         CONST D3DBOX*             pSrcBox,
  614.         DWORD                     Filter,
  615.         D3DCOLOR                  ColorKey);
  616. //----------------------------------------------------------------------------
  617. // D3DXLoadVolumeFromMemory:
  618. // -------------------------
  619. // Load volume from memory.
  620. //
  621. // Parameters:
  622. //  pDestVolume
  623. //      Destination volume, which will receive the image.
  624. //  pDestPalette
  625. //      Destination palette of 256 colors, or NULL
  626. //  pDestBox
  627. //      Destination box, or NULL for entire volume
  628. //  pSrcMemory
  629. //      Pointer to the top-left corner of the source volume in memory
  630. //  SrcFormat
  631. //      Pixel format of the source volume.
  632. //  SrcRowPitch
  633. //      Pitch of source image, in bytes.  For DXT formats, this number
  634. //      should represent the size of one row of cells, in bytes.
  635. //  SrcSlicePitch
  636. //      Pitch of source image, in bytes.  For DXT formats, this number
  637. //      should represent the size of one slice of cells, in bytes.
  638. //  pSrcPalette
  639. //      Source palette of 256 colors, or NULL
  640. //  pSrcBox
  641. //      Source box.
  642. //  Filter
  643. //      D3DX_FILTER flags controlling how the image is filtered.
  644. //      Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
  645. //  ColorKey
  646. //      Color to replace with transparent black, or 0 to disable colorkey.
  647. //      This is always a 32-bit ARGB color, independent of the source image
  648. //      format.  Alpha is significant, and should usually be set to FF for 
  649. //      opaque colorkeys.  (ex. Opaque black == 0xff000000)
  650. //
  651. //----------------------------------------------------------------------------
  652. HRESULT WINAPI
  653.     D3DXLoadVolumeFromMemory(
  654.         LPDIRECT3DVOLUME8         pDestVolume,
  655.         CONST PALETTEENTRY*       pDestPalette,
  656.         CONST D3DBOX*             pDestBox,
  657.         LPCVOID                   pSrcMemory,
  658.         D3DFORMAT                 SrcFormat,
  659.         UINT                      SrcRowPitch,
  660.         UINT                      SrcSlicePitch,
  661.         CONST PALETTEENTRY*       pSrcPalette,
  662.         CONST D3DBOX*             pSrcBox,
  663.         DWORD                     Filter,
  664.         D3DCOLOR                  ColorKey);
  665. //----------------------------------------------------------------------------
  666. // D3DXSaveVolumeToFile:
  667. // ---------------------
  668. // Save a volume to a image file.
  669. //
  670. // Parameters:
  671. //  pDestFile
  672. //      File name of the destination file
  673. //  DestFormat
  674. //      D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
  675. //  pSrcVolume
  676. //      Source volume, containing the image to be saved
  677. //  pSrcPalette
  678. //      Source palette of 256 colors, or NULL
  679. //  pSrcBox
  680. //      Source box, or NULL for the entire volume
  681. //
  682. //----------------------------------------------------------------------------
  683. HRESULT WINAPI
  684.     D3DXSaveVolumeToFileA(
  685.         LPCSTR                    pDestFile,
  686.         D3DXIMAGE_FILEFORMAT      DestFormat,
  687.         LPDIRECT3DVOLUME8         pSrcVolume,
  688.         CONST PALETTEENTRY*       pSrcPalette,
  689.         CONST D3DBOX*             pSrcBox);
  690. HRESULT WINAPI
  691.     D3DXSaveVolumeToFileW(
  692.         LPCWSTR                   pDestFile,
  693.         D3DXIMAGE_FILEFORMAT      DestFormat,
  694.         LPDIRECT3DVOLUME8         pSrcVolume,
  695.         CONST PALETTEENTRY*       pSrcPalette,
  696.         CONST D3DBOX*             pSrcBox);
  697. #ifdef UNICODE
  698. #define D3DXSaveVolumeToFile D3DXSaveVolumeToFileW
  699. #else
  700. #define D3DXSaveVolumeToFile D3DXSaveVolumeToFileA
  701. #endif
  702. //////////////////////////////////////////////////////////////////////////////
  703. // Create/Save Texture APIs //////////////////////////////////////////////////
  704. //////////////////////////////////////////////////////////////////////////////
  705. //----------------------------------------------------------------------------
  706. // D3DXCheckTextureRequirements:
  707. // -----------------------------
  708. // Checks texture creation parameters.  If parameters are invalid, this
  709. // function returns corrected parameters.
  710. //
  711. // Parameters:
  712. //
  713. //  pDevice
  714. //      The D3D device to be used
  715. //  pWidth, pHeight, pDepth, pSize
  716. //      Desired size in pixels, or NULL.  Returns corrected size.
  717. //  pNumMipLevels
  718. //      Number of desired mipmap levels, or NULL.  Returns corrected number.
  719. //  Usage
  720. //      Texture usage flags
  721. //  pFormat
  722. //      Desired pixel format, or NULL.  Returns corrected format.
  723. //  Pool
  724. //      Memory pool to be used to create texture
  725. //
  726. //----------------------------------------------------------------------------
  727. HRESULT WINAPI
  728.     D3DXCheckTextureRequirements(
  729.         LPDIRECT3DDEVICE8         pDevice,
  730.         UINT*                     pWidth,
  731.         UINT*                     pHeight,
  732.         UINT*                     pNumMipLevels,
  733.         DWORD                     Usage,
  734.         D3DFORMAT*                pFormat,
  735.         D3DPOOL                   Pool);
  736. HRESULT WINAPI
  737.     D3DXCheckCubeTextureRequirements(
  738.         LPDIRECT3DDEVICE8         pDevice,
  739.         UINT*                     pSize,
  740.         UINT*                     pNumMipLevels,
  741.         DWORD                     Usage,
  742.         D3DFORMAT*                pFormat,
  743.         D3DPOOL                   Pool);
  744. HRESULT WINAPI
  745.     D3DXCheckVolumeTextureRequirements(
  746.         LPDIRECT3DDEVICE8         pDevice,
  747.         UINT*                     pWidth,
  748.         UINT*                     pHeight,
  749.         UINT*                     pDepth,
  750.         UINT*                     pNumMipLevels,
  751.         DWORD                     Usage,
  752.         D3DFORMAT*                pFormat,
  753.         D3DPOOL                   Pool);
  754. //----------------------------------------------------------------------------
  755. // D3DXCreateTexture:
  756. // ------------------
  757. // Create an empty texture
  758. //
  759. // Parameters:
  760. //
  761. //  pDevice
  762. //      The D3D device with which the texture is going to be used.
  763. //  Width, Height, Depth, Size
  764. //      size in pixels; these must be non-zero
  765. //  MipLevels
  766. //      number of mip levels desired; if zero or D3DX_DEFAULT, a complete
  767. //      mipmap chain will be created.
  768. //  Usage
  769. //      Texture usage flags
  770. //  Format
  771. //      Pixel format.
  772. //  Pool
  773. //      Memory pool to be used to create texture
  774. //  ppTexture, ppCubeTexture, ppVolumeTexture
  775. //      The texture object that will be created
  776. //
  777. //----------------------------------------------------------------------------
  778. HRESULT WINAPI
  779.     D3DXCreateTexture(
  780.         LPDIRECT3DDEVICE8         pDevice,
  781.         UINT                      Width,
  782.         UINT                      Height,
  783.         UINT                      MipLevels,
  784.         DWORD                     Usage,
  785.         D3DFORMAT                 Format,
  786.         D3DPOOL                   Pool,
  787.         LPDIRECT3DTEXTURE8*       ppTexture);
  788. HRESULT WINAPI
  789.     D3DXCreateCubeTexture(
  790.         LPDIRECT3DDEVICE8         pDevice,
  791.         UINT                      Size,
  792.         UINT                      MipLevels,
  793.         DWORD                     Usage,
  794.         D3DFORMAT                 Format,
  795.         D3DPOOL                   Pool,
  796.         LPDIRECT3DCUBETEXTURE8*   ppCubeTexture);
  797. HRESULT WINAPI
  798.     D3DXCreateVolumeTexture(
  799.         LPDIRECT3DDEVICE8         pDevice,
  800.         UINT                      Width,
  801.         UINT                      Height,
  802.         UINT                      Depth,
  803.         UINT                      MipLevels,
  804.         DWORD                     Usage,
  805.         D3DFORMAT                 Format,
  806.         D3DPOOL                   Pool,
  807.         LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
  808. //----------------------------------------------------------------------------
  809. // D3DXCreateTextureFromFile/Resource:
  810. // -----------------------------------
  811. // Create a texture object from a file or resource.
  812. //
  813. // Parameters:
  814. //
  815. //  pDevice
  816. //      The D3D device with which the texture is going to be used.
  817. //  pSrcFile
  818. //      File name.
  819. //  hSrcModule
  820. //      Module handle. if NULL, current module will be used.
  821. //  pSrcResource
  822. //      Resource name in module
  823. //  pvSrcData
  824. //      Pointer to file in memory.
  825. //  SrcDataSize
  826. //      Size in bytes of file in memory.
  827. //  Width, Height, Depth, Size
  828. //      Size in pixels; if zero or D3DX_DEFAULT, the size will be taken
  829. //      from the file.
  830. //  MipLevels
  831. //      Number of mip levels;  if zero or D3DX_DEFAULT, a complete mipmap
  832. //      chain will be created.
  833. //  Usage
  834. //      Texture usage flags
  835. //  Format
  836. //      Desired pixel format.  If D3DFMT_UNKNOWN, the format will be
  837. //      taken from the file.
  838. //  Pool
  839. //      Memory pool to be used to create texture
  840. //  Filter
  841. //      D3DX_FILTER flags controlling how the image is filtered.
  842. //      Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
  843. //  MipFilter
  844. //      D3DX_FILTER flags controlling how each miplevel is filtered.
  845. //      Or D3DX_DEFAULT for D3DX_FILTER_BOX,
  846. //  ColorKey
  847. //      Color to replace with transparent black, or 0 to disable colorkey.
  848. //      This is always a 32-bit ARGB color, independent of the source image
  849. //      format.  Alpha is significant, and should usually be set to FF for 
  850. //      opaque colorkeys.  (ex. Opaque black == 0xff000000)
  851. //  pSrcInfo
  852. //      Pointer to a D3DXIMAGE_INFO structure to be filled in with the 
  853. //      description of the data in the source image file, or NULL.
  854. //  pPalette
  855. //      256 color palette to be filled in, or NULL
  856. //  ppTexture, ppCubeTexture, ppVolumeTexture
  857. //      The texture object that will be created
  858. //
  859. //----------------------------------------------------------------------------
  860. // FromFile
  861. HRESULT WINAPI
  862.     D3DXCreateTextureFromFileA(
  863.         LPDIRECT3DDEVICE8         pDevice,
  864.         LPCSTR                    pSrcFile,
  865.         LPDIRECT3DTEXTURE8*       ppTexture);
  866. HRESULT WINAPI
  867.     D3DXCreateTextureFromFileW(
  868.         LPDIRECT3DDEVICE8         pDevice,
  869.         LPCWSTR                   pSrcFile,
  870.         LPDIRECT3DTEXTURE8*       ppTexture);
  871. #ifdef UNICODE
  872. #define D3DXCreateTextureFromFile D3DXCreateTextureFromFileW
  873. #else
  874. #define D3DXCreateTextureFromFile D3DXCreateTextureFromFileA
  875. #endif
  876. HRESULT WINAPI
  877.     D3DXCreateCubeTextureFromFileA(
  878.         LPDIRECT3DDEVICE8         pDevice,
  879.         LPCSTR                    pSrcFile,
  880.         LPDIRECT3DCUBETEXTURE8*   ppCubeTexture);
  881. HRESULT WINAPI
  882.     D3DXCreateCubeTextureFromFileW(
  883.         LPDIRECT3DDEVICE8         pDevice,
  884.         LPCWSTR                   pSrcFile,
  885.         LPDIRECT3DCUBETEXTURE8*   ppCubeTexture);
  886. #ifdef UNICODE
  887. #define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileW
  888. #else
  889. #define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileA
  890. #endif
  891. HRESULT WINAPI
  892.     D3DXCreateVolumeTextureFromFileA(
  893.         LPDIRECT3DDEVICE8         pDevice,
  894.         LPCSTR                    pSrcFile,
  895.         LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
  896. HRESULT WINAPI
  897.     D3DXCreateVolumeTextureFromFileW(
  898.         LPDIRECT3DDEVICE8         pDevice,
  899.         LPCWSTR                   pSrcFile,
  900.         LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
  901. #ifdef UNICODE
  902. #define D3DXCreateVolumeTextureFromFile D3DXCreateVolumeTextureFromFileW
  903. #else
  904. #define D3DXCreateVolumeTextureFromFile D3DXCreateVolumeTextureFromFileA
  905. #endif
  906. // FromResource
  907. HRESULT WINAPI
  908.     D3DXCreateTextureFromResourceA(
  909.         LPDIRECT3DDEVICE8         pDevice,
  910.         HMODULE                   hSrcModule,
  911.         LPCSTR                    pSrcResource,
  912.         LPDIRECT3DTEXTURE8*       ppTexture);
  913. HRESULT WINAPI
  914.     D3DXCreateTextureFromResourceW(
  915.         LPDIRECT3DDEVICE8         pDevice,
  916.         HMODULE                   hSrcModule,
  917.         LPCWSTR                   pSrcResource,
  918.         LPDIRECT3DTEXTURE8*       ppTexture);
  919. #ifdef UNICODE
  920. #define D3DXCreateTextureFromResource D3DXCreateTextureFromResourceW
  921. #else
  922. #define D3DXCreateTextureFromResource D3DXCreateTextureFromResourceA
  923. #endif
  924. HRESULT WINAPI
  925.     D3DXCreateCubeTextureFromResourceA(
  926.         LPDIRECT3DDEVICE8         pDevice,
  927.         HMODULE                   hSrcModule,
  928.         LPCSTR                    pSrcResource,
  929.         LPDIRECT3DCUBETEXTURE8*   ppCubeTexture);
  930. HRESULT WINAPI
  931.     D3DXCreateCubeTextureFromResourceW(
  932.         LPDIRECT3DDEVICE8         pDevice,
  933.         HMODULE                   hSrcModule,
  934.         LPCWSTR                   pSrcResource,
  935.         LPDIRECT3DCUBETEXTURE8*   ppCubeTexture);
  936. #ifdef UNICODE
  937. #define D3DXCreateCubeTextureFromResource D3DXCreateCubeTextureFromResourceW
  938. #else
  939. #define D3DXCreateCubeTextureFromResource D3DXCreateCubeTextureFromResourceA
  940. #endif
  941. HRESULT WINAPI
  942.     D3DXCreateVolumeTextureFromResourceA(
  943.         LPDIRECT3DDEVICE8         pDevice,
  944.         HMODULE                   hSrcModule,
  945.         LPCSTR                    pSrcResource,
  946.         LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
  947. HRESULT WINAPI
  948.     D3DXCreateVolumeTextureFromResourceW(
  949.         LPDIRECT3DDEVICE8         pDevice,
  950.         HMODULE                   hSrcModule,
  951.         LPCWSTR                   pSrcResource,
  952.         LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
  953. #ifdef UNICODE
  954. #define D3DXCreateVolumeTextureFromResource D3DXCreateVolumeTextureFromResourceW
  955. #else
  956. #define D3DXCreateVolumeTextureFromResource D3DXCreateVolumeTextureFromResourceA
  957. #endif
  958. // FromFileEx
  959. HRESULT WINAPI
  960.     D3DXCreateTextureFromFileExA(
  961.         LPDIRECT3DDEVICE8         pDevice,
  962.         LPCSTR                    pSrcFile,
  963.         UINT                      Width,
  964.         UINT                      Height,
  965.         UINT                      MipLevels,
  966.         DWORD                     Usage,
  967.         D3DFORMAT                 Format,
  968.         D3DPOOL                   Pool,
  969.         DWORD                     Filter,
  970.         DWORD                     MipFilter,
  971.         D3DCOLOR                  ColorKey,
  972.         D3DXIMAGE_INFO*           pSrcInfo,
  973.         PALETTEENTRY*             pPalette,
  974.         LPDIRECT3DTEXTURE8*       ppTexture);
  975. HRESULT WINAPI
  976.     D3DXCreateTextureFromFileExW(
  977.         LPDIRECT3DDEVICE8         pDevice,
  978.         LPCWSTR                   pSrcFile,
  979.         UINT                      Width,
  980.         UINT                      Height,
  981.         UINT                      MipLevels,
  982.         DWORD                     Usage,
  983.         D3DFORMAT                 Format,
  984.         D3DPOOL                   Pool,
  985.         DWORD                     Filter,
  986.         DWORD                     MipFilter,
  987.         D3DCOLOR                  ColorKey,
  988.         D3DXIMAGE_INFO*           pSrcInfo,
  989.         PALETTEENTRY*             pPalette,
  990.         LPDIRECT3DTEXTURE8*       ppTexture);
  991. #ifdef UNICODE
  992. #define D3DXCreateTextureFromFileEx D3DXCreateTextureFromFileExW
  993. #else
  994. #define D3DXCreateTextureFromFileEx D3DXCreateTextureFromFileExA
  995. #endif
  996. HRESULT WINAPI
  997.     D3DXCreateCubeTextureFromFileExA(
  998.         LPDIRECT3DDEVICE8         pDevice,
  999.         LPCSTR                    pSrcFile,
  1000.         UINT                      Size,
  1001.         UINT                      MipLevels,
  1002.         DWORD                     Usage,
  1003.         D3DFORMAT                 Format,
  1004.         D3DPOOL                   Pool,
  1005.         DWORD                     Filter,
  1006.         DWORD                     MipFilter,
  1007.         D3DCOLOR                  ColorKey,
  1008.         D3DXIMAGE_INFO*           pSrcInfo,
  1009.         PALETTEENTRY*             pPalette,
  1010.         LPDIRECT3DCUBETEXTURE8*   ppCubeTexture);
  1011. HRESULT WINAPI
  1012.     D3DXCreateCubeTextureFromFileExW(
  1013.         LPDIRECT3DDEVICE8         pDevice,
  1014.         LPCWSTR                   pSrcFile,
  1015.         UINT                      Size,
  1016.         UINT                      MipLevels,
  1017.         DWORD                     Usage,
  1018.         D3DFORMAT                 Format,
  1019.         D3DPOOL                   Pool,
  1020.         DWORD                     Filter,
  1021.         DWORD                     MipFilter,
  1022.         D3DCOLOR                  ColorKey,
  1023.         D3DXIMAGE_INFO*           pSrcInfo,
  1024.         PALETTEENTRY*             pPalette,
  1025.         LPDIRECT3DCUBETEXTURE8*   ppCubeTexture);
  1026. #ifdef UNICODE
  1027. #define D3DXCreateCubeTextureFromFileEx D3DXCreateCubeTextureFromFileExW
  1028. #else
  1029. #define D3DXCreateCubeTextureFromFileEx D3DXCreateCubeTextureFromFileExA
  1030. #endif
  1031. HRESULT WINAPI
  1032.     D3DXCreateVolumeTextureFromFileExA(
  1033.         LPDIRECT3DDEVICE8         pDevice,
  1034.         LPCSTR                    pSrcFile,
  1035.         UINT                      Width,
  1036.         UINT                      Height,
  1037.         UINT                      Depth,
  1038.         UINT                      MipLevels,
  1039.         DWORD                     Usage,
  1040.         D3DFORMAT                 Format,
  1041.         D3DPOOL                   Pool,
  1042.         DWORD                     Filter,
  1043.         DWORD                     MipFilter,
  1044.         D3DCOLOR                  ColorKey,
  1045.         D3DXIMAGE_INFO*           pSrcInfo,
  1046.         PALETTEENTRY*             pPalette,
  1047.         LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
  1048. HRESULT WINAPI
  1049.     D3DXCreateVolumeTextureFromFileExW(
  1050.         LPDIRECT3DDEVICE8         pDevice,
  1051.         LPCWSTR                   pSrcFile,
  1052.         UINT                      Width,
  1053.         UINT                      Height,
  1054.         UINT                      Depth,
  1055.         UINT                      MipLevels,
  1056.         DWORD                     Usage,
  1057.         D3DFORMAT                 Format,
  1058.         D3DPOOL                   Pool,
  1059.         DWORD                     Filter,
  1060.         DWORD                     MipFilter,
  1061.         D3DCOLOR                  ColorKey,
  1062.         D3DXIMAGE_INFO*           pSrcInfo,
  1063.         PALETTEENTRY*             pPalette,
  1064.         LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
  1065. #ifdef UNICODE
  1066. #define D3DXCreateVolumeTextureFromFileEx D3DXCreateVolumeTextureFromFileExW
  1067. #else
  1068. #define D3DXCreateVolumeTextureFromFileEx D3DXCreateVolumeTextureFromFileExA
  1069. #endif
  1070. // FromResourceEx
  1071. HRESULT WINAPI
  1072.     D3DXCreateTextureFromResourceExA(
  1073.         LPDIRECT3DDEVICE8         pDevice,
  1074.         HMODULE                   hSrcModule,
  1075.         LPCSTR                    pSrcResource,
  1076.         UINT                      Width,
  1077.         UINT                      Height,
  1078.         UINT                      MipLevels,
  1079.         DWORD                     Usage,
  1080.         D3DFORMAT                 Format,
  1081.         D3DPOOL                   Pool,
  1082.         DWORD                     Filter,
  1083.         DWORD                     MipFilter,
  1084.         D3DCOLOR                  ColorKey,
  1085.         D3DXIMAGE_INFO*           pSrcInfo,
  1086.         PALETTEENTRY*             pPalette,
  1087.         LPDIRECT3DTEXTURE8*       ppTexture);
  1088. HRESULT WINAPI
  1089.     D3DXCreateTextureFromResourceExW(
  1090.         LPDIRECT3DDEVICE8         pDevice,
  1091.         HMODULE                   hSrcModule,
  1092.         LPCWSTR                   pSrcResource,
  1093.         UINT                      Width,
  1094.         UINT                      Height,
  1095.         UINT                      MipLevels,
  1096.         DWORD                     Usage,
  1097.         D3DFORMAT                 Format,
  1098.         D3DPOOL                   Pool,
  1099.         DWORD                     Filter,
  1100.         DWORD                     MipFilter,
  1101.         D3DCOLOR                  ColorKey,
  1102.         D3DXIMAGE_INFO*           pSrcInfo,
  1103.         PALETTEENTRY*             pPalette,
  1104.         LPDIRECT3DTEXTURE8*       ppTexture);
  1105. #ifdef UNICODE
  1106. #define D3DXCreateTextureFromResourceEx D3DXCreateTextureFromResourceExW
  1107. #else
  1108. #define D3DXCreateTextureFromResourceEx D3DXCreateTextureFromResourceExA
  1109. #endif
  1110. HRESULT WINAPI
  1111.     D3DXCreateCubeTextureFromResourceExA(
  1112.         LPDIRECT3DDEVICE8         pDevice,
  1113.         HMODULE                   hSrcModule,
  1114.         LPCSTR                    pSrcResource,
  1115.         UINT                      Size,
  1116.         UINT                      MipLevels,
  1117.         DWORD                     Usage,
  1118.         D3DFORMAT                 Format,
  1119.         D3DPOOL                   Pool,
  1120.         DWORD                     Filter,
  1121.         DWORD                     MipFilter,
  1122.         D3DCOLOR                  ColorKey,
  1123.         D3DXIMAGE_INFO*           pSrcInfo,
  1124.         PALETTEENTRY*             pPalette,
  1125.         LPDIRECT3DCUBETEXTURE8*   ppCubeTexture);
  1126. HRESULT WINAPI
  1127.     D3DXCreateCubeTextureFromResourceExW(
  1128.         LPDIRECT3DDEVICE8         pDevice,
  1129.         HMODULE                   hSrcModule,
  1130.         LPCWSTR                   pSrcResource,
  1131.         UINT                      Size,
  1132.         UINT                      MipLevels,
  1133.         DWORD                     Usage,
  1134.         D3DFORMAT                 Format,
  1135.         D3DPOOL                   Pool,
  1136.         DWORD                     Filter,
  1137.         DWORD                     MipFilter,
  1138.         D3DCOLOR                  ColorKey,
  1139.         D3DXIMAGE_INFO*           pSrcInfo,
  1140.         PALETTEENTRY*             pPalette,
  1141.         LPDIRECT3DCUBETEXTURE8*   ppCubeTexture);
  1142. #ifdef UNICODE
  1143. #define D3DXCreateCubeTextureFromResourceEx D3DXCreateCubeTextureFromResourceExW
  1144. #else
  1145. #define D3DXCreateCubeTextureFromResourceEx D3DXCreateCubeTextureFromResourceExA
  1146. #endif
  1147. HRESULT WINAPI
  1148.     D3DXCreateVolumeTextureFromResourceExA(
  1149.         LPDIRECT3DDEVICE8         pDevice,
  1150.         HMODULE                   hSrcModule,
  1151.         LPCSTR                    pSrcResource,
  1152.         UINT                      Width,
  1153.         UINT                      Height,
  1154.         UINT                      Depth,
  1155.         UINT                      MipLevels,
  1156.         DWORD                     Usage,
  1157.         D3DFORMAT                 Format,
  1158.         D3DPOOL                   Pool,
  1159.         DWORD                     Filter,
  1160.         DWORD                     MipFilter,
  1161.         D3DCOLOR                  ColorKey,
  1162.         D3DXIMAGE_INFO*           pSrcInfo,
  1163.         PALETTEENTRY*             pPalette,
  1164.         LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
  1165. HRESULT WINAPI
  1166.     D3DXCreateVolumeTextureFromResourceExW(
  1167.         LPDIRECT3DDEVICE8         pDevice,
  1168.         HMODULE                   hSrcModule,
  1169.         LPCWSTR                   pSrcResource,
  1170.         UINT                      Width,
  1171.         UINT                      Height,
  1172.         UINT                      Depth,
  1173.         UINT                      MipLevels,
  1174.         DWORD                     Usage,
  1175.         D3DFORMAT                 Format,
  1176.         D3DPOOL                   Pool,
  1177.         DWORD                     Filter,
  1178.         DWORD                     MipFilter,
  1179.         D3DCOLOR                  ColorKey,
  1180.         D3DXIMAGE_INFO*           pSrcInfo,
  1181.         PALETTEENTRY*             pPalette,
  1182.         LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
  1183. #ifdef UNICODE
  1184. #define D3DXCreateVolumeTextureFromResourceEx D3DXCreateVolumeTextureFromResourceExW
  1185. #else
  1186. #define D3DXCreateVolumeTextureFromResourceEx D3DXCreateVolumeTextureFromResourceExA
  1187. #endif
  1188. // FromFileInMemory
  1189. HRESULT WINAPI
  1190.     D3DXCreateTextureFromFileInMemory(
  1191.         LPDIRECT3DDEVICE8         pDevice,
  1192.         LPCVOID                   pSrcData,
  1193.         UINT                      SrcDataSize,
  1194.         LPDIRECT3DTEXTURE8*       ppTexture);
  1195. HRESULT WINAPI
  1196.     D3DXCreateCubeTextureFromFileInMemory(
  1197.         LPDIRECT3DDEVICE8         pDevice,
  1198.         LPCVOID                   pSrcData,
  1199.         UINT                      SrcDataSize,
  1200.         LPDIRECT3DCUBETEXTURE8*   ppCubeTexture);
  1201. HRESULT WINAPI
  1202.     D3DXCreateVolumeTextureFromFileInMemory(
  1203.         LPDIRECT3DDEVICE8         pDevice,
  1204.         LPCVOID                   pSrcData,
  1205.         UINT                      SrcDataSize,
  1206.         LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
  1207. // FromFileInMemoryEx
  1208. HRESULT WINAPI
  1209.     D3DXCreateTextureFromFileInMemoryEx(
  1210.         LPDIRECT3DDEVICE8         pDevice,
  1211.         LPCVOID                   pSrcData,
  1212.         UINT                      SrcDataSize,
  1213.         UINT                      Width,
  1214.         UINT                      Height,
  1215.         UINT                      MipLevels,
  1216.         DWORD                     Usage,
  1217.         D3DFORMAT                 Format,
  1218.         D3DPOOL                   Pool,
  1219.         DWORD                     Filter,
  1220.         DWORD                     MipFilter,
  1221.         D3DCOLOR                  ColorKey,
  1222.         D3DXIMAGE_INFO*           pSrcInfo,
  1223.         PALETTEENTRY*             pPalette,
  1224.         LPDIRECT3DTEXTURE8*       ppTexture);
  1225. HRESULT WINAPI
  1226.     D3DXCreateCubeTextureFromFileInMemoryEx(
  1227.         LPDIRECT3DDEVICE8         pDevice,
  1228.         LPCVOID                   pSrcData,
  1229.         UINT                      SrcDataSize,
  1230.         UINT                      Size,
  1231.         UINT                      MipLevels,
  1232.         DWORD                     Usage,
  1233.         D3DFORMAT                 Format,
  1234.         D3DPOOL                   Pool,
  1235.         DWORD                     Filter,
  1236.         DWORD                     MipFilter,
  1237.         D3DCOLOR                  ColorKey,
  1238.         D3DXIMAGE_INFO*           pSrcInfo,
  1239.         PALETTEENTRY*             pPalette,
  1240.         LPDIRECT3DCUBETEXTURE8*   ppCubeTexture);
  1241. HRESULT WINAPI
  1242.     D3DXCreateVolumeTextureFromFileInMemoryEx(
  1243.         LPDIRECT3DDEVICE8         pDevice,
  1244.         LPCVOID                   pSrcData,
  1245.         UINT                      SrcDataSize,
  1246.         UINT                      Width,
  1247.         UINT                      Height,
  1248.         UINT                      Depth,
  1249.         UINT                      MipLevels,
  1250.         DWORD                     Usage,
  1251.         D3DFORMAT                 Format,
  1252.         D3DPOOL                   Pool,
  1253.         DWORD                     Filter,
  1254.         DWORD                     MipFilter,
  1255.         D3DCOLOR                  ColorKey,
  1256.         D3DXIMAGE_INFO*           pSrcInfo,
  1257.         PALETTEENTRY*             pPalette,
  1258.         LPDIRECT3DVOLUMETEXTURE8* ppVolumeTexture);
  1259. //----------------------------------------------------------------------------
  1260. // D3DXSaveTextureToFile:
  1261. // ----------------------
  1262. // Save a texture to a file.
  1263. //
  1264. // Parameters:
  1265. //  pDestFile
  1266. //      File name of the destination file
  1267. //  DestFormat
  1268. //      D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
  1269. //  pSrcTexture
  1270. //      Source texture, containing the image to be saved
  1271. //  pSrcPalette
  1272. //      Source palette of 256 colors, or NULL
  1273. //
  1274. //----------------------------------------------------------------------------
  1275. HRESULT WINAPI
  1276.     D3DXSaveTextureToFileA(
  1277.         LPCSTR                    pDestFile,
  1278.         D3DXIMAGE_FILEFORMAT      DestFormat,
  1279.         LPDIRECT3DBASETEXTURE8    pSrcTexture,
  1280.         CONST PALETTEENTRY*       pSrcPalette);
  1281. HRESULT WINAPI
  1282.     D3DXSaveTextureToFileW(
  1283.         LPCWSTR                   pDestFile,
  1284.         D3DXIMAGE_FILEFORMAT      DestFormat,
  1285.         LPDIRECT3DBASETEXTURE8    pSrcTexture,
  1286.         CONST PALETTEENTRY*       pSrcPalette);
  1287. #ifdef UNICODE
  1288. #define D3DXSaveTextureToFile D3DXSaveTextureToFileW
  1289. #else
  1290. #define D3DXSaveTextureToFile D3DXSaveTextureToFileA
  1291. #endif
  1292. //////////////////////////////////////////////////////////////////////////////
  1293. // Misc Texture APIs /////////////////////////////////////////////////////////
  1294. //////////////////////////////////////////////////////////////////////////////
  1295. //----------------------------------------------------------------------------
  1296. // D3DXFilterTexture:
  1297. // ------------------
  1298. // Filters mipmaps levels of a texture.
  1299. //
  1300. // Parameters:
  1301. //  pBaseTexture
  1302. //      The texture object to be filtered
  1303. //  pPalette
  1304. //      256 color palette to be used, or NULL for non-palettized formats
  1305. //  SrcLevel
  1306. //      The level whose image is used to generate the subsequent levels. 
  1307. //  Filter
  1308. //      D3DX_FILTER flags controlling how each miplevel is filtered.
  1309. //      Or D3DX_DEFAULT for D3DX_FILTER_BOX,
  1310. //
  1311. //----------------------------------------------------------------------------
  1312. HRESULT WINAPI
  1313.     D3DXFilterTexture(
  1314.         LPDIRECT3DBASETEXTURE8    pBaseTexture,
  1315.         CONST PALETTEENTRY*       pPalette,
  1316.         UINT                      SrcLevel,
  1317.         DWORD                     Filter);
  1318. #define D3DXFilterCubeTexture D3DXFilterTexture
  1319. #define D3DXFilterVolumeTexture D3DXFilterTexture
  1320. //----------------------------------------------------------------------------
  1321. // D3DXFillTexture:
  1322. // ----------------
  1323. // Uses a user provided function to fill each texel of each mip level of a
  1324. // given texture.
  1325. //
  1326. // Paramters:
  1327. //  pTexture, pCubeTexture, pVolumeTexture
  1328. //      Pointer to the texture to be filled.
  1329. //  pFunction
  1330. //      Pointer to user provided evalutor function which will be used to 
  1331. //      compute the value of each texel.
  1332. //  pData
  1333. //      Pointer to an arbitrary block of user defined data.  This pointer 
  1334. //      will be passed to the function provided in pFunction
  1335. //-----------------------------------------------------------------------------
  1336. HRESULT WINAPI
  1337.     D3DXFillTexture(
  1338.         LPDIRECT3DTEXTURE8        pTexture,
  1339.         LPD3DXFILL2D              pFunction,
  1340.         LPVOID                    pData);
  1341. HRESULT WINAPI
  1342.     D3DXFillCubeTexture(
  1343.         LPDIRECT3DCUBETEXTURE8    pCubeTexture,
  1344.         LPD3DXFILL3D              pFunction,
  1345.         LPVOID                    pData);
  1346. HRESULT WINAPI
  1347.     D3DXFillVolumeTexture(
  1348.         LPDIRECT3DVOLUMETEXTURE8  pVolumeTexture,
  1349.         LPD3DXFILL3D              pFunction,
  1350.         LPVOID                    pData);
  1351. //----------------------------------------------------------------------------
  1352. // D3DXComputeNormalMap:
  1353. // ---------------------
  1354. // Converts a height map into a normal map.  The (x,y,z) components of each
  1355. // normal are mapped to the (r,g,b) channels of the output texture.
  1356. //
  1357. // Parameters
  1358. //  pTexture
  1359. //      Pointer to the destination texture
  1360. //  pSrcTexture
  1361. //      Pointer to the source heightmap texture 
  1362. //  pSrcPalette
  1363. //      Source palette of 256 colors, or NULL
  1364. //  Flags
  1365. //      D3DX_NORMALMAP flags
  1366. //  Channel
  1367. //      D3DX_CHANNEL specifying source of height information
  1368. //  Amplitude
  1369. //      The constant value which the height information is multiplied by.
  1370. //---------------------------------------------------------------------------
  1371. HRESULT WINAPI
  1372.     D3DXComputeNormalMap(
  1373.         LPDIRECT3DTEXTURE8        pTexture,
  1374.         LPDIRECT3DTEXTURE8        pSrcTexture,
  1375.         CONST PALETTEENTRY*       pSrcPalette,
  1376.         DWORD                     Flags,
  1377.         DWORD                     Channel,
  1378.         FLOAT                     Amplitude);
  1379. #ifdef __cplusplus
  1380. }
  1381. #endif //__cplusplus
  1382. #endif //__D3DX8TEX_H__