1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735 |
- //////////////////////////////////////////////////////////////////////////////
- //
- // Copyright (C) Microsoft Corporation. All Rights Reserved.
- //
- // File: d3dx9tex.h
- // Content: D3DX texturing APIs
- //
- //////////////////////////////////////////////////////////////////////////////
- #include "d3dx9.h"
- #ifndef __D3DX9TEX_H__
- #define __D3DX9TEX_H__
- //----------------------------------------------------------------------------
- // D3DX_FILTER flags:
- // ------------------
- //
- // A valid filter must contain one of these values:
- //
- // D3DX_FILTER_NONE
- // No scaling or filtering will take place. Pixels outside the bounds
- // of the source image are assumed to be transparent black.
- // D3DX_FILTER_POINT
- // Each destination pixel is computed by sampling the nearest pixel
- // from the source image.
- // D3DX_FILTER_LINEAR
- // Each destination pixel is computed by linearly interpolating between
- // the nearest pixels in the source image. This filter works best
- // when the scale on each axis is less than 2.
- // D3DX_FILTER_TRIANGLE
- // Every pixel in the source image contributes equally to the
- // destination image. This is the slowest of all the filters.
- // D3DX_FILTER_BOX
- // Each pixel is computed by averaging a 2x2(x2) box pixels from
- // the source image. Only works when the dimensions of the
- // destination are half those of the source. (as with mip maps)
- //
- // And can be OR'd with any of these optional flags:
- //
- // D3DX_FILTER_MIRROR_U
- // Indicates that pixels off the edge of the texture on the U-axis
- // should be mirrored, not wraped.
- // D3DX_FILTER_MIRROR_V
- // Indicates that pixels off the edge of the texture on the V-axis
- // should be mirrored, not wraped.
- // D3DX_FILTER_MIRROR_W
- // Indicates that pixels off the edge of the texture on the W-axis
- // should be mirrored, not wraped.
- // D3DX_FILTER_MIRROR
- // Same as specifying D3DX_FILTER_MIRROR_U | D3DX_FILTER_MIRROR_V |
- // D3DX_FILTER_MIRROR_V
- // D3DX_FILTER_DITHER
- // Dithers the resulting image using a 4x4 order dither pattern.
- // D3DX_FILTER_SRGB_IN
- // Denotes that the input data is in sRGB (gamma 2.2) colorspace.
- // D3DX_FILTER_SRGB_OUT
- // Denotes that the output data is in sRGB (gamma 2.2) colorspace.
- // D3DX_FILTER_SRGB
- // Same as specifying D3DX_FILTER_SRGB_IN | D3DX_FILTER_SRGB_OUT
- //
- //----------------------------------------------------------------------------
- #define D3DX_FILTER_NONE (1 << 0)
- #define D3DX_FILTER_POINT (2 << 0)
- #define D3DX_FILTER_LINEAR (3 << 0)
- #define D3DX_FILTER_TRIANGLE (4 << 0)
- #define D3DX_FILTER_BOX (5 << 0)
- #define D3DX_FILTER_MIRROR_U (1 << 16)
- #define D3DX_FILTER_MIRROR_V (2 << 16)
- #define D3DX_FILTER_MIRROR_W (4 << 16)
- #define D3DX_FILTER_MIRROR (7 << 16)
- #define D3DX_FILTER_DITHER (1 << 19)
- #define D3DX_FILTER_DITHER_DIFFUSION (2 << 19)
- #define D3DX_FILTER_SRGB_IN (1 << 21)
- #define D3DX_FILTER_SRGB_OUT (2 << 21)
- #define D3DX_FILTER_SRGB (3 << 21)
- //-----------------------------------------------------------------------------
- // D3DX_SKIP_DDS_MIP_LEVELS is used to skip mip levels when loading a DDS file:
- //-----------------------------------------------------------------------------
- #define D3DX_SKIP_DDS_MIP_LEVELS_MASK 0x1F
- #define D3DX_SKIP_DDS_MIP_LEVELS_SHIFT 26
- #define D3DX_SKIP_DDS_MIP_LEVELS(levels, filter) ((((levels) & D3DX_SKIP_DDS_MIP_LEVELS_MASK) << D3DX_SKIP_DDS_MIP_LEVELS_SHIFT) | ((filter) == D3DX_DEFAULT ? D3DX_FILTER_BOX : (filter)))
- //----------------------------------------------------------------------------
- // D3DX_NORMALMAP flags:
- // ---------------------
- // These flags are used to control how D3DXComputeNormalMap generates normal
- // maps. Any number of these flags may be OR'd together in any combination.
- //
- // D3DX_NORMALMAP_MIRROR_U
- // Indicates that pixels off the edge of the texture on the U-axis
- // should be mirrored, not wraped.
- // D3DX_NORMALMAP_MIRROR_V
- // Indicates that pixels off the edge of the texture on the V-axis
- // should be mirrored, not wraped.
- // D3DX_NORMALMAP_MIRROR
- // Same as specifying D3DX_NORMALMAP_MIRROR_U | D3DX_NORMALMAP_MIRROR_V
- // D3DX_NORMALMAP_INVERTSIGN
- // Inverts the direction of each normal
- // D3DX_NORMALMAP_COMPUTE_OCCLUSION
- // Compute the per pixel Occlusion term and encodes it into the alpha.
- // An Alpha of 1 means that the pixel is not obscured in anyway, and
- // an alpha of 0 would mean that the pixel is completly obscured.
- //
- //----------------------------------------------------------------------------
- //----------------------------------------------------------------------------
- #define D3DX_NORMALMAP_MIRROR_U (1 << 16)
- #define D3DX_NORMALMAP_MIRROR_V (2 << 16)
- #define D3DX_NORMALMAP_MIRROR (3 << 16)
- #define D3DX_NORMALMAP_INVERTSIGN (8 << 16)
- #define D3DX_NORMALMAP_COMPUTE_OCCLUSION (16 << 16)
- //----------------------------------------------------------------------------
- // D3DX_CHANNEL flags:
- // -------------------
- // These flags are used by functions which operate on or more channels
- // in a texture.
- //
- // D3DX_CHANNEL_RED
- // Indicates the red channel should be used
- // D3DX_CHANNEL_BLUE
- // Indicates the blue channel should be used
- // D3DX_CHANNEL_GREEN
- // Indicates the green channel should be used
- // D3DX_CHANNEL_ALPHA
- // Indicates the alpha channel should be used
- // D3DX_CHANNEL_LUMINANCE
- // Indicates the luminaces of the red green and blue channels should be
- // used.
- //
- //----------------------------------------------------------------------------
- #define D3DX_CHANNEL_RED (1 << 0)
- #define D3DX_CHANNEL_BLUE (1 << 1)
- #define D3DX_CHANNEL_GREEN (1 << 2)
- #define D3DX_CHANNEL_ALPHA (1 << 3)
- #define D3DX_CHANNEL_LUMINANCE (1 << 4)
- //----------------------------------------------------------------------------
- // D3DXIMAGE_FILEFORMAT:
- // ---------------------
- // This enum is used to describe supported image file formats.
- //
- //----------------------------------------------------------------------------
- typedef enum _D3DXIMAGE_FILEFORMAT
- {
- D3DXIFF_BMP = 0,
- D3DXIFF_JPG = 1,
- D3DXIFF_TGA = 2,
- D3DXIFF_PNG = 3,
- D3DXIFF_DDS = 4,
- D3DXIFF_PPM = 5,
- D3DXIFF_DIB = 6,
- D3DXIFF_HDR = 7, //high dynamic range formats
- D3DXIFF_PFM = 8, //
- D3DXIFF_FORCE_DWORD = 0x7fffffff
- } D3DXIMAGE_FILEFORMAT;
- //----------------------------------------------------------------------------
- // LPD3DXFILL2D and LPD3DXFILL3D:
- // ------------------------------
- // Function types used by the texture fill functions.
- //
- // Parameters:
- // pOut
- // Pointer to a vector which the function uses to return its result.
- // X,Y,Z,W will be mapped to R,G,B,A respectivly.
- // pTexCoord
- // Pointer to a vector containing the coordinates of the texel currently
- // being evaluated. Textures and VolumeTexture texcoord components
- // range from 0 to 1. CubeTexture texcoord component range from -1 to 1.
- // pTexelSize
- // Pointer to a vector containing the dimensions of the current texel.
- // pData
- // Pointer to user data.
- //
- //----------------------------------------------------------------------------
- typedef VOID (WINAPI *LPD3DXFILL2D)(D3DXVECTOR4 *pOut,
- CONST D3DXVECTOR2 *pTexCoord, CONST D3DXVECTOR2 *pTexelSize, LPVOID pData);
- typedef VOID (WINAPI *LPD3DXFILL3D)(D3DXVECTOR4 *pOut,
- CONST D3DXVECTOR3 *pTexCoord, CONST D3DXVECTOR3 *pTexelSize, LPVOID pData);
-
- //----------------------------------------------------------------------------
- // D3DXIMAGE_INFO:
- // ---------------
- // This structure is used to return a rough description of what the
- // the original contents of an image file looked like.
- //
- // Width
- // Width of original image in pixels
- // Height
- // Height of original image in pixels
- // Depth
- // Depth of original image in pixels
- // MipLevels
- // Number of mip levels in original image
- // Format
- // D3D format which most closely describes the data in original image
- // ResourceType
- // D3DRESOURCETYPE representing the type of texture stored in the file.
- // D3DRTYPE_TEXTURE, D3DRTYPE_VOLUMETEXTURE, or D3DRTYPE_CUBETEXTURE.
- // ImageFileFormat
- // D3DXIMAGE_FILEFORMAT representing the format of the image file.
- //
- //----------------------------------------------------------------------------
- typedef struct _D3DXIMAGE_INFO
- {
- UINT Width;
- UINT Height;
- UINT Depth;
- UINT MipLevels;
- D3DFORMAT Format;
- D3DRESOURCETYPE ResourceType;
- D3DXIMAGE_FILEFORMAT ImageFileFormat;
- } D3DXIMAGE_INFO;
- #ifdef __cplusplus
- extern "C" {
- #endif //__cplusplus
- //////////////////////////////////////////////////////////////////////////////
- // Image File APIs ///////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- ;
- //----------------------------------------------------------------------------
- // GetImageInfoFromFile/Resource:
- // ------------------------------
- // Fills in a D3DXIMAGE_INFO struct with information about an image file.
- //
- // Parameters:
- // pSrcFile
- // File name of the source image.
- // pSrcModule
- // Module where resource is located, or NULL for module associated
- // with image the os used to create the current process.
- // pSrcResource
- // Resource name
- // pSrcData
- // Pointer to file in memory.
- // SrcDataSize
- // Size in bytes of file in memory.
- // pSrcInfo
- // Pointer to a D3DXIMAGE_INFO structure to be filled in with the
- // description of the data in the source image file.
- //
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXGetImageInfoFromFileA(
- LPCSTR pSrcFile,
- D3DXIMAGE_INFO* pSrcInfo);
- HRESULT WINAPI
- D3DXGetImageInfoFromFileW(
- LPCWSTR pSrcFile,
- D3DXIMAGE_INFO* pSrcInfo);
- #ifdef UNICODE
- #define D3DXGetImageInfoFromFile D3DXGetImageInfoFromFileW
- #else
- #define D3DXGetImageInfoFromFile D3DXGetImageInfoFromFileA
- #endif
- HRESULT WINAPI
- D3DXGetImageInfoFromResourceA(
- HMODULE hSrcModule,
- LPCSTR pSrcResource,
- D3DXIMAGE_INFO* pSrcInfo);
- HRESULT WINAPI
- D3DXGetImageInfoFromResourceW(
- HMODULE hSrcModule,
- LPCWSTR pSrcResource,
- D3DXIMAGE_INFO* pSrcInfo);
- #ifdef UNICODE
- #define D3DXGetImageInfoFromResource D3DXGetImageInfoFromResourceW
- #else
- #define D3DXGetImageInfoFromResource D3DXGetImageInfoFromResourceA
- #endif
- HRESULT WINAPI
- D3DXGetImageInfoFromFileInMemory(
- LPCVOID pSrcData,
- UINT SrcDataSize,
- D3DXIMAGE_INFO* pSrcInfo);
- //////////////////////////////////////////////////////////////////////////////
- // Load/Save Surface APIs ////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DXLoadSurfaceFromFile/Resource:
- // ---------------------------------
- // Load surface from a file or resource
- //
- // Parameters:
- // pDestSurface
- // Destination surface, which will receive the image.
- // pDestPalette
- // Destination palette of 256 colors, or NULL
- // pDestRect
- // Destination rectangle, or NULL for entire surface
- // pSrcFile
- // File name of the source image.
- // pSrcModule
- // Module where resource is located, or NULL for module associated
- // with image the os used to create the current process.
- // pSrcResource
- // Resource name
- // pSrcData
- // Pointer to file in memory.
- // SrcDataSize
- // Size in bytes of file in memory.
- // pSrcRect
- // Source rectangle, or NULL for entire image
- // Filter
- // D3DX_FILTER flags controlling how the image is filtered.
- // Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
- // ColorKey
- // Color to replace with transparent black, or 0 to disable colorkey.
- // This is always a 32-bit ARGB color, independent of the source image
- // format. Alpha is significant, and should usually be set to FF for
- // opaque colorkeys. (ex. Opaque black == 0xff000000)
- // pSrcInfo
- // Pointer to a D3DXIMAGE_INFO structure to be filled in with the
- // description of the data in the source image file, or NULL.
- //
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXLoadSurfaceFromFileA(
- LPDIRECT3DSURFACE9 pDestSurface,
- CONST PALETTEENTRY* pDestPalette,
- CONST RECT* pDestRect,
- LPCSTR pSrcFile,
- CONST RECT* pSrcRect,
- DWORD Filter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo);
- HRESULT WINAPI
- D3DXLoadSurfaceFromFileW(
- LPDIRECT3DSURFACE9 pDestSurface,
- CONST PALETTEENTRY* pDestPalette,
- CONST RECT* pDestRect,
- LPCWSTR pSrcFile,
- CONST RECT* pSrcRect,
- DWORD Filter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo);
- #ifdef UNICODE
- #define D3DXLoadSurfaceFromFile D3DXLoadSurfaceFromFileW
- #else
- #define D3DXLoadSurfaceFromFile D3DXLoadSurfaceFromFileA
- #endif
- HRESULT WINAPI
- D3DXLoadSurfaceFromResourceA(
- LPDIRECT3DSURFACE9 pDestSurface,
- CONST PALETTEENTRY* pDestPalette,
- CONST RECT* pDestRect,
- HMODULE hSrcModule,
- LPCSTR pSrcResource,
- CONST RECT* pSrcRect,
- DWORD Filter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo);
- HRESULT WINAPI
- D3DXLoadSurfaceFromResourceW(
- LPDIRECT3DSURFACE9 pDestSurface,
- CONST PALETTEENTRY* pDestPalette,
- CONST RECT* pDestRect,
- HMODULE hSrcModule,
- LPCWSTR pSrcResource,
- CONST RECT* pSrcRect,
- DWORD Filter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo);
- #ifdef UNICODE
- #define D3DXLoadSurfaceFromResource D3DXLoadSurfaceFromResourceW
- #else
- #define D3DXLoadSurfaceFromResource D3DXLoadSurfaceFromResourceA
- #endif
- HRESULT WINAPI
- D3DXLoadSurfaceFromFileInMemory(
- LPDIRECT3DSURFACE9 pDestSurface,
- CONST PALETTEENTRY* pDestPalette,
- CONST RECT* pDestRect,
- LPCVOID pSrcData,
- UINT SrcDataSize,
- CONST RECT* pSrcRect,
- DWORD Filter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo);
- //----------------------------------------------------------------------------
- // D3DXLoadSurfaceFromSurface:
- // ---------------------------
- // Load surface from another surface (with color conversion)
- //
- // Parameters:
- // pDestSurface
- // Destination surface, which will receive the image.
- // pDestPalette
- // Destination palette of 256 colors, or NULL
- // pDestRect
- // Destination rectangle, or NULL for entire surface
- // pSrcSurface
- // Source surface
- // pSrcPalette
- // Source palette of 256 colors, or NULL
- // pSrcRect
- // Source rectangle, or NULL for entire surface
- // Filter
- // D3DX_FILTER flags controlling how the image is filtered.
- // Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
- // ColorKey
- // Color to replace with transparent black, or 0 to disable colorkey.
- // This is always a 32-bit ARGB color, independent of the source image
- // format. Alpha is significant, and should usually be set to FF for
- // opaque colorkeys. (ex. Opaque black == 0xff000000)
- //
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXLoadSurfaceFromSurface(
- LPDIRECT3DSURFACE9 pDestSurface,
- CONST PALETTEENTRY* pDestPalette,
- CONST RECT* pDestRect,
- LPDIRECT3DSURFACE9 pSrcSurface,
- CONST PALETTEENTRY* pSrcPalette,
- CONST RECT* pSrcRect,
- DWORD Filter,
- D3DCOLOR ColorKey);
- //----------------------------------------------------------------------------
- // D3DXLoadSurfaceFromMemory:
- // --------------------------
- // Load surface from memory.
- //
- // Parameters:
- // pDestSurface
- // Destination surface, which will receive the image.
- // pDestPalette
- // Destination palette of 256 colors, or NULL
- // pDestRect
- // Destination rectangle, or NULL for entire surface
- // pSrcMemory
- // Pointer to the top-left corner of the source image in memory
- // SrcFormat
- // Pixel format of the source image.
- // SrcPitch
- // Pitch of source image, in bytes. For DXT formats, this number
- // should represent the width of one row of cells, in bytes.
- // pSrcPalette
- // Source palette of 256 colors, or NULL
- // pSrcRect
- // Source rectangle.
- // Filter
- // D3DX_FILTER flags controlling how the image is filtered.
- // Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
- // ColorKey
- // Color to replace with transparent black, or 0 to disable colorkey.
- // This is always a 32-bit ARGB color, independent of the source image
- // format. Alpha is significant, and should usually be set to FF for
- // opaque colorkeys. (ex. Opaque black == 0xff000000)
- //
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXLoadSurfaceFromMemory(
- LPDIRECT3DSURFACE9 pDestSurface,
- CONST PALETTEENTRY* pDestPalette,
- CONST RECT* pDestRect,
- LPCVOID pSrcMemory,
- D3DFORMAT SrcFormat,
- UINT SrcPitch,
- CONST PALETTEENTRY* pSrcPalette,
- CONST RECT* pSrcRect,
- DWORD Filter,
- D3DCOLOR ColorKey);
- //----------------------------------------------------------------------------
- // D3DXSaveSurfaceToFile:
- // ----------------------
- // Save a surface to a image file.
- //
- // Parameters:
- // pDestFile
- // File name of the destination file
- // DestFormat
- // D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
- // pSrcSurface
- // Source surface, containing the image to be saved
- // pSrcPalette
- // Source palette of 256 colors, or NULL
- // pSrcRect
- // Source rectangle, or NULL for the entire image
- //
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXSaveSurfaceToFileA(
- LPCSTR pDestFile,
- D3DXIMAGE_FILEFORMAT DestFormat,
- LPDIRECT3DSURFACE9 pSrcSurface,
- CONST PALETTEENTRY* pSrcPalette,
- CONST RECT* pSrcRect);
- HRESULT WINAPI
- D3DXSaveSurfaceToFileW(
- LPCWSTR pDestFile,
- D3DXIMAGE_FILEFORMAT DestFormat,
- LPDIRECT3DSURFACE9 pSrcSurface,
- CONST PALETTEENTRY* pSrcPalette,
- CONST RECT* pSrcRect);
- #ifdef UNICODE
- #define D3DXSaveSurfaceToFile D3DXSaveSurfaceToFileW
- #else
- #define D3DXSaveSurfaceToFile D3DXSaveSurfaceToFileA
- #endif
- //----------------------------------------------------------------------------
- // D3DXSaveSurfaceToFileInMemory:
- // ----------------------
- // Save a surface to a image file.
- //
- // Parameters:
- // ppDestBuf
- // address of pointer to d3dxbuffer for returning data bits
- // DestFormat
- // D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
- // pSrcSurface
- // Source surface, containing the image to be saved
- // pSrcPalette
- // Source palette of 256 colors, or NULL
- // pSrcRect
- // Source rectangle, or NULL for the entire image
- //
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXSaveSurfaceToFileInMemory(
- LPD3DXBUFFER* ppDestBuf,
- D3DXIMAGE_FILEFORMAT DestFormat,
- LPDIRECT3DSURFACE9 pSrcSurface,
- CONST PALETTEENTRY* pSrcPalette,
- CONST RECT* pSrcRect);
- //////////////////////////////////////////////////////////////////////////////
- // Load/Save Volume APIs /////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DXLoadVolumeFromFile/Resource:
- // --------------------------------
- // Load volume from a file or resource
- //
- // Parameters:
- // pDestVolume
- // Destination volume, which will receive the image.
- // pDestPalette
- // Destination palette of 256 colors, or NULL
- // pDestBox
- // Destination box, or NULL for entire volume
- // pSrcFile
- // File name of the source image.
- // pSrcModule
- // Module where resource is located, or NULL for module associated
- // with image the os used to create the current process.
- // pSrcResource
- // Resource name
- // pSrcData
- // Pointer to file in memory.
- // SrcDataSize
- // Size in bytes of file in memory.
- // pSrcBox
- // Source box, or NULL for entire image
- // Filter
- // D3DX_FILTER flags controlling how the image is filtered.
- // Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
- // ColorKey
- // Color to replace with transparent black, or 0 to disable colorkey.
- // This is always a 32-bit ARGB color, independent of the source image
- // format. Alpha is significant, and should usually be set to FF for
- // opaque colorkeys. (ex. Opaque black == 0xff000000)
- // pSrcInfo
- // Pointer to a D3DXIMAGE_INFO structure to be filled in with the
- // description of the data in the source image file, or NULL.
- //
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXLoadVolumeFromFileA(
- LPDIRECT3DVOLUME9 pDestVolume,
- CONST PALETTEENTRY* pDestPalette,
- CONST D3DBOX* pDestBox,
- LPCSTR pSrcFile,
- CONST D3DBOX* pSrcBox,
- DWORD Filter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo);
- HRESULT WINAPI
- D3DXLoadVolumeFromFileW(
- LPDIRECT3DVOLUME9 pDestVolume,
- CONST PALETTEENTRY* pDestPalette,
- CONST D3DBOX* pDestBox,
- LPCWSTR pSrcFile,
- CONST D3DBOX* pSrcBox,
- DWORD Filter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo);
- #ifdef UNICODE
- #define D3DXLoadVolumeFromFile D3DXLoadVolumeFromFileW
- #else
- #define D3DXLoadVolumeFromFile D3DXLoadVolumeFromFileA
- #endif
- HRESULT WINAPI
- D3DXLoadVolumeFromResourceA(
- LPDIRECT3DVOLUME9 pDestVolume,
- CONST PALETTEENTRY* pDestPalette,
- CONST D3DBOX* pDestBox,
- HMODULE hSrcModule,
- LPCSTR pSrcResource,
- CONST D3DBOX* pSrcBox,
- DWORD Filter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo);
- HRESULT WINAPI
- D3DXLoadVolumeFromResourceW(
- LPDIRECT3DVOLUME9 pDestVolume,
- CONST PALETTEENTRY* pDestPalette,
- CONST D3DBOX* pDestBox,
- HMODULE hSrcModule,
- LPCWSTR pSrcResource,
- CONST D3DBOX* pSrcBox,
- DWORD Filter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo);
- #ifdef UNICODE
- #define D3DXLoadVolumeFromResource D3DXLoadVolumeFromResourceW
- #else
- #define D3DXLoadVolumeFromResource D3DXLoadVolumeFromResourceA
- #endif
- HRESULT WINAPI
- D3DXLoadVolumeFromFileInMemory(
- LPDIRECT3DVOLUME9 pDestVolume,
- CONST PALETTEENTRY* pDestPalette,
- CONST D3DBOX* pDestBox,
- LPCVOID pSrcData,
- UINT SrcDataSize,
- CONST D3DBOX* pSrcBox,
- DWORD Filter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo);
- //----------------------------------------------------------------------------
- // D3DXLoadVolumeFromVolume:
- // -------------------------
- // Load volume from another volume (with color conversion)
- //
- // Parameters:
- // pDestVolume
- // Destination volume, which will receive the image.
- // pDestPalette
- // Destination palette of 256 colors, or NULL
- // pDestBox
- // Destination box, or NULL for entire volume
- // pSrcVolume
- // Source volume
- // pSrcPalette
- // Source palette of 256 colors, or NULL
- // pSrcBox
- // Source box, or NULL for entire volume
- // Filter
- // D3DX_FILTER flags controlling how the image is filtered.
- // Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
- // ColorKey
- // Color to replace with transparent black, or 0 to disable colorkey.
- // This is always a 32-bit ARGB color, independent of the source image
- // format. Alpha is significant, and should usually be set to FF for
- // opaque colorkeys. (ex. Opaque black == 0xff000000)
- //
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXLoadVolumeFromVolume(
- LPDIRECT3DVOLUME9 pDestVolume,
- CONST PALETTEENTRY* pDestPalette,
- CONST D3DBOX* pDestBox,
- LPDIRECT3DVOLUME9 pSrcVolume,
- CONST PALETTEENTRY* pSrcPalette,
- CONST D3DBOX* pSrcBox,
- DWORD Filter,
- D3DCOLOR ColorKey);
- //----------------------------------------------------------------------------
- // D3DXLoadVolumeFromMemory:
- // -------------------------
- // Load volume from memory.
- //
- // Parameters:
- // pDestVolume
- // Destination volume, which will receive the image.
- // pDestPalette
- // Destination palette of 256 colors, or NULL
- // pDestBox
- // Destination box, or NULL for entire volume
- // pSrcMemory
- // Pointer to the top-left corner of the source volume in memory
- // SrcFormat
- // Pixel format of the source volume.
- // SrcRowPitch
- // Pitch of source image, in bytes. For DXT formats, this number
- // should represent the size of one row of cells, in bytes.
- // SrcSlicePitch
- // Pitch of source image, in bytes. For DXT formats, this number
- // should represent the size of one slice of cells, in bytes.
- // pSrcPalette
- // Source palette of 256 colors, or NULL
- // pSrcBox
- // Source box.
- // Filter
- // D3DX_FILTER flags controlling how the image is filtered.
- // Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
- // ColorKey
- // Color to replace with transparent black, or 0 to disable colorkey.
- // This is always a 32-bit ARGB color, independent of the source image
- // format. Alpha is significant, and should usually be set to FF for
- // opaque colorkeys. (ex. Opaque black == 0xff000000)
- //
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXLoadVolumeFromMemory(
- LPDIRECT3DVOLUME9 pDestVolume,
- CONST PALETTEENTRY* pDestPalette,
- CONST D3DBOX* pDestBox,
- LPCVOID pSrcMemory,
- D3DFORMAT SrcFormat,
- UINT SrcRowPitch,
- UINT SrcSlicePitch,
- CONST PALETTEENTRY* pSrcPalette,
- CONST D3DBOX* pSrcBox,
- DWORD Filter,
- D3DCOLOR ColorKey);
- //----------------------------------------------------------------------------
- // D3DXSaveVolumeToFile:
- // ---------------------
- // Save a volume to a image file.
- //
- // Parameters:
- // pDestFile
- // File name of the destination file
- // DestFormat
- // D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
- // pSrcVolume
- // Source volume, containing the image to be saved
- // pSrcPalette
- // Source palette of 256 colors, or NULL
- // pSrcBox
- // Source box, or NULL for the entire volume
- //
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXSaveVolumeToFileA(
- LPCSTR pDestFile,
- D3DXIMAGE_FILEFORMAT DestFormat,
- LPDIRECT3DVOLUME9 pSrcVolume,
- CONST PALETTEENTRY* pSrcPalette,
- CONST D3DBOX* pSrcBox);
- HRESULT WINAPI
- D3DXSaveVolumeToFileW(
- LPCWSTR pDestFile,
- D3DXIMAGE_FILEFORMAT DestFormat,
- LPDIRECT3DVOLUME9 pSrcVolume,
- CONST PALETTEENTRY* pSrcPalette,
- CONST D3DBOX* pSrcBox);
- #ifdef UNICODE
- #define D3DXSaveVolumeToFile D3DXSaveVolumeToFileW
- #else
- #define D3DXSaveVolumeToFile D3DXSaveVolumeToFileA
- #endif
- //----------------------------------------------------------------------------
- // D3DXSaveVolumeToFileInMemory:
- // ---------------------
- // Save a volume to a image file.
- //
- // Parameters:
- // pDestFile
- // File name of the destination file
- // DestFormat
- // D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
- // pSrcVolume
- // Source volume, containing the image to be saved
- // pSrcPalette
- // Source palette of 256 colors, or NULL
- // pSrcBox
- // Source box, or NULL for the entire volume
- //
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXSaveVolumeToFileInMemory(
- LPD3DXBUFFER* ppDestBuf,
- D3DXIMAGE_FILEFORMAT DestFormat,
- LPDIRECT3DVOLUME9 pSrcVolume,
- CONST PALETTEENTRY* pSrcPalette,
- CONST D3DBOX* pSrcBox);
- //////////////////////////////////////////////////////////////////////////////
- // Create/Save Texture APIs //////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DXCheckTextureRequirements:
- // -----------------------------
- // Checks texture creation parameters. If parameters are invalid, this
- // function returns corrected parameters.
- //
- // Parameters:
- //
- // pDevice
- // The D3D device to be used
- // pWidth, pHeight, pDepth, pSize
- // Desired size in pixels, or NULL. Returns corrected size.
- // pNumMipLevels
- // Number of desired mipmap levels, or NULL. Returns corrected number.
- // Usage
- // Texture usage flags
- // pFormat
- // Desired pixel format, or NULL. Returns corrected format.
- // Pool
- // Memory pool to be used to create texture
- //
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXCheckTextureRequirements(
- LPDIRECT3DDEVICE9 pDevice,
- UINT* pWidth,
- UINT* pHeight,
- UINT* pNumMipLevels,
- DWORD Usage,
- D3DFORMAT* pFormat,
- D3DPOOL Pool);
- HRESULT WINAPI
- D3DXCheckCubeTextureRequirements(
- LPDIRECT3DDEVICE9 pDevice,
- UINT* pSize,
- UINT* pNumMipLevels,
- DWORD Usage,
- D3DFORMAT* pFormat,
- D3DPOOL Pool);
- HRESULT WINAPI
- D3DXCheckVolumeTextureRequirements(
- LPDIRECT3DDEVICE9 pDevice,
- UINT* pWidth,
- UINT* pHeight,
- UINT* pDepth,
- UINT* pNumMipLevels,
- DWORD Usage,
- D3DFORMAT* pFormat,
- D3DPOOL Pool);
- //----------------------------------------------------------------------------
- // D3DXCreateTexture:
- // ------------------
- // Create an empty texture
- //
- // Parameters:
- //
- // pDevice
- // The D3D device with which the texture is going to be used.
- // Width, Height, Depth, Size
- // size in pixels. these must be non-zero
- // MipLevels
- // number of mip levels desired. if zero or D3DX_DEFAULT, a complete
- // mipmap chain will be created.
- // Usage
- // Texture usage flags
- // Format
- // Pixel format.
- // Pool
- // Memory pool to be used to create texture
- // ppTexture, ppCubeTexture, ppVolumeTexture
- // The texture object that will be created
- //
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXCreateTexture(
- LPDIRECT3DDEVICE9 pDevice,
- UINT Width,
- UINT Height,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- LPDIRECT3DTEXTURE9* ppTexture);
- HRESULT WINAPI
- D3DXCreateCubeTexture(
- LPDIRECT3DDEVICE9 pDevice,
- UINT Size,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
- HRESULT WINAPI
- D3DXCreateVolumeTexture(
- LPDIRECT3DDEVICE9 pDevice,
- UINT Width,
- UINT Height,
- UINT Depth,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
- //----------------------------------------------------------------------------
- // D3DXCreateTextureFromFile/Resource:
- // -----------------------------------
- // Create a texture object from a file or resource.
- //
- // Parameters:
- //
- // pDevice
- // The D3D device with which the texture is going to be used.
- // pSrcFile
- // File name.
- // hSrcModule
- // Module handle. if NULL, current module will be used.
- // pSrcResource
- // Resource name in module
- // pvSrcData
- // Pointer to file in memory.
- // SrcDataSize
- // Size in bytes of file in memory.
- // Width, Height, Depth, Size
- // Size in pixels. If zero or D3DX_DEFAULT, the size will be taken from
- // the file and rounded up to a power of two. If D3DX_DEFAULT_NONPOW2,
- // and the device supports NONPOW2 textures, the size will not be rounded.
- // If D3DX_FROM_FILE, the size will be taken exactly as it is in the file,
- // and the call will fail if this violates device capabilities.
- // MipLevels
- // Number of mip levels. If zero or D3DX_DEFAULT, a complete mipmap
- // chain will be created. If D3DX_FROM_FILE, the size will be taken
- // exactly as it is in the file, and the call will fail if this violates
- // device capabilities.
- // Usage
- // Texture usage flags
- // Format
- // Desired pixel format. If D3DFMT_UNKNOWN, the format will be
- // taken from the file. If D3DFMT_FROM_FILE, the format will be taken
- // exactly as it is in the file, and the call will fail if the device does
- // not support the given format.
- // Pool
- // Memory pool to be used to create texture
- // Filter
- // D3DX_FILTER flags controlling how the image is filtered.
- // Or D3DX_DEFAULT for D3DX_FILTER_TRIANGLE.
- // MipFilter
- // D3DX_FILTER flags controlling how each miplevel is filtered.
- // Or D3DX_DEFAULT for D3DX_FILTER_BOX.
- // Use the D3DX_SKIP_DDS_MIP_LEVELS macro to specify both a filter and the
- // number of mip levels to skip when loading DDS files.
- // ColorKey
- // Color to replace with transparent black, or 0 to disable colorkey.
- // This is always a 32-bit ARGB color, independent of the source image
- // format. Alpha is significant, and should usually be set to FF for
- // opaque colorkeys. (ex. Opaque black == 0xff000000)
- // pSrcInfo
- // Pointer to a D3DXIMAGE_INFO structure to be filled in with the
- // description of the data in the source image file, or NULL.
- // pPalette
- // 256 color palette to be filled in, or NULL
- // ppTexture, ppCubeTexture, ppVolumeTexture
- // The texture object that will be created
- //
- //----------------------------------------------------------------------------
- // FromFile
- HRESULT WINAPI
- D3DXCreateTextureFromFileA(
- LPDIRECT3DDEVICE9 pDevice,
- LPCSTR pSrcFile,
- LPDIRECT3DTEXTURE9* ppTexture);
- HRESULT WINAPI
- D3DXCreateTextureFromFileW(
- LPDIRECT3DDEVICE9 pDevice,
- LPCWSTR pSrcFile,
- LPDIRECT3DTEXTURE9* ppTexture);
- #ifdef UNICODE
- #define D3DXCreateTextureFromFile D3DXCreateTextureFromFileW
- #else
- #define D3DXCreateTextureFromFile D3DXCreateTextureFromFileA
- #endif
- HRESULT WINAPI
- D3DXCreateCubeTextureFromFileA(
- LPDIRECT3DDEVICE9 pDevice,
- LPCSTR pSrcFile,
- LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
- HRESULT WINAPI
- D3DXCreateCubeTextureFromFileW(
- LPDIRECT3DDEVICE9 pDevice,
- LPCWSTR pSrcFile,
- LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
- #ifdef UNICODE
- #define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileW
- #else
- #define D3DXCreateCubeTextureFromFile D3DXCreateCubeTextureFromFileA
- #endif
- HRESULT WINAPI
- D3DXCreateVolumeTextureFromFileA(
- LPDIRECT3DDEVICE9 pDevice,
- LPCSTR pSrcFile,
- LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
- HRESULT WINAPI
- D3DXCreateVolumeTextureFromFileW(
- LPDIRECT3DDEVICE9 pDevice,
- LPCWSTR pSrcFile,
- LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
- #ifdef UNICODE
- #define D3DXCreateVolumeTextureFromFile D3DXCreateVolumeTextureFromFileW
- #else
- #define D3DXCreateVolumeTextureFromFile D3DXCreateVolumeTextureFromFileA
- #endif
- // FromResource
- HRESULT WINAPI
- D3DXCreateTextureFromResourceA(
- LPDIRECT3DDEVICE9 pDevice,
- HMODULE hSrcModule,
- LPCSTR pSrcResource,
- LPDIRECT3DTEXTURE9* ppTexture);
- HRESULT WINAPI
- D3DXCreateTextureFromResourceW(
- LPDIRECT3DDEVICE9 pDevice,
- HMODULE hSrcModule,
- LPCWSTR pSrcResource,
- LPDIRECT3DTEXTURE9* ppTexture);
- #ifdef UNICODE
- #define D3DXCreateTextureFromResource D3DXCreateTextureFromResourceW
- #else
- #define D3DXCreateTextureFromResource D3DXCreateTextureFromResourceA
- #endif
- HRESULT WINAPI
- D3DXCreateCubeTextureFromResourceA(
- LPDIRECT3DDEVICE9 pDevice,
- HMODULE hSrcModule,
- LPCSTR pSrcResource,
- LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
- HRESULT WINAPI
- D3DXCreateCubeTextureFromResourceW(
- LPDIRECT3DDEVICE9 pDevice,
- HMODULE hSrcModule,
- LPCWSTR pSrcResource,
- LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
- #ifdef UNICODE
- #define D3DXCreateCubeTextureFromResource D3DXCreateCubeTextureFromResourceW
- #else
- #define D3DXCreateCubeTextureFromResource D3DXCreateCubeTextureFromResourceA
- #endif
- HRESULT WINAPI
- D3DXCreateVolumeTextureFromResourceA(
- LPDIRECT3DDEVICE9 pDevice,
- HMODULE hSrcModule,
- LPCSTR pSrcResource,
- LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
- HRESULT WINAPI
- D3DXCreateVolumeTextureFromResourceW(
- LPDIRECT3DDEVICE9 pDevice,
- HMODULE hSrcModule,
- LPCWSTR pSrcResource,
- LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
- #ifdef UNICODE
- #define D3DXCreateVolumeTextureFromResource D3DXCreateVolumeTextureFromResourceW
- #else
- #define D3DXCreateVolumeTextureFromResource D3DXCreateVolumeTextureFromResourceA
- #endif
- // FromFileEx
- HRESULT WINAPI
- D3DXCreateTextureFromFileExA(
- LPDIRECT3DDEVICE9 pDevice,
- LPCSTR pSrcFile,
- UINT Width,
- UINT Height,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- DWORD Filter,
- DWORD MipFilter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo,
- PALETTEENTRY* pPalette,
- LPDIRECT3DTEXTURE9* ppTexture);
- HRESULT WINAPI
- D3DXCreateTextureFromFileExW(
- LPDIRECT3DDEVICE9 pDevice,
- LPCWSTR pSrcFile,
- UINT Width,
- UINT Height,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- DWORD Filter,
- DWORD MipFilter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo,
- PALETTEENTRY* pPalette,
- LPDIRECT3DTEXTURE9* ppTexture);
- #ifdef UNICODE
- #define D3DXCreateTextureFromFileEx D3DXCreateTextureFromFileExW
- #else
- #define D3DXCreateTextureFromFileEx D3DXCreateTextureFromFileExA
- #endif
- HRESULT WINAPI
- D3DXCreateCubeTextureFromFileExA(
- LPDIRECT3DDEVICE9 pDevice,
- LPCSTR pSrcFile,
- UINT Size,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- DWORD Filter,
- DWORD MipFilter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo,
- PALETTEENTRY* pPalette,
- LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
- HRESULT WINAPI
- D3DXCreateCubeTextureFromFileExW(
- LPDIRECT3DDEVICE9 pDevice,
- LPCWSTR pSrcFile,
- UINT Size,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- DWORD Filter,
- DWORD MipFilter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo,
- PALETTEENTRY* pPalette,
- LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
- #ifdef UNICODE
- #define D3DXCreateCubeTextureFromFileEx D3DXCreateCubeTextureFromFileExW
- #else
- #define D3DXCreateCubeTextureFromFileEx D3DXCreateCubeTextureFromFileExA
- #endif
- HRESULT WINAPI
- D3DXCreateVolumeTextureFromFileExA(
- LPDIRECT3DDEVICE9 pDevice,
- LPCSTR pSrcFile,
- UINT Width,
- UINT Height,
- UINT Depth,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- DWORD Filter,
- DWORD MipFilter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo,
- PALETTEENTRY* pPalette,
- LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
- HRESULT WINAPI
- D3DXCreateVolumeTextureFromFileExW(
- LPDIRECT3DDEVICE9 pDevice,
- LPCWSTR pSrcFile,
- UINT Width,
- UINT Height,
- UINT Depth,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- DWORD Filter,
- DWORD MipFilter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo,
- PALETTEENTRY* pPalette,
- LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
- #ifdef UNICODE
- #define D3DXCreateVolumeTextureFromFileEx D3DXCreateVolumeTextureFromFileExW
- #else
- #define D3DXCreateVolumeTextureFromFileEx D3DXCreateVolumeTextureFromFileExA
- #endif
- // FromResourceEx
- HRESULT WINAPI
- D3DXCreateTextureFromResourceExA(
- LPDIRECT3DDEVICE9 pDevice,
- HMODULE hSrcModule,
- LPCSTR pSrcResource,
- UINT Width,
- UINT Height,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- DWORD Filter,
- DWORD MipFilter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo,
- PALETTEENTRY* pPalette,
- LPDIRECT3DTEXTURE9* ppTexture);
- HRESULT WINAPI
- D3DXCreateTextureFromResourceExW(
- LPDIRECT3DDEVICE9 pDevice,
- HMODULE hSrcModule,
- LPCWSTR pSrcResource,
- UINT Width,
- UINT Height,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- DWORD Filter,
- DWORD MipFilter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo,
- PALETTEENTRY* pPalette,
- LPDIRECT3DTEXTURE9* ppTexture);
- #ifdef UNICODE
- #define D3DXCreateTextureFromResourceEx D3DXCreateTextureFromResourceExW
- #else
- #define D3DXCreateTextureFromResourceEx D3DXCreateTextureFromResourceExA
- #endif
- HRESULT WINAPI
- D3DXCreateCubeTextureFromResourceExA(
- LPDIRECT3DDEVICE9 pDevice,
- HMODULE hSrcModule,
- LPCSTR pSrcResource,
- UINT Size,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- DWORD Filter,
- DWORD MipFilter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo,
- PALETTEENTRY* pPalette,
- LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
- HRESULT WINAPI
- D3DXCreateCubeTextureFromResourceExW(
- LPDIRECT3DDEVICE9 pDevice,
- HMODULE hSrcModule,
- LPCWSTR pSrcResource,
- UINT Size,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- DWORD Filter,
- DWORD MipFilter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo,
- PALETTEENTRY* pPalette,
- LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
- #ifdef UNICODE
- #define D3DXCreateCubeTextureFromResourceEx D3DXCreateCubeTextureFromResourceExW
- #else
- #define D3DXCreateCubeTextureFromResourceEx D3DXCreateCubeTextureFromResourceExA
- #endif
- HRESULT WINAPI
- D3DXCreateVolumeTextureFromResourceExA(
- LPDIRECT3DDEVICE9 pDevice,
- HMODULE hSrcModule,
- LPCSTR pSrcResource,
- UINT Width,
- UINT Height,
- UINT Depth,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- DWORD Filter,
- DWORD MipFilter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo,
- PALETTEENTRY* pPalette,
- LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
- HRESULT WINAPI
- D3DXCreateVolumeTextureFromResourceExW(
- LPDIRECT3DDEVICE9 pDevice,
- HMODULE hSrcModule,
- LPCWSTR pSrcResource,
- UINT Width,
- UINT Height,
- UINT Depth,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- DWORD Filter,
- DWORD MipFilter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo,
- PALETTEENTRY* pPalette,
- LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
- #ifdef UNICODE
- #define D3DXCreateVolumeTextureFromResourceEx D3DXCreateVolumeTextureFromResourceExW
- #else
- #define D3DXCreateVolumeTextureFromResourceEx D3DXCreateVolumeTextureFromResourceExA
- #endif
- // FromFileInMemory
- HRESULT WINAPI
- D3DXCreateTextureFromFileInMemory(
- LPDIRECT3DDEVICE9 pDevice,
- LPCVOID pSrcData,
- UINT SrcDataSize,
- LPDIRECT3DTEXTURE9* ppTexture);
- HRESULT WINAPI
- D3DXCreateCubeTextureFromFileInMemory(
- LPDIRECT3DDEVICE9 pDevice,
- LPCVOID pSrcData,
- UINT SrcDataSize,
- LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
- HRESULT WINAPI
- D3DXCreateVolumeTextureFromFileInMemory(
- LPDIRECT3DDEVICE9 pDevice,
- LPCVOID pSrcData,
- UINT SrcDataSize,
- LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
- // FromFileInMemoryEx
- HRESULT WINAPI
- D3DXCreateTextureFromFileInMemoryEx(
- LPDIRECT3DDEVICE9 pDevice,
- LPCVOID pSrcData,
- UINT SrcDataSize,
- UINT Width,
- UINT Height,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- DWORD Filter,
- DWORD MipFilter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo,
- PALETTEENTRY* pPalette,
- LPDIRECT3DTEXTURE9* ppTexture);
- HRESULT WINAPI
- D3DXCreateCubeTextureFromFileInMemoryEx(
- LPDIRECT3DDEVICE9 pDevice,
- LPCVOID pSrcData,
- UINT SrcDataSize,
- UINT Size,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- DWORD Filter,
- DWORD MipFilter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo,
- PALETTEENTRY* pPalette,
- LPDIRECT3DCUBETEXTURE9* ppCubeTexture);
- HRESULT WINAPI
- D3DXCreateVolumeTextureFromFileInMemoryEx(
- LPDIRECT3DDEVICE9 pDevice,
- LPCVOID pSrcData,
- UINT SrcDataSize,
- UINT Width,
- UINT Height,
- UINT Depth,
- UINT MipLevels,
- DWORD Usage,
- D3DFORMAT Format,
- D3DPOOL Pool,
- DWORD Filter,
- DWORD MipFilter,
- D3DCOLOR ColorKey,
- D3DXIMAGE_INFO* pSrcInfo,
- PALETTEENTRY* pPalette,
- LPDIRECT3DVOLUMETEXTURE9* ppVolumeTexture);
- //----------------------------------------------------------------------------
- // D3DXSaveTextureToFile:
- // ----------------------
- // Save a texture to a file.
- //
- // Parameters:
- // pDestFile
- // File name of the destination file
- // DestFormat
- // D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
- // pSrcTexture
- // Source texture, containing the image to be saved
- // pSrcPalette
- // Source palette of 256 colors, or NULL
- //
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXSaveTextureToFileA(
- LPCSTR pDestFile,
- D3DXIMAGE_FILEFORMAT DestFormat,
- LPDIRECT3DBASETEXTURE9 pSrcTexture,
- CONST PALETTEENTRY* pSrcPalette);
- HRESULT WINAPI
- D3DXSaveTextureToFileW(
- LPCWSTR pDestFile,
- D3DXIMAGE_FILEFORMAT DestFormat,
- LPDIRECT3DBASETEXTURE9 pSrcTexture,
- CONST PALETTEENTRY* pSrcPalette);
- #ifdef UNICODE
- #define D3DXSaveTextureToFile D3DXSaveTextureToFileW
- #else
- #define D3DXSaveTextureToFile D3DXSaveTextureToFileA
- #endif
- //----------------------------------------------------------------------------
- // D3DXSaveTextureToFileInMemory:
- // ----------------------
- // Save a texture to a file.
- //
- // Parameters:
- // ppDestBuf
- // address of a d3dxbuffer pointer to return the image data
- // DestFormat
- // D3DXIMAGE_FILEFORMAT specifying file format to use when saving.
- // pSrcTexture
- // Source texture, containing the image to be saved
- // pSrcPalette
- // Source palette of 256 colors, or NULL
- //
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXSaveTextureToFileInMemory(
- LPD3DXBUFFER* ppDestBuf,
- D3DXIMAGE_FILEFORMAT DestFormat,
- LPDIRECT3DBASETEXTURE9 pSrcTexture,
- CONST PALETTEENTRY* pSrcPalette);
- //////////////////////////////////////////////////////////////////////////////
- // Misc Texture APIs /////////////////////////////////////////////////////////
- //////////////////////////////////////////////////////////////////////////////
- //----------------------------------------------------------------------------
- // D3DXFilterTexture:
- // ------------------
- // Filters mipmaps levels of a texture.
- //
- // Parameters:
- // pBaseTexture
- // The texture object to be filtered
- // pPalette
- // 256 color palette to be used, or NULL for non-palettized formats
- // SrcLevel
- // The level whose image is used to generate the subsequent levels.
- // Filter
- // D3DX_FILTER flags controlling how each miplevel is filtered.
- // Or D3DX_DEFAULT for D3DX_FILTER_BOX,
- //
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXFilterTexture(
- LPDIRECT3DBASETEXTURE9 pBaseTexture,
- CONST PALETTEENTRY* pPalette,
- UINT SrcLevel,
- DWORD Filter);
- #define D3DXFilterCubeTexture D3DXFilterTexture
- #define D3DXFilterVolumeTexture D3DXFilterTexture
- //----------------------------------------------------------------------------
- // D3DXFillTexture:
- // ----------------
- // Uses a user provided function to fill each texel of each mip level of a
- // given texture.
- //
- // Paramters:
- // pTexture, pCubeTexture, pVolumeTexture
- // Pointer to the texture to be filled.
- // pFunction
- // Pointer to user provided evalutor function which will be used to
- // compute the value of each texel.
- // pData
- // Pointer to an arbitrary block of user defined data. This pointer
- // will be passed to the function provided in pFunction
- //-----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXFillTexture(
- LPDIRECT3DTEXTURE9 pTexture,
- LPD3DXFILL2D pFunction,
- LPVOID pData);
- HRESULT WINAPI
- D3DXFillCubeTexture(
- LPDIRECT3DCUBETEXTURE9 pCubeTexture,
- LPD3DXFILL3D pFunction,
- LPVOID pData);
- HRESULT WINAPI
- D3DXFillVolumeTexture(
- LPDIRECT3DVOLUMETEXTURE9 pVolumeTexture,
- LPD3DXFILL3D pFunction,
- LPVOID pData);
- //---------------------------------------------------------------------------
- // D3DXFillTextureTX:
- // ------------------
- // Uses a TX Shader target to function to fill each texel of each mip level
- // of a given texture. The TX Shader target should be a compiled function
- // taking 2 paramters and returning a float4 color.
- //
- // Paramters:
- // pTexture, pCubeTexture, pVolumeTexture
- // Pointer to the texture to be filled.
- // pTextureShader
- // Pointer to the texture shader to be used to fill in the texture
- //----------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXFillTextureTX(
- LPDIRECT3DTEXTURE9 pTexture,
- LPD3DXTEXTURESHADER pTextureShader);
- HRESULT WINAPI
- D3DXFillCubeTextureTX(
- LPDIRECT3DCUBETEXTURE9 pCubeTexture,
- LPD3DXTEXTURESHADER pTextureShader);
-
-
- HRESULT WINAPI
- D3DXFillVolumeTextureTX(
- LPDIRECT3DVOLUMETEXTURE9 pVolumeTexture,
- LPD3DXTEXTURESHADER pTextureShader);
- //----------------------------------------------------------------------------
- // D3DXComputeNormalMap:
- // ---------------------
- // Converts a height map into a normal map. The (x,y,z) components of each
- // normal are mapped to the (r,g,b) channels of the output texture.
- //
- // Parameters
- // pTexture
- // Pointer to the destination texture
- // pSrcTexture
- // Pointer to the source heightmap texture
- // pSrcPalette
- // Source palette of 256 colors, or NULL
- // Flags
- // D3DX_NORMALMAP flags
- // Channel
- // D3DX_CHANNEL specifying source of height information
- // Amplitude
- // The constant value which the height information is multiplied by.
- //---------------------------------------------------------------------------
- HRESULT WINAPI
- D3DXComputeNormalMap(
- LPDIRECT3DTEXTURE9 pTexture,
- LPDIRECT3DTEXTURE9 pSrcTexture,
- CONST PALETTEENTRY* pSrcPalette,
- DWORD Flags,
- DWORD Channel,
- FLOAT Amplitude);
- #ifdef __cplusplus
- }
- #endif //__cplusplus
- #endif //__D3DX9TEX_H__
|