This commit is contained in:
twinaphex 2017-04-21 21:18:28 +02:00
parent bcce88e516
commit e9e1db2945
3 changed files with 0 additions and 1114 deletions

View File

@ -12,70 +12,8 @@
#ifndef __D3DX9SHADER_H__
#define __D3DX9SHADER_H__
//---------------------------------------------------------------------------
// D3DXTX_VERSION:
// --------------
// Version token used to create a procedural texture filler in effects
// Used by D3DXFill[]TX functions
//---------------------------------------------------------------------------
#define D3DXTX_VERSION(_Major,_Minor) (('T' << 24) | ('X' << 16) | ((_Major) << 8) | (_Minor))
//----------------------------------------------------------------------------
// D3DXSHADER flags:
// -----------------
// D3DXSHADER_DEBUG
// Insert debug file/line/type/symbol information.
//
// D3DXSHADER_SKIPVALIDATION
// Do not validate the generated code against known capabilities and
// constraints. This option is only recommended when compiling shaders
// you KNOW will work. (ie. have compiled before without this option.)
// Shaders are always validated by D3D before they are set to the device.
//
// D3DXSHADER_SKIPOPTIMIZATION
// Instructs the compiler to skip optimization steps during code generation.
// Unless you are trying to isolate a problem in your code using this option
// is not recommended.
//
// D3DXSHADER_PACKMATRIX_ROWMAJOR
// Unless explicitly specified, matrices will be packed in row-major order
// on input and output from the shader.
//
// D3DXSHADER_PACKMATRIX_COLUMNMAJOR
// Unless explicitly specified, matrices will be packed in column-major
// order on input and output from the shader. This is generally more
// efficient, since it allows vector-matrix multiplication to be performed
// using a series of dot-products.
//
// D3DXSHADER_PARTIALPRECISION
// Force all computations in resulting shader to occur at partial precision.
// This may result in faster evaluation of shaders on some hardware.
//
// D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT
// Force compiler to compile against the next highest available software
// target for vertex shaders. This flag also turns optimizations off,
// and debugging on.
//
// D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT
// Force compiler to compile against the next highest available software
// target for pixel shaders. This flag also turns optimizations off,
// and debugging on.
//
// D3DXSHADER_NO_PRESHADER
// Disables Preshaders. Using this flag will cause the compiler to not
// pull out static expression for evaluation on the host cpu
//
// D3DXSHADER_AVOID_FLOW_CONTROL
// Hint compiler to avoid flow-control constructs where possible.
//
// D3DXSHADER_PREFER_FLOW_CONTROL
// Hint compiler to prefer flow-control constructs where possible.
//
//----------------------------------------------------------------------------
#define D3DXSHADER_DEBUG (1 << 0)
#define D3DXSHADER_SKIPVALIDATION (1 << 1)
#define D3DXSHADER_SKIPOPTIMIZATION (1 << 2)
@ -98,23 +36,12 @@
#define D3DXSHADER_OPTIMIZATION_LEVEL2 ((1 << 14) | (1 << 15))
#define D3DXSHADER_OPTIMIZATION_LEVEL3 (1 << 15)
//----------------------------------------------------------------------------
// D3DXCONSTTABLE flags:
// -------------------
#define D3DXCONSTTABLE_LARGEADDRESSAWARE (1 << 17)
//----------------------------------------------------------------------------
// D3DXHANDLE:
// -----------
// Handle values used to efficiently reference shader and effect parameters.
// Strings can be used as handles. However, handles are not always strings.
//----------------------------------------------------------------------------
#ifndef D3DXFX_LARGEADDRESS_HANDLE
typedef LPCSTR D3DXHANDLE;
#else
@ -122,15 +49,6 @@ typedef UINT_PTR D3DXHANDLE;
#endif
typedef D3DXHANDLE *LPD3DXHANDLE;
//----------------------------------------------------------------------------
// D3DXMACRO:
// ----------
// Preprocessor macro definition. The application pass in a NULL-terminated
// array of this structure to various D3DX APIs. This enables the application
// to #define tokens at runtime, before the file is parsed.
//----------------------------------------------------------------------------
typedef struct _D3DXMACRO
{
LPCSTR Name;
@ -370,11 +288,6 @@ DECLARE_INTERFACE_(ID3DXTextureShader, IUnknown)
STDMETHOD(SetMatrixTransposePointerArray)(THIS_ D3DXHANDLE hConstant, CONST D3DXMATRIX** ppMatrix, UINT Count) PURE;
};
//----------------------------------------------------------------------------
// D3DXINCLUDE_TYPE:
//----------------------------------------------------------------------------
typedef enum _D3DXINCLUDE_TYPE
{
D3DXINC_LOCAL,
@ -385,23 +298,6 @@ typedef enum _D3DXINCLUDE_TYPE
} D3DXINCLUDE_TYPE, *LPD3DXINCLUDE_TYPE;
//----------------------------------------------------------------------------
// ID3DXInclude:
// -------------
// This interface is intended to be implemented by the application, and can
// be used by various D3DX APIs. This enables application-specific handling
// of #include directives in source files.
//
// Open()
// Opens an include file. If successful, it should fill in ppData and
// pBytes. The data pointer returned must remain valid until Close is
// subsequently called. The name of the file is encoded in UTF-8 format.
// Close()
// Closes an include file. If Open was successful, Close is guaranteed
// to be called before the API using this interface returns.
//----------------------------------------------------------------------------
typedef interface ID3DXInclude ID3DXInclude;
typedef interface ID3DXInclude *LPD3DXINCLUDE;
@ -423,41 +319,6 @@ DECLARE_INTERFACE(ID3DXInclude)
extern "C" {
#endif //__cplusplus
//----------------------------------------------------------------------------
// D3DXAssembleShader:
// -------------------
// Assembles a shader.
//
// Parameters:
// pSrcFile
// Source file name
// hSrcModule
// Module handle. if NULL, current module will be used
// pSrcResource
// Resource name in module
// pSrcData
// Pointer to source code
// SrcDataLen
// Size of source code, in bytes
// pDefines
// Optional NULL-terminated array of preprocessor macro definitions.
// pInclude
// Optional interface pointer to use for handling #include directives.
// If this parameter is NULL, #includes will be honored when assembling
// from file, and will error when assembling from resource or memory.
// Flags
// See D3DXSHADER_xxx flags
// ppShader
// Returns a buffer containing the created shader. This buffer contains
// the assembled shader code, as well as any embedded debug info.
// ppErrorMsgs
// Returns a buffer containing a listing of errors and warnings that were
// encountered during assembly. If you are running in a debugger,
// these are the same messages you will see in your debug output.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXAssembleShaderFromFileA(
LPCSTR pSrcFile,
@ -520,53 +381,6 @@ HRESULT WINAPI
LPD3DXBUFFER* ppShader,
LPD3DXBUFFER* ppErrorMsgs);
//----------------------------------------------------------------------------
// D3DXCompileShader:
// ------------------
// Compiles a shader.
//
// Parameters:
// pSrcFile
// Source file name.
// hSrcModule
// Module handle. if NULL, current module will be used.
// pSrcResource
// Resource name in module.
// pSrcData
// Pointer to source code.
// SrcDataLen
// Size of source code, in bytes.
// pDefines
// Optional NULL-terminated array of preprocessor macro definitions.
// pInclude
// Optional interface pointer to use for handling #include directives.
// If this parameter is NULL, #includes will be honored when compiling
// from file, and will error when compiling from resource or memory.
// pFunctionName
// Name of the entrypoint function where execution should begin.
// pProfile
// Instruction set to be used when generating code. Currently supported
// profiles are "vs_1_1", "vs_2_0", "vs_2_a", "vs_2_sw", "ps_1_1",
// "ps_1_2", "ps_1_3", "ps_1_4", "ps_2_0", "ps_2_a", "ps_2_sw", "tx_1_0"
// Flags
// See D3DXSHADER_xxx flags.
// ppShader
// Returns a buffer containing the created shader. This buffer contains
// the compiled shader code, as well as any embedded debug and symbol
// table info. (See D3DXGetShaderConstantTable)
// ppErrorMsgs
// Returns a buffer containing a listing of errors and warnings that were
// encountered during the compile. If you are running in a debugger,
// these are the same messages you will see in your debug output.
// ppConstantTable
// Returns a ID3DXConstantTable object which can be used to set
// shader constants to the device. Alternatively, an application can
// parse the D3DXSHADER_CONSTANTTABLE block embedded as a comment within
// the shader.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXCompileShaderFromFileA(
LPCSTR pSrcFile,
@ -644,25 +458,6 @@ HRESULT WINAPI
LPD3DXBUFFER* ppErrorMsgs,
LPD3DXCONSTANTTABLE* ppConstantTable);
//----------------------------------------------------------------------------
// D3DXDisassembleShader:
// ----------------------
// Takes a binary shader, and returns a buffer containing text assembly.
//
// Parameters:
// pShader
// Pointer to the shader byte code.
// ShaderSizeInBytes
// Size of the shader byte code in bytes.
// EnableColorCode
// Emit HTML tags for color coding the output?
// pComments
// Pointer to a comment string to include at the top of the shader.
// ppDisassembly
// Returns a buffer containing the disassembled shader.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXDisassembleShader(
CONST DWORD* pShader,
@ -670,17 +465,6 @@ HRESULT WINAPI
LPCSTR pComments,
LPD3DXBUFFER* ppDisassembly);
//----------------------------------------------------------------------------
// D3DXGetPixelShaderProfile/D3DXGetVertexShaderProfile:
// -----------------------------------------------------
// Returns the name of the HLSL profile best suited to a given device.
//
// Parameters:
// pDevice
// Pointer to the device in question
//----------------------------------------------------------------------------
LPCSTR WINAPI
D3DXGetPixelShaderProfile(
LPDIRECT3DDEVICE9 pDevice);
@ -689,26 +473,6 @@ LPCSTR WINAPI
D3DXGetVertexShaderProfile(
LPDIRECT3DDEVICE9 pDevice);
//----------------------------------------------------------------------------
// D3DXFindShaderComment:
// ----------------------
// Searches through a shader for a particular comment, denoted by a FourCC in
// the first DWORD of the comment. If the comment is not found, and no other
// error has occurred, S_FALSE is returned.
//
// Parameters:
// pFunction
// Pointer to the function DWORD stream
// FourCC
// FourCC used to identify the desired comment block.
// ppData
// Returns a pointer to the comment data (not including comment token
// and FourCC). Can be NULL.
// pSizeInBytes
// Returns the size of the comment data in bytes. Can be NULL.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXFindShaderComment(
CONST DWORD* pFunction,
@ -716,54 +480,14 @@ HRESULT WINAPI
LPCVOID* ppData,
UINT* pSizeInBytes);
//----------------------------------------------------------------------------
// D3DXGetShaderSize:
// ------------------
// Returns the size of the shader byte-code, in bytes.
//
// Parameters:
// pFunction
// Pointer to the function DWORD stream
//----------------------------------------------------------------------------
UINT WINAPI
D3DXGetShaderSize(
CONST DWORD* pFunction);
//----------------------------------------------------------------------------
// D3DXGetShaderVersion:
// -----------------------
// Returns the shader version of a given shader. Returns zero if the shader
// function is NULL.
//
// Parameters:
// pFunction
// Pointer to the function DWORD stream
//----------------------------------------------------------------------------
DWORD WINAPI
D3DXGetShaderVersion(
CONST DWORD* pFunction);
//----------------------------------------------------------------------------
// D3DXGetShaderSemantics:
// -----------------------
// Gets semantics for all input elements referenced inside a given shader.
//
// Parameters:
// pFunction
// Pointer to the function DWORD stream
// pSemantics
// Pointer to an array of D3DXSEMANTIC structures. The function will
// fill this array with the semantics for each input element referenced
// inside the shader. This array is assumed to contain at least
// MAXD3DDECLLENGTH elements.
// pCount
// Returns the number of elements referenced by the shader
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXGetShaderInputSemantics(
CONST DWORD* pFunction,
@ -776,49 +500,12 @@ HRESULT WINAPI
D3DXSEMANTIC* pSemantics,
UINT* pCount);
//----------------------------------------------------------------------------
// D3DXGetShaderSamplers:
// ----------------------
// Gets semantics for all input elements referenced inside a given shader.
//
// pFunction
// Pointer to the function DWORD stream
// pSamplers
// Pointer to an array of LPCSTRs. The function will fill this array
// with pointers to the sampler names contained within pFunction, for
// each sampler referenced inside the shader. This array is assumed to
// contain at least 16 elements.
// pCount
// Returns the number of samplers referenced by the shader
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXGetShaderSamplers(
CONST DWORD* pFunction,
LPCSTR* pSamplers,
UINT* pCount);
//----------------------------------------------------------------------------
// D3DXGetShaderConstantTable:
// ---------------------------
// Gets shader constant table embedded inside shader. A constant table is
// generated by D3DXAssembleShader and D3DXCompileShader, and is embedded in
// the body of the shader.
//
// Parameters:
// pFunction
// Pointer to the function DWORD stream
// Flags
// See D3DXCONSTTABLE_xxx
// ppConstantTable
// Returns a ID3DXConstantTable object which can be used to set
// shader constants to the device. Alternatively, an application can
// parse the D3DXSHADER_CONSTANTTABLE block embedded as a comment within
// the shader.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXGetShaderConstantTable(
CONST DWORD* pFunction,
@ -830,61 +517,11 @@ HRESULT WINAPI
DWORD Flags,
LPD3DXCONSTANTTABLE* ppConstantTable);
//----------------------------------------------------------------------------
// D3DXCreateTextureShader:
// ------------------------
// Creates a texture shader object, given the compiled shader.
//
// Parameters
// pFunction
// Pointer to the function DWORD stream
// ppTextureShader
// Returns a ID3DXTextureShader object which can be used to procedurally
// fill the contents of a texture using the D3DXFillTextureTX functions.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXCreateTextureShader(
CONST DWORD* pFunction,
LPD3DXTEXTURESHADER* ppTextureShader);
//----------------------------------------------------------------------------
// D3DXPreprocessShader:
// ---------------------
// Runs the preprocessor on the specified shader or effect, but does
// not actually compile it. This is useful for evaluating the #includes
// and #defines in a shader and then emitting a reformatted token stream
// for debugging purposes or for generating a self-contained shader.
//
// Parameters:
// pSrcFile
// Source file name
// hSrcModule
// Module handle. if NULL, current module will be used
// pSrcResource
// Resource name in module
// pSrcData
// Pointer to source code
// SrcDataLen
// Size of source code, in bytes
// pDefines
// Optional NULL-terminated array of preprocessor macro definitions.
// pInclude
// Optional interface pointer to use for handling #include directives.
// If this parameter is NULL, #includes will be honored when assembling
// from file, and will error when assembling from resource or memory.
// ppShaderText
// Returns a buffer containing a single large string that represents
// the resulting formatted token stream
// ppErrorMsgs
// Returns a buffer containing a listing of errors and warnings that were
// encountered during assembly. If you are running in a debugger,
// these are the same messages you will see in your debug output.
//----------------------------------------------------------------------------
HRESULT WINAPI
D3DXPreprocessShaderFromFileA(
LPCSTR pSrcFile,

View File

@ -12,56 +12,6 @@
#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)
@ -80,88 +30,22 @@
#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,
@ -177,59 +61,12 @@ typedef enum _D3DXIMAGE_FILEFORMAT
} 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;
@ -242,43 +79,11 @@ typedef struct _D3DXIMAGE_INFO
} 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,
@ -321,52 +126,6 @@ HRESULT WINAPI
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,
@ -443,36 +202,6 @@ HRESULT WINAPI
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,
@ -484,41 +213,6 @@ HRESULT WINAPI
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,
@ -532,26 +226,6 @@ HRESULT WINAPI
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,
@ -574,25 +248,6 @@ HRESULT WINAPI
#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,
@ -606,45 +261,6 @@ HRESULT WINAPI
// 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,
@ -719,36 +335,6 @@ HRESULT WINAPI
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,
@ -760,45 +346,6 @@ HRESULT WINAPI
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,
@ -813,27 +360,6 @@ HRESULT WINAPI
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,
@ -856,26 +382,6 @@ HRESULT WINAPI
#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,
@ -888,29 +394,6 @@ HRESULT WINAPI
// 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,
@ -941,32 +424,6 @@ HRESULT WINAPI
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,
@ -1000,72 +457,6 @@ HRESULT WINAPI
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,
@ -1122,9 +513,6 @@ HRESULT WINAPI
#define D3DXCreateVolumeTextureFromFile D3DXCreateVolumeTextureFromFileA
#endif
// FromResource
HRESULT WINAPI
D3DXCreateTextureFromResourceA(
LPDIRECT3DDEVICE9 pDevice,
@ -1524,26 +912,6 @@ HRESULT WINAPI
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,
@ -1564,24 +932,6 @@ HRESULT WINAPI
#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,
@ -1596,24 +946,6 @@ HRESULT WINAPI
// 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,
@ -1624,25 +956,6 @@ HRESULT WINAPI
#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,
@ -1661,20 +974,6 @@ HRESULT WINAPI
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,
@ -1692,29 +991,6 @@ HRESULT WINAPI
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,
@ -1724,9 +1000,6 @@ HRESULT WINAPI
DWORD Channel,
FLOAT Amplitude);
#ifdef __cplusplus
}
#endif //__cplusplus

View File

@ -16,41 +16,17 @@
extern "C" {
#endif // defined( __cplusplus )
//----------------------------------------------------------------------------
// D3DXF_FILEFORMAT
// This flag is used to specify what file type to use when saving to disk.
// _BINARY, and _TEXT are mutually exclusive, while
// _COMPRESSED is an optional setting that works with all file types.
//----------------------------------------------------------------------------
typedef DWORD D3DXF_FILEFORMAT;
#define D3DXF_FILEFORMAT_BINARY 0
#define D3DXF_FILEFORMAT_TEXT 1
#define D3DXF_FILEFORMAT_COMPRESSED 2
//----------------------------------------------------------------------------
// D3DXF_FILESAVEOPTIONS
// This flag is used to specify where to save the file to. Each flag is
// mutually exclusive, indicates the data location of the file, and also
// chooses which additional data will specify the location.
// _TOFILE is paired with a filename (LPCSTR)
// _TOWFILE is paired with a filename (LPWSTR)
//----------------------------------------------------------------------------
typedef DWORD D3DXF_FILESAVEOPTIONS;
#define D3DXF_FILESAVE_TOFILE 0x00L
#define D3DXF_FILESAVE_TOWFILE 0x01L
//----------------------------------------------------------------------------
// D3DXF_FILELOADOPTIONS
// This flag is used to specify where to load the file from. Each flag is
// mutually exclusive, indicates the data location of the file, and also
// chooses which additional data will specify the location.
// _FROMFILE is paired with a filename (LPCSTR)
// _FROMWFILE is paired with a filename (LPWSTR)
// _FROMRESOURCE is paired with a (D3DXF_FILELOADRESOUCE*) description.
// _FROMMEMORY is paired with a (D3DXF_FILELOADMEMORY*) description.
//----------------------------------------------------------------------------
typedef DWORD D3DXF_FILELOADOPTIONS;
#define D3DXF_FILELOAD_FROMFILE 0x00L