SharpDX.Direct3D9 A collection of .

Contains information identifying the adapter.

The following pseudocode example illustrates the version format encoded in the DriverVersion, DriverVersionLowPart, and DriverVersionHighPart members.

 Product = HIWORD(DriverVersion.HighPart)	
            Version = LOWORD(DriverVersion.HighPart)	
            SubVersion = HIWORD(DriverVersion.LowPart)	
            Build = LOWORD(DriverVersion.LowPart)	
            

See the Platform SDK for more information about the HIWORD macro, the LOWORD macro, and the structure.

MAX_DEVICE_IDENTIFIER_STRING is a constant with the following definition.

#define MAX_DEVICE_IDENTIFIER_STRING        512

The VendorId, DeviceId, SubSysId, and Revision members can be used in tandem to identify particular chip sets. However, use these members with caution.

bb172505 D3DADAPTER_IDENTIFIER9 D3DADAPTER_IDENTIFIER9
Gets a value indicating whether the adapter is WHQL certified. true if certified; otherwise, false. Gets the driver version. Gets the certification date.

Used for presentation to the user. This should not be used to identify particular drivers, because many different strings might be associated with the same device and driver from different vendors.

bb172505 char Driver[512] char Driver

Used for presentation to the user.

bb172505 char Description[512] char Description

Device name for GDI.

bb172505 char DeviceName[32] char DeviceName

Identify the version of the Direct3D driver. It is legal to do less than and greater than comparisons on the 64-bit signed integer value. However, exercise caution if you use this element to identify problematic drivers. Instead, you should use DeviceIdentifier. See Remarks.

bb172505 LARGE_INTEGER DriverVersion LARGE_INTEGER DriverVersion

Can be used to help identify a particular chip set. Query this member to identify the manufacturer. The value can be zero if unknown.

bb172505 unsigned int VendorId unsigned int VendorId

Can be used to help identify a particular chip set. Query this member to identify the type of chip set. The value can be zero if unknown.

bb172505 unsigned int DeviceId unsigned int DeviceId

Can be used to help identify a particular chip set. Query this member to identify the subsystem, typically the particular board. The value can be zero if unknown.

bb172505 unsigned int SubSysId unsigned int SubSysId

Can be used to help identify a particular chip set. Query this member to identify the revision level of the chip set. The value can be zero if unknown.

bb172505 unsigned int Revision unsigned int Revision

Can be queried to check changes in the driver and chip set. This is a unique identifier for the driver and chip set pair. Query this member to track changes to the driver and chip set in order to generate a new profile for the graphics subsystem. DeviceIdentifier can also be used to identify particular problematic drivers.

bb172505 GUID DeviceIdentifier GUID DeviceIdentifier

Used to determine the Windows Hardware Quality Labs (WHQL) validation level for this driver and device pair. The DWORD is a packed date structure defining the date of the release of the most recent WHQL test passed by the driver. It is legal to perform < and > operations on this value. The following illustrates the date format.

Bits
31-16The year, a decimal number from 1999 upwards.
15-8The month, a decimal number from 1 to 12.
7-0The day, a decimal number from 1 to 31.

?

The following values are also used.

0Not certified.
1WHQL validated, but no date information is available.

?

Differences between Direct3D 9 and Direct3D 9Ex:

For Direct3D9Ex running on Windows Vista, Windows Server 2008, Windows 7, and Windows Server 2008 R2 (or more current operating system), returns 1 for the WHQL level without checking the status of the driver.

bb172505 unsigned int WHQLLevel unsigned int WHQLLevel
A collection of . Adapter information. Gets the capabilities of this adapter. The type. The capabilities Gets the display modes supported by this adapter. The format. The display modes supported by this adapter. Gets the adapter ordinal. Gets the current display mode. Gets the details. Gets the monitor. Adapter information. Gets the capabilities of this adapter. The type. The capabilities Gets the display modes supported by this adapter. The filter. The display modes supported by this adapter. Gets the adapter ordinal. Gets the current display mode. Gets the details. Gets the monitor. The assembly provides managed Direct3D9 API. bb219837 Direct3D9 Direct3D9 No documentation. bb280470 ID3DXBaseEffect ID3DXBaseEffect Gets the string. The parameter. HRESULT ID3DXBaseEffect::GetString([In] D3DXHANDLE hParameter,[Out] const void** ppString) Gets the value of the specified parameter. Handle of the parameter. The value of the parameter. HRESULT ID3DXBaseEffect::GetValue([In] D3DXHANDLE hParameter,[In] void* pData,[In] unsigned int Bytes) Gets the value of the specified parameter. Handle of the parameter. The count. The value of the parameter. HRESULT ID3DXBaseEffect::GetValue([In] D3DXHANDLE hParameter,[In] void* pData,[In] unsigned int Bytes) Sets a bool value. The effect handle. The value. A object describing the result of the operation. HRESULT ID3DXBaseEffect::SetBool([In] D3DXHANDLE hConstant,[In] BOOL b) Sets a float value. The effect handle. The value. A object describing the result of the operation. HRESULT ID3DXBaseEffect::SetFloat([In] D3DXHANDLE hConstant,[In] float f) Sets an int value. The effect handle. The value. A object describing the result of the operation. HRESULT ID3DXBaseEffect::SetInt([In] D3DXHANDLE hConstant,[In] int n) Sets a matrix. The effect handle. The value. A object describing the result of the operation. HRESULT ID3DXBaseEffect::SetMatrix([In] D3DXHANDLE hConstant,[In] const D3DXMATRIX* pMatrix) Sets a 4D vector. The effect handle. The value. A object describing the result of the operation. HRESULT ID3DXBaseEffect::SetVector([In] D3DXHANDLE hConstant,[In] const D3DXVECTOR4* pVector) Sets a typed value. Type of the value to set The effect handle. The value. A object describing the result of the operation. HRESULT ID3DXBaseEffect::SetValue([In] D3DXHANDLE hConstant,[In] const void* pData,[In] unsigned int Bytes) Sets an array of bools. The effect handle. The values. A object describing the result of the operation. HRESULT ID3DXBaseEffect::SetBoolArray([In] D3DXHANDLE hConstant,[In, Buffer] const BOOL* pb,[In] unsigned int Count) Sets an array of floats. The effect handle. The values. A object describing the result of the operation. HRESULT ID3DXBaseEffect::SetFloatArray([In] D3DXHANDLE hConstant,[In, Buffer] const float* pf,[In] unsigned int Count) Sets an array of ints. The effect handle. The values. A object describing the result of the operation. HRESULT ID3DXBaseEffect::SetIntArray([In] D3DXHANDLE hConstant,[In, Buffer] const int* pn,[In] unsigned int Count) Sets an array of matrices. The effect handle. The values. A object describing the result of the operation. HRESULT ID3DXBaseEffect::SetMatrixArray([In] D3DXHANDLE hConstant,[In, Buffer] const D3DXMATRIX* pMatrix,[In] unsigned int Count) Sets an array of 4D vectors. The effect handle. The values. A object describing the result of the operation. HRESULT ID3DXBaseEffect::SetVectorArray([In] D3DXHANDLE hConstant,[In, Buffer] const D3DXVECTOR4* pVector,[In] unsigned int Count) Sets an array of elements. Type of the array element The effect handle. The values. A object describing the result of the operation. HRESULT ID3DXBaseEffect::SetValue([In] D3DXHANDLE hConstant,[In] const void* pData,[In] unsigned int Bytes) Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the effect description.

bb205681 GetDesc GetDesc HRESULT ID3DXBaseEffect::GetDesc([Out] D3DXEFFECT_DESC* pDesc)

Gets the effect description.

Returns a description of the effect. See .

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205681 HRESULT ID3DXBaseEffect::GetDesc([Out] D3DXEFFECT_DESC* pDesc) ID3DXBaseEffect::GetDesc

Gets a parameter or annotation description.

Parameter or annotation handle. See Handles (Direct3D 9).

Returns a description of the specified parameter or annotation. See .

bb205698 HRESULT ID3DXBaseEffect::GetParameterDesc([In] D3DXHANDLE hParameter,[Out] D3DXPARAMETER_DESC* pDesc) ID3DXBaseEffect::GetParameterDesc

Gets a technique description.

Technique handle. See Handles (Direct3D 9).

Returns a description of the technique. See .

bb205707 HRESULT ID3DXBaseEffect::GetTechniqueDesc([In] D3DXHANDLE hTechnique,[Out] D3DXTECHNIQUE_DESC* pDesc) ID3DXBaseEffect::GetTechniqueDesc

Gets a pass description.

Pass handle. See Handles (Direct3D 9).

Returns a description of the specified pass. See .

Note??If an effect is created with , this method will return null references (in ) to the shader functions.

bb205702 HRESULT ID3DXBaseEffect::GetPassDesc([In] D3DXHANDLE hPass,[Out] D3DXPASS_DESC* pDesc) ID3DXBaseEffect::GetPassDesc

Gets a function description.

Function handle. See Handles (Direct3D 9).

Returns a description of the function. See .

bb205686 HRESULT ID3DXBaseEffect::GetFunctionDesc([In] D3DXHANDLE hShader,[Out] D3DXFUNCTION_DESC* pDesc) ID3DXBaseEffect::GetFunctionDesc

Gets the handle of a top-level parameter or a structure member parameter.

Handle of the parameter, or null for top-level parameters. See Handles (Direct3D 9).

Parameter index.

Returns the handle of the specified parameter, or null if the index was invalid. See Handles (Direct3D 9).

bb205695 D3DXHANDLE ID3DXBaseEffect::GetParameter([In] D3DXHANDLE hParameter,[In] unsigned int Index) ID3DXBaseEffect::GetParameter

Gets the handle of a top-level parameter or a structure member parameter by looking up its name.

Handle of the parameter, or null for top-level parameters. See Handles (Direct3D 9).

String containing the parameter name.

Returns the handle of the specified parameter, or null if the index was invalid. See Handles (Direct3D 9).

bb205696 D3DXHANDLE ID3DXBaseEffect::GetParameterByName([In] D3DXHANDLE hParameter,[In] const char* pName) ID3DXBaseEffect::GetParameterByName

Gets the handle of a top-level parameter or a structure member parameter by looking up its semantic with a case-insensitive search.

Handle of the parameter, or null for top-level parameters. See Handles (Direct3D 9).

String containing the semantic name.

Returns the handle of the first parameter that matches the specified semantic, or null if the semantic was not found. See Handles (Direct3D 9).

bb205697 D3DXHANDLE ID3DXBaseEffect::GetParameterBySemantic([In] D3DXHANDLE hParameter,[In] const char* pSemantic) ID3DXBaseEffect::GetParameterBySemantic

Get the handle of an array element parameter.

Handle of the array. See Handles (Direct3D 9).

Array element index.

Returns the handle of the specified parameter, or null if either hParameter or ElementIndex is invalid. See Handles (Direct3D 9).

This method is used to get an element of a parameter that is an array.

bb205699 D3DXHANDLE ID3DXBaseEffect::GetParameterElement([In] D3DXHANDLE hParameter,[In] unsigned int Index) ID3DXBaseEffect::GetParameterElement

Gets the handle of a technique.

Technique index.

Returns the handle of the specified technique, or null if the index was invalid. See Handles (Direct3D 9).

bb205705 D3DXHANDLE ID3DXBaseEffect::GetTechnique([In] unsigned int Index) ID3DXBaseEffect::GetTechnique

Gets the handle of a technique by looking up its name.

String containing the technique name.

Returns the handle of the first technique that has the specified name, or null if the name was not found. See Handles (Direct3D 9).

bb205706 D3DXHANDLE ID3DXBaseEffect::GetTechniqueByName([In] const char* pName) ID3DXBaseEffect::GetTechniqueByName

Gets the handle of a pass.

Handle of the parent technique. See Handles (Direct3D 9).

Index for the pass.

Returns the handle of the specified pass inside the specified technique, or null if the index was invalid. See Handles (Direct3D 9).

bb205700 D3DXHANDLE ID3DXBaseEffect::GetPass([In] D3DXHANDLE hTechnique,[In] unsigned int Index) ID3DXBaseEffect::GetPass

Gets the handle of a pass by looking up its name.

Handle of the parent technique. See Handles (Direct3D 9).

String containing the pass name.

Returns the handle of the first pass inside the specified technique that has the specified name, or null if the name was not found. See Handles (Direct3D 9).

bb205701 D3DXHANDLE ID3DXBaseEffect::GetPassByName([In] D3DXHANDLE hTechnique,[In] const char* pName) ID3DXBaseEffect::GetPassByName

Gets the handle of a function.

Function index.

Returns the handle of the specified function, or null if the index was invalid. See Handles (Direct3D 9).

bb205684 D3DXHANDLE ID3DXBaseEffect::GetFunction([In] unsigned int Index) ID3DXBaseEffect::GetFunction

Gets the handle of a function by looking up its name.

String containing the function name.

Returns the handle of the specified function, or null if the name was not found. See Handles (Direct3D 9).

bb205685 D3DXHANDLE ID3DXBaseEffect::GetFunctionByName([In] const char* pName) ID3DXBaseEffect::GetFunctionByName

Gets the handle of an annotation.

Handle of a technique, pass, or top-level parameter. See Handles (Direct3D 9).

Annotation index.

Returns the handle of the specified annotation, or null if the index was invalid. See Handles (Direct3D 9).

Annotations are user-specific data that can be attached to any technique, pass, or parameter. See Handles (Direct3D 9).

bb205677 D3DXHANDLE ID3DXBaseEffect::GetAnnotation([In] D3DXHANDLE hObject,[In] unsigned int Index) ID3DXBaseEffect::GetAnnotation

Gets the handle of an annotation by looking up its name.

Handle of a technique, pass, or top-level parameter. See Handles (Direct3D 9).

String containing the annotation name.

Returns the handle of the specified annotation, or null if the name was not found. See Handles (Direct3D 9).

bb205678 D3DXHANDLE ID3DXBaseEffect::GetAnnotationByName([In] D3DXHANDLE hObject,[In] const char* pName) ID3DXBaseEffect::GetAnnotationByName

Set the value of an arbitrary parameter or annotation, including simple types, structs, arrays, strings, shaders and textures.

Unique identifier. See Handles (Direct3D 9).

Pointer to a buffer containing data.

[in] Number of bytes in the buffer. Pass in D3DX_DEFAULT if you know your buffer is large enough to contain the entire parameter, and you want to skip size validation.

If the method succeeds, the return value is . If the method fails, the return value can be .

This method can be used in place of nearly all the effect set API calls.

bb205728 HRESULT ID3DXBaseEffect::SetValue([In] D3DXHANDLE hParameter,[In] const void* pData,[In] unsigned int Bytes) ID3DXBaseEffect::SetValue

Get the value of an arbitrary parameter or annotation, including simple types, structs, arrays, strings, shaders and textures. This method can be used in place of nearly all the Getxxx calls in .

No documentation. No documentation. No documentation.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205709 HRESULT ID3DXBaseEffect::GetValue([In] D3DXHANDLE hParameter,[In] void* pData,[In] unsigned int Bytes) ID3DXBaseEffect::GetValue

Sets a value.

Unique identifier. See Handles (Direct3D 9).

Boolean value.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205714 HRESULT ID3DXBaseEffect::SetBool([In] D3DXHANDLE hParameter,[In] BOOL b) ID3DXBaseEffect::SetBool

Gets a value.

Unique identifier. See Handles (Direct3D 9).

Returns a Boolean value.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205679 HRESULT ID3DXBaseEffect::GetBool([In] D3DXHANDLE hParameter,[Out] BOOL* pb) ID3DXBaseEffect::GetBool

Sets an array of Boolean values.

Unique identifier. See Handles (Direct3D 9).

Array of Boolean values.

Number of Boolean values in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205715 HRESULT ID3DXBaseEffect::SetBoolArray([In] D3DXHANDLE hParameter,[In, Buffer] const BOOL* pb,[In] unsigned int Count) ID3DXBaseEffect::SetBoolArray

Gets an array of values.

Unique identifier. See Handles (Direct3D 9).

Returns an array of Boolean values.

Number of Boolean values in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205680 HRESULT ID3DXBaseEffect::GetBoolArray([In] D3DXHANDLE hParameter,[Out, Buffer] BOOL* pb,[In] unsigned int Count) ID3DXBaseEffect::GetBoolArray

Sets an integer.

Unique identifier. See Handles (Direct3D 9).

Integer value.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205718 HRESULT ID3DXBaseEffect::SetInt([In] D3DXHANDLE hParameter,[In] int n) ID3DXBaseEffect::SetInt

Gets an integer.

Unique identifier. See Handles (Direct3D 9).

Returns an integer.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205687 HRESULT ID3DXBaseEffect::GetInt([In] D3DXHANDLE hParameter,[Out] int* pn) ID3DXBaseEffect::GetInt

Sets an array of integers.

Unique identifier. See Handles (Direct3D 9).

Array of integers.

Number of integers in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205719 HRESULT ID3DXBaseEffect::SetIntArray([In] D3DXHANDLE hParameter,[In, Buffer] const int* pn,[In] unsigned int Count) ID3DXBaseEffect::SetIntArray

Gets an array of integers.

Unique identifier. See Handles (Direct3D 9).

Returns an array of integers.

Number of integers in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205688 HRESULT ID3DXBaseEffect::GetIntArray([In] D3DXHANDLE hParameter,[Out, Buffer] int* pn,[In] unsigned int Count) ID3DXBaseEffect::GetIntArray

Sets a floating point value.

Unique identifier. See Handles (Direct3D 9).

Floating point value.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205716 HRESULT ID3DXBaseEffect::SetFloat([In] D3DXHANDLE hParameter,[In] float f) ID3DXBaseEffect::SetFloat

Gets a floating point value.

Unique identifier. See Handles (Direct3D 9).

Returns a floating point value.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205682 HRESULT ID3DXBaseEffect::GetFloat([In] D3DXHANDLE hParameter,[Out] float* pf) ID3DXBaseEffect::GetFloat

Sets an array of floating point values.

Unique identifier. See Handles (Direct3D 9).

Array of floating point values.

Number of floating point values in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205717 HRESULT ID3DXBaseEffect::SetFloatArray([In] D3DXHANDLE hParameter,[In, Buffer] const float* pf,[In] unsigned int Count) ID3DXBaseEffect::SetFloatArray

Gets an array of floating point values.

Unique identifier. See Handles (Direct3D 9).

Returns an array of floating point values.

Number of floating point values in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205683 HRESULT ID3DXBaseEffect::GetFloatArray([In] D3DXHANDLE hParameter,[Out, Buffer] float* pf,[In] unsigned int Count) ID3DXBaseEffect::GetFloatArray

Sets a vector.

Unique identifier. See Handles (Direct3D 9).

Pointer to a 4D vector.

If the method succeeds, the return value is . If the method fails, the return value can be .

If the destination vector is smaller than the source vector, the additional components of the source vector will be ignored.

bb205729 HRESULT ID3DXBaseEffect::SetVector([In] D3DXHANDLE hParameter,[In] const D3DXVECTOR4* pVector) ID3DXBaseEffect::SetVector

Gets a vector.

Unique identifier. See Handles (Direct3D 9).

Returns a 4D vector.

If the method succeeds, the return value is . If the method fails, the return value can be .

If the destination vector is larger than the source vector, only the initial components of the destination vector will be filled, and the remaining components will be set to zero.

bb205710 HRESULT ID3DXBaseEffect::GetVector([In] D3DXHANDLE hParameter,[Out] D3DXVECTOR4* pVector) ID3DXBaseEffect::GetVector

Sets an array of vectors.

Unique identifier. See Handles (Direct3D 9).

Array of 4D floating point vectors.

Number of vectors in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

If the destination vectors are smaller than the source vectors, the additional components of the source vectors will be ignored.

bb205730 HRESULT ID3DXBaseEffect::SetVectorArray([In] D3DXHANDLE hParameter,[In, Buffer] const D3DXVECTOR4* pVector,[In] unsigned int Count) ID3DXBaseEffect::SetVectorArray

Gets an array of vectors.

Unique identifier. See Handles (Direct3D 9).

Returns an array of 4D floating point vectors.

Number of vectors in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

If the destination vectors are larger than the source vectors, only the initial components of each destination vector will be filled, and the remaining destination vector components will be set to zero.

bb205711 HRESULT ID3DXBaseEffect::GetVectorArray([In] D3DXHANDLE hParameter,[Out, Buffer] D3DXVECTOR4* pVector,[In] unsigned int Count) ID3DXBaseEffect::GetVectorArray

Sets a non-transposed matrix.

Unique identifier. See Handles (Direct3D 9).

Pointer to a nontransposed matrix. See .

If the method succeeds, the return value is . If the method fails, the return value can be .

A non-transposed matrix contains row-major data. In other words, each vector is contained in a row.

If the destination matrix is smaller than the source matrix, the additional components of the source matrix will be ignored.

bb205720 HRESULT ID3DXBaseEffect::SetMatrix([In] D3DXHANDLE hParameter,[In] const D3DXMATRIX* pMatrix) ID3DXBaseEffect::SetMatrix

Gets a nontransposed matrix.

Unique identifier. See Handles (Direct3D 9).

Returns a nontransposed matrix. See .

If the method succeeds, the return value is . If the method fails, the return value can be .

A nontransposed matrix contains row-major data; that is, each vector is contained in a row.

If the destination matrix is larger than the source matrix, only the upper-left components of the destination matrix will be filled, and the remaining components will be set to zero.

bb205689 HRESULT ID3DXBaseEffect::GetMatrix([In] D3DXHANDLE hParameter,[Out] D3DXMATRIX* pMatrix) ID3DXBaseEffect::GetMatrix

Sets an array of nontransposed matrices.

Unique identifier. See Handles (Direct3D 9).

Array of nontransposed matrices. See .

Number of matrices in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

A nontransposed matrix contains row-major data; that is, each vector is contained in a row.

If the destination matrices are smaller than the source matrices, the additional components of the source matrices will be ignored.

bb205721 HRESULT ID3DXBaseEffect::SetMatrixArray([In] D3DXHANDLE hParameter,[In, Buffer] const D3DXMATRIX* pMatrix,[In] unsigned int Count) ID3DXBaseEffect::SetMatrixArray

Gets an array of nontransposed matrices.

Unique identifier. See Handles (Direct3D 9).

Returns an array of nontransposed matrices. See .

Number of matrices in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

A nontransposed matrix contains row-major data; that is, each vector is contained in a row.

If the destination matrices are larger than the source matrices, only the upper-left components of each destination matrix will be filled, and the remaining destination matrix components will be set to zero.

bb205690 HRESULT ID3DXBaseEffect::GetMatrixArray([In] D3DXHANDLE hParameter,[Out, Buffer] D3DXMATRIX* pMatrix,[In] unsigned int Count) ID3DXBaseEffect::GetMatrixArray

Sets an array of references to nontransposed matrices.

Unique identifier. See Handles (Direct3D 9).

Array of references to nontransposed matrices. See .

Number of matrices in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

A nontransposed matrix contains row-major data; that is, each vector is contained in a row.

If the destination matrices are smaller than the source matrices, the additional components of the source matrices will be ignored.

bb205722 HRESULT ID3DXBaseEffect::SetMatrixPointerArray([In] D3DXHANDLE hParameter,[In] const D3DXMATRIX** ppMatrix,[In] unsigned int Count) ID3DXBaseEffect::SetMatrixPointerArray

Gets an array of references to nontransposed matrices.

Unique identifier. See Handles (Direct3D 9).

Array of references to nontransposed matrices. See .

Number of matrices in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

A nontransposed matrix contains row-major data; that is, each vector is contained in a row.

If the destination matrices are larger than the source matrices, only the upper-left components of each destination matrix will be filled, and the remaining destination matrix components will be set to zero.

bb205691 HRESULT ID3DXBaseEffect::GetMatrixPointerArray([In] D3DXHANDLE hParameter,[Out] D3DXMATRIX** ppMatrix,[In] unsigned int Count) ID3DXBaseEffect::GetMatrixPointerArray

Sets a transposed matrix.

Unique identifier. See Handles (Direct3D 9).

Pointer to a transposed matrix. See .

If the method succeeds, the return value is . If the method fails, the return value can be .

A transposed matrix contains column-major data; that is, each vector is contained in a column.

If the destination matrix is smaller than the source matrix, the additional components of the source matrix will be ignored.

bb205723 HRESULT ID3DXBaseEffect::SetMatrixTranspose([In] D3DXHANDLE hParameter,[In] const D3DXMATRIX* pMatrix) ID3DXBaseEffect::SetMatrixTranspose

Gets a transposed matrix.

Unique identifier. See Handles (Direct3D 9).

Returns a transposed matrix. See .

If the method succeeds, the return value is . If the method fails, the return value can be .

A transposed matrix contains column-major data; that is, each vector is contained in a column.

If the destination matrix is larger than the source matrix, only the upper-left elements of the destination matrix will be filled, and the remaining destination matrix components will be set to zero.

bb205692 HRESULT ID3DXBaseEffect::GetMatrixTranspose([In] D3DXHANDLE hParameter,[Out] D3DXMATRIX* pMatrix) ID3DXBaseEffect::GetMatrixTranspose

Sets an array of transposed matrices.

Unique identifier. See Handles (Direct3D 9).

Array of transposed matrices. See .

Number of matrices in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

A transposed matrix contains column-major data; that is, each vector is contained in a column.

If the destination matrices are smaller than the source matrices, the additional components of the source matrices will be ignored.

bb205724 HRESULT ID3DXBaseEffect::SetMatrixTransposeArray([In] D3DXHANDLE hParameter,[In, Buffer] const D3DXMATRIX* pMatrix,[In] unsigned int Count) ID3DXBaseEffect::SetMatrixTransposeArray

Gets an array of transposed matrices.

Unique identifier. See Handles (Direct3D 9).

Returns an array of transposed matrices. See .

Number of matrices in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

A transposed matrix contains column-major data; that is, each vector is contained in a column.

If the destination matrices are larger than the source matrices, only the upper-left components of each destination matrix will be filled, and the remaining destination matrix components will be set to zero.

bb205693 HRESULT ID3DXBaseEffect::GetMatrixTransposeArray([In] D3DXHANDLE hParameter,[Out, Buffer] D3DXMATRIX* pMatrix,[In] unsigned int Count) ID3DXBaseEffect::GetMatrixTransposeArray

Sets an array of references to transposed matrices.

Unique identifier. See Handles (Direct3D 9).

Array of references to transposed matrices. See .

Number of matrices in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

A transposed matrix contains column-major data; that is, each vector is contained in a column.

If the destination matrices are smaller than the source matrices, the additional components of the source matrices will be ignored.

bb205725 HRESULT ID3DXBaseEffect::SetMatrixTransposePointerArray([In] D3DXHANDLE hParameter,[In] const D3DXMATRIX** ppMatrix,[In] unsigned int Count) ID3DXBaseEffect::SetMatrixTransposePointerArray

Gets an array of references to transposed matrices.

Unique identifier. See Handles (Direct3D 9).

Array of references to transposed matrices. See .

Number of matrices in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

A transposed matrix contains column-major data; that is, each vector is contained in a column.

If the destination matrices are larger than the source matrices, only the upper-left components of each destination matrix will be filled, and the remaining destination matrix components will be set to zero.

bb205694 HRESULT ID3DXBaseEffect::GetMatrixTransposePointerArray([In] D3DXHANDLE hParameter,[Out] D3DXMATRIX** ppMatrix,[In] unsigned int Count) ID3DXBaseEffect::GetMatrixTransposePointerArray

Sets a string.

Unique identifier. See Handles (Direct3D 9).

String to set.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205726 HRESULT ID3DXBaseEffect::SetString([In] D3DXHANDLE hParameter,[In] const char* pString) ID3DXBaseEffect::SetString

Gets a string.

Unique identifier. See Handles (Direct3D 9).

Returns a string identified by hParameter.

bb205704 HRESULT ID3DXBaseEffect::GetString([In] D3DXHANDLE hParameter,[Out] const void** ppString) ID3DXBaseEffect::GetString

Sets a texture.

Unique identifier. See Handles (Direct3D 9).

Texture object. See .

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205727 HRESULT ID3DXBaseEffect::SetTexture([In] D3DXHANDLE hParameter,[In] IDirect3DBaseTexture9* pTexture) ID3DXBaseEffect::SetTexture

Gets a texture.

Unique identifier. See Handles (Direct3D 9).

Returns a texture object. See .

bb205708 HRESULT ID3DXBaseEffect::GetTexture([In] D3DXHANDLE hParameter,[Out] IDirect3DBaseTexture9** ppTexture) ID3DXBaseEffect::GetTexture

Gets a pixel shader.

Unique identifier. See Handles (Direct3D 9).

Returns a pixel shader object. See object.

bb205703 HRESULT ID3DXBaseEffect::GetPixelShader([In] D3DXHANDLE hParameter,[Out] IDirect3DPixelShader9** ppPShader) ID3DXBaseEffect::GetPixelShader

Gets a vertex shader.

Unique identifier. See Handles (Direct3D 9).

Returns a vertex shader object. See .

bb205712 HRESULT ID3DXBaseEffect::GetVertexShader([In] D3DXHANDLE hParameter,[Out] IDirect3DVertexShader9** ppVShader) ID3DXBaseEffect::GetVertexShader

Set the range of an array to pass to the device.

Unique identifier. See Handles (Direct3D 9).

Start index.

Stop index.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205713 HRESULT ID3DXBaseEffect::SetArrayRange([In] D3DXHANDLE hParameter,[In] unsigned int uStart,[In] unsigned int uEnd) ID3DXBaseEffect::SetArrayRange

Applications use the methods of the interface to manipulate texture resources including cube and volume textures.

The interface assigned to a particular stage for a device is obtained by calling the GetTexture method.

The LPDIRECT3DBASETEXTURE9 and PDIRECT3DBASETEXTURE9 types are defined as references to the interface.

typedef struct  *LPDIRECT3DBASETEXTURE9, *PDIRECT3DBASETEXTURE9;
bb174322 IDirect3DBaseTexture9 IDirect3DBaseTexture9
Filters mipmap levels of a texture. The source level. The filter. A object describing the result of the operation. HRESULT D3DXFilterTexture([In] IDirect3DBaseTexture9* pBaseTexture,[In, Buffer] const PALETTEENTRY* pPalette,[In] unsigned int SrcLevel,[In] D3DX_FILTER Filter) Filters mipmap levels of a texture. The source level. The filter. The palette. A object describing the result of the operation. HRESULT D3DXFilterTexture([In] IDirect3DBaseTexture9* pBaseTexture,[In, Buffer] const PALETTEENTRY* pPalette,[In] unsigned int SrcLevel,[In] D3DX_FILTER Filter) Saves a texture to a file. The texture. Name of the file. The format. A object describing the result of the operation. HRESULT D3DXSaveTextureToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DBaseTexture9* pSrcTexture,[In, Buffer] const PALETTEENTRY* pSrcPalette) Saves a texture to a file. The texture. Name of the file. The format. The palette. A object describing the result of the operation. HRESULT D3DXSaveTextureToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DBaseTexture9* pSrcTexture,[In, Buffer] const PALETTEENTRY* pSrcPalette) Saves a texture to a stream. The texture. The format. A containing the saved texture. HRESULT D3DXSaveTextureToFileInMemory([Out] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DBaseTexture9* pSrcTexture,[In, Buffer] const PALETTEENTRY* pSrcPalette) Saves a texture to a stream. The texture. The format. The palette. A containing the saved texture. HRESULT D3DXSaveTextureToFileInMemory([Out] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DBaseTexture9* pSrcTexture,[In, Buffer] const PALETTEENTRY* pSrcPalette) Gets or sets the level of details. The level of details. unsigned int IDirect3DBaseTexture9::GetLOD() unsigned int IDirect3DBaseTexture9::SetLOD([In] unsigned int LODNew) Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Returns the number of texture levels in a multilevel texture.

Warning??If you create a texture with to make that texture automatically generate sublevels, GetLevelCount always returns 1 for the number of levels.

This method applies to the following interfaces, which inherit from .

bb174325 GetLevelCount GetLevelCount unsigned int IDirect3DBaseTexture9::GetLevelCount()

Get or sets the filter type that is used for automatically generated mipmap sublevels.

Changing the filter type "dirties" the mipmap sublevels and causes them to be regenerated.

The (default) filter type set at texture creation time is . If the driver doesn't support a linear filter, the filter type will be set to . All filter types supported by the driver for regular texture filtering are supported for autogeneration except . For each resource type, drivers should support all the filter types reported in the corresponding texture, CubeTexture, and volumetexture filter caps. For more information about texture types, see .

This method has no effect if the texture is not created with .

bb174324 GetAutoGenFilterType / SetAutoGenFilterType GetAutoGenFilterType D3DTEXTUREFILTERTYPE IDirect3DBaseTexture9::GetAutoGenFilterType()

Sets the most detailed level-of-detail for a managed texture.

Most detailed level-of-detail value to set for the mipmap chain.

A DWORD value, clamped to the maximum level-of-detail value (one less than the total number of levels). Subsequent calls to this method will return the clamped value, not the level-of-detail value that was previously set.

This method applies to the following interfaces, which inherit from .

SetLOD is used for level-of-detail control of managed textures. This method returns 0 on nonmanaged textures.

SetLOD communicates to the Direct3D texture manager the most detailed mipmap in the chain that should be loaded into local video memory. For example, in a five-level mipmap chain, setting LODNew to 2 indicates that the texture manager should load only mipmap levels 2 through 4 into local video memory at any given time.

More specifically, if the texture was created with the dimensions of 256x256, setting the most detailed level to 0 indicates that 256 x 256 is the largest mipmap available, setting the most detailed level to 1 indicates that 128 x 128 is the largest mipmap available, and so on, up to the most detailed mip level (the smallest texture size) for the chain.

bb174328 unsigned int IDirect3DBaseTexture9::SetLOD([In] unsigned int LODNew) IDirect3DBaseTexture9::SetLOD

Returns a value clamped to the maximum level-of-detail set for a managed texture (this method is not supported for an unmanaged texture).

A DWORD value, clamped to the maximum level-of-detail value (one less than the total number of levels). Calling GetLOD on an unmanaged texture is not supported and will result in a D3DERR error code being returned.

bb174326 unsigned int IDirect3DBaseTexture9::GetLOD() IDirect3DBaseTexture9::GetLOD

Returns the number of texture levels in a multilevel texture.

A DWORD value that indicates the number of texture levels in a multilevel texture.

Warning??If you create a texture with to make that texture automatically generate sublevels, GetLevelCount always returns 1 for the number of levels.

This method applies to the following interfaces, which inherit from .

bb174325 unsigned int IDirect3DBaseTexture9::GetLevelCount() IDirect3DBaseTexture9::GetLevelCount

Set the filter type that is used for automatically generated mipmap sublevels.

Filter type. See . This method will fail if the filter type is invalid or not supported.

If the method succeeds, the return value is . If the method fails, the return value can be .

Changing the filter type "dirties" the mipmap sublevels and causes them to be regenerated.

The (default) filter type set at texture creation time is . If the driver does not support a linear filter, the filter type will be set to . All filter types supported by the driver for regular texture filtering are supported for autogeneration except . SetAutoGenFilterType will fail unless the driver sets the appropriate D3DPTFILTERCAPS_MINFxxx caps. These values are specified in the TextureFilterCaps and/or CubeTextureFilterCaps members of . For more information about texture filter types, see .

This method has no effect if the texture is not created with . In this case, no failure is returned. For more information about usage constants, see .

bb174327 HRESULT IDirect3DBaseTexture9::SetAutoGenFilterType([In] D3DTEXTUREFILTERTYPE FilterType) IDirect3DBaseTexture9::SetAutoGenFilterType

Get the filter type that is used for automatically generated mipmap sublevels.

Filter type. See . A texture must be created with to use this method. Any other usage value will cause this method to return .

Changing the filter type "dirties" the mipmap sublevels and causes them to be regenerated.

The (default) filter type set at texture creation time is . If the driver doesn't support a linear filter, the filter type will be set to . All filter types supported by the driver for regular texture filtering are supported for autogeneration except . For each resource type, drivers should support all the filter types reported in the corresponding texture, CubeTexture, and volumetexture filter caps. For more information about texture types, see .

This method has no effect if the texture is not created with .

bb174324 D3DTEXTUREFILTERTYPE IDirect3DBaseTexture9::GetAutoGenFilterType() IDirect3DBaseTexture9::GetAutoGenFilterType

Generate mipmap sublevels.

An application can generate mipmap sublevels at any time by calling GenerateMipSubLevels. To have mipmap sublevels generated automatically at texture creation time (see Automatic Generation of Mipmaps (Direct3D 9)), specify during CreateTexture, CreateCubeTexture, and CreateVolumeTexture. For more information about usage constants, see .

bb174323 void IDirect3DBaseTexture9::GenerateMipSubLevels() IDirect3DBaseTexture9::GenerateMipSubLevels
No documentation. bb280322 D3DXBONECOMBINATION D3DXBONECOMBINATION Get the bone identifiers. No documentation. bb280322 unsigned int AttribId unsigned int AttribId No documentation. bb280322 unsigned int FaceStart unsigned int FaceStart No documentation. bb280322 unsigned int FaceCount unsigned int FaceCount No documentation. bb280322 unsigned int VertexStart unsigned int VertexStart No documentation. bb280322 unsigned int VertexCount unsigned int VertexCount No documentation. bb280322 unsigned int* BoneId unsigned int BoneId

Represents the capabilities of the hardware exposed through the Direct3D object.

The MaxTextureBlendStages and MaxSimultaneousTextures members might seem similar, but they contain different information. The MaxTextureBlendStages member contains the total number of texture-blending stages supported by the current device, and the MaxSimultaneousTextures member describes how many of those stages can have textures bound to them by using the SetTexture method.

When the driver fills this structure, it can set values for execute-buffer capabilities, even when the interface being used to retrieve the capabilities (such as ) does not support execute buffers.

In general, performance problems may occur if you use a texture and then modify it during a scene. Ensure that no texture used in the current BeginScene and EndScene block is evicted unless absolutely necessary. In the case of extremely high texture usage within a scene, the results are undefined. This occurs when you modify a texture that you have used in the scene and there is no spare texture memory available. For such systems, the contents of the z-buffer become invalid at EndScene. Applications should not call UpdateSurface to or from the back buffer on this type of hardware inside a BeginScene/EndScene pair. In addition, applications should not try to access the z-buffer if the capability flag is set. Finally, applications should not lock the back buffer or the z-buffer inside a BeginScene/EndScene pair.

The following flags concerning mipmapped textures are not supported in Direct3D 9.

  • D3DPTFILTERCAPS_LINEAR
  • D3DPTFILTERCAPS_LINEARMIPLINEAR
  • D3DPTFILTERCAPS_LINEARMIPNEAREST
  • D3DPTFILTERCAPS_MIPNEAREST
  • D3DPTFILTERCAPS_NEAREST
bb172513 D3DCAPS9 D3DCAPS9
Gets the pixel shader version. Gets the vertex shader version.

Member of the enumerated type, which identifies what type of resources are used for processing vertices.

bb172513 D3DDEVTYPE DeviceType D3DDEVTYPE DeviceType

Adapter on which this Direct3D device was created. This ordinal is valid only to pass to methods of the interface that created this Direct3D device. The interface can always be retrieved by calling GetDirect3D.

bb172513 unsigned int AdapterOrdinal unsigned int AdapterOrdinal

The following driver-specific capability.

ValueMeaning

Display hardware is capable of returning the current scan line.

The display driver supports an overlay DDI that allows for verification of overlay capabilities. For more information about the overlay DDI, see Overlay DDI.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

?

bb172513 D3DCAPS Caps D3DCAPS Caps

Driver-specific capabilities identified in .

bb172513 D3DCAPS2 Caps2 D3DCAPS2 Caps2

Driver-specific capabilities identified in .

bb172513 D3DCAPS3 Caps3 D3DCAPS3 Caps3

Bit mask of values representing what presentation swap intervals are available.

ValueMeaning

The driver supports an immediate presentation swap interval.

The driver supports a presentation swap interval of every screen refresh.

The driver supports a presentation swap interval of every second screen refresh.

The driver supports a presentation swap interval of every third screen refresh.

The driver supports a presentation swap interval of every fourth screen refresh.

?

bb172513 D3DPRESENT_INTERVAL PresentationIntervals D3DPRESENT_INTERVAL PresentationIntervals

Bit mask indicating what hardware support is available for cursors. Direct3D 9 does not define alpha-blending cursor capabilities.

ValueMeaning

A full-color cursor is supported in hardware. Specifically, this flag indicates that the driver supports at least a hardware color cursor in high-resolution modes (with scan lines greater than or equal to 400).

A full-color cursor is supported in hardware. Specifically, this flag indicates that the driver supports a hardware color cursor in both high-resolution and low-resolution modes (with scan lines less than 400).

?

bb172513 D3DCURSORCAPS CursorCaps D3DCURSORCAPS CursorCaps

Flags identifying the capabilities of the device.

ValueMeaning

Device supports blits from system-memory textures to nonlocal video-memory textures.

Device can queue rendering commands after a page flip. Applications do not change their behavior if this flag is set; this capability means that the device is relatively fast.

Device can support at least a DirectX 5-compliant driver.

Device can support at least a DirectX 7-compliant driver.

Device exports an -aware hal.

Device can use execute buffers from system memory.

Device can use execute buffers from video memory.

Device has hardware acceleration for scene rasterization.

Device can support transformation and lighting in hardware.

Device supports N patches.

Device can support rasterization, transform, lighting, and shading in hardware.

Device supports quintic B?zier curves and B-splines.

Device supports rectangular and triangular patches.

When this device capability is set, the hardware architecture does not require caching of any information, and uncached patches (handle zero) will be drawn as efficiently as cached ones. Note that setting does not mean that a patch with handle zero can be drawn. A handle-zero patch can always be drawn whether this cap is set or not.

Device is texturing from separate memory pools.

Device can retrieve textures from non-local video memory.

Device can retrieve textures from system memory.

Device can retrieve textures from device memory.

Device can use buffers from system memory for transformed and lit vertices.

Device can use buffers from video memory for transformed and lit vertices.

?

bb172513 D3DDEVCAPS DevCaps D3DDEVCAPS DevCaps

Miscellaneous driver primitive capabilities. See .

bb172513 D3DPMISCCAPS PrimitiveMiscCaps D3DPMISCCAPS PrimitiveMiscCaps

Information on raster-drawing capabilities. This member can be one or more of the following flags.

ValueMeaning

Device supports anisotropic filtering.

Device iterates colors perspective correctly.

Device can dither to improve color resolution.

Device supports legacy depth bias. For true depth bias, see .

Device supports range-based fog. In range-based fog, the distance of an object from the viewer is used to compute fog effects, not the depth of the object (that is, the z-coordinate) in the scene.

Device calculates the fog value by referring to a lookup table containing fog values that are indexed to the depth of a given pixel.

Device calculates the fog value during the lighting operation and interpolates the fog value during rasterization.

Device supports level-of-detail bias adjustments. These bias adjustments enable an application to make a mipmap appear crisper or less sharp than it normally would. For more information about level-of-detail bias in mipmaps, see .

Device supports toggling multisampling on and off between and (using ).

Device supports scissor test. See Scissor Test (Direct3D 9).

Device performs true slope-scale based depth bias. This is in contrast to the legacy style depth bias.

Device supports depth buffering using w.

Device supports w-based fog. W-based fog is used when a perspective projection matrix is specified, but affine projections still use z-based fog. The system considers a projection matrix that contains a nonzero value in the [3][4] element to be a perspective projection matrix.

Device can perform hidden-surface removal (HSR) without requiring the application to sort polygons and without requiring the allocation of a depth-buffer. This leaves more video memory for textures. The method used to perform HSR is hardware-dependent and is transparent to the application.

Z-bufferless HSR is performed if no depth-buffer surface is associated with the rendering-target surface and the depth-buffer comparison test is enabled (that is, when the state value associated with the enumeration constant is set to TRUE).

Device supports z-based fog.

Device can perform z-test operations. This effectively renders a primitive and indicates whether any z pixels have been rendered.

?

bb172513 D3DPRASTERCAPS RasterCaps D3DPRASTERCAPS RasterCaps

Z-buffer comparison capabilities. This member can be one or more of the following flags.

ValueMeaning

Always pass the z-test.

Pass the z-test if the new z equals the current z.

Pass the z-test if the new z is greater than the current z.

Pass the z-test if the new z is greater than or equal to the current z.

Pass the z-test if the new z is less than the current z.

Pass the z-test if the new z is less than or equal to the current z.

Always fail the z-test.

Pass the z-test if the new z does not equal the current z.

?

bb172513 D3DPCMPCAPS ZCmpCaps D3DPCMPCAPS ZCmpCaps

Source-blending capabilities. This member can be one or more of the following flags. (The RGBA values of the source and destination are indicated by the subscripts s and d.)

ValueMeaning

The driver supports both and . See .

Source blend factor is (1 - As, 1 - As, 1 - As, 1 - As) and destination blend factor is (As, As, As, As); the destination blend selection is overridden.

The driver supports the blend mode. (This blend mode is obsolete. For more information, see .)

Blend factor is (Ad, Ad, Ad, Ad).

Blend factor is (Rd, Gd, Bd, Ad).

Blend factor is (1 - Ad, 1 - Ad, 1 - Ad, 1 - Ad).

Blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad).

Blend factor is (1 - As, 1 - As, 1 - As, 1 - As).

Blend factor is (1 - Rs, 1 - Gs, 1 - Bs, 1 - As).

Blend factor is (1 - PSOutColor[1]r, 1 - PSOutColor[1]g, 1 - PSOutColor[1]b, not used)). See Render Target Blending.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

Blend factor is (1, 1, 1, 1).

Blend factor is (As, As, As, As).

Blend factor is (f, f, f, 1); f = min(As, 1 - Ad).

Blend factor is (Rs, Gs, Bs, As).

Blend factor is (PSOutColor[1]r, PSOutColor[1]g, PSOutColor[1]b, not used). See Render Target Blending.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

Blend factor is (0, 0, 0, 0).

?

bb172513 D3DPBLENDCAPS SrcBlendCaps D3DPBLENDCAPS SrcBlendCaps

Destination-blending capabilities. This member can be the same capabilities that are defined for the SrcBlendCaps member.

bb172513 D3DPBLENDCAPS DestBlendCaps D3DPBLENDCAPS DestBlendCaps

Alpha-test comparison capabilities. This member can include the same capability flags defined for the ZCmpCaps member. If this member contains only the capability or only the capability, the driver does not support alpha tests. Otherwise, the flags identify the individual comparisons that are supported for alpha testing.

bb172513 D3DPCMPCAPS AlphaCmpCaps D3DPCMPCAPS AlphaCmpCaps

Shading operations capabilities. It is assumed, in general, that if a device supports a given command at all, it supports the mode (as specified in the enumerated type). This flag specifies whether the driver can also support Gouraud shading and whether alpha color components are supported. When alpha components are not supported, the alpha value of colors generated is implicitly 255. This is the maximum possible alpha (that is, the alpha component is at full intensity).

The color, specular highlights, fog, and alpha interpolants of a triangle each have capability flags that an application can use to find out how they are implemented by the device driver.

This member can be one or more of the following flags.

ValueMeaning

Device can support an alpha component for Gouraud-blended transparency (the state for the enumerated type). In this mode, the alpha color component of a primitive is provided at vertices and interpolated across a face along with the other color components.

Device can support colored Gouraud shading. In this mode, the per-vertex color components (red, green, and blue) are interpolated across a triangle face.

Device can support fog in the Gouraud shading mode.

Device supports Gouraud shading of specular highlights.

?

bb172513 D3DPSHADECAPS ShadeCaps D3DPSHADECAPS ShadeCaps

Miscellaneous texture-mapping capabilities. This member can be one or more of the following flags.

ValueMeaning

Alpha in texture pixels is supported.

Device can draw alpha from texture palettes.

Supports cube textures.

Device requires that cube texture maps have dimensions specified as powers of two.

Device supports mipmapped cube textures.

Device supports mipmapped textures.

Device supports mipmapped volume textures.

is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. A device that exposes this capability can use such a texture if all of the following requirements are met.

  • The texture addressing mode for the texture stage is set to .
  • Texture wrapping for the texture stage is disabled (D3DRS_WRAP n set to 0).
  • Mipmapping is not in use (use magnification filter only).
  • Texture formats must not be through .

If this flag is not set, and is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.

A texture that is not a power of two cannot be set at a stage that will be read based on a shader computation (such as the bem - ps and texm3x3 - ps instructions in pixel shaders versions 1_0 to 1_3). For example, these textures can be used to store bumps that will be fed into texture reads, but not the environment maps that are used in texbem - ps, texbeml - ps, and texm3x3spec - ps. This means that a texture with dimensions that are not powers of two cannot be addressed or sampled using texture coordinates computed within the shader. This type of operation is known as a dependent read and cannot be performed on these types of textures.

Device does not support a projected bump-environment loopkup operation in programmable and fixed function shaders.

Perspective correction texturing is supported.

If is not set, all textures must have widths and heights specified as powers of two. This requirement does not apply to either cube textures or volume textures.

If is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. See description.

If this flag is not set, and is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.

Supports the texture transformation flag. When applied, the device divides transformed texture coordinates by the last texture coordinate. If this capability is present, then the projective divide occurs per pixel. If this capability is not present, but the projective divide needs to occur anyway, then it is performed on a per-vertex basis by the Direct3D runtime.

All textures must be square.

Texture indices are not scaled by the texture size prior to interpolation.

Device supports volume textures.

Device requires that volume texture maps have dimensions specified as powers of two.

?

bb172513 D3DPTEXTURECAPS TextureCaps D3DPTEXTURECAPS TextureCaps

Texture-filtering capabilities for a texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

bb172513 D3DPTFILTERCAPS TextureFilterCaps D3DPTFILTERCAPS TextureFilterCaps

Texture-filtering capabilities for a cube texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

bb172513 D3DPTFILTERCAPS CubeTextureFilterCaps D3DPTFILTERCAPS CubeTextureFilterCaps

Texture-filtering capabilities for a volume texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

bb172513 D3DPTFILTERCAPS VolumeTextureFilterCaps D3DPTFILTERCAPS VolumeTextureFilterCaps

Texture-addressing capabilities for texture objects. This member can be one or more of the following flags.

ValueMeaning

Device supports setting coordinates outside the range [0.0, 1.0] to the border color, as specified by the texture-stage state.

Device can clamp textures to addresses.

Device can separate the texture-addressing modes of the u and v coordinates of the texture. This ability corresponds to the and render-state values.

Device can mirror textures to addresses.

Device can take the absolute value of the texture coordinate (thus, mirroring around 0) and then clamp to the maximum value.

Device can wrap textures to addresses.

?

bb172513 D3DPTADDRESSCAPS TextureAddressCaps D3DPTADDRESSCAPS TextureAddressCaps

Texture-addressing capabilities for a volume texture. This member can be one or more of the flags defined for the TextureAddressCaps member.

bb172513 D3DPTADDRESSCAPS VolumeTextureAddressCaps D3DPTADDRESSCAPS VolumeTextureAddressCaps

Defines the capabilities for line-drawing primitives.

ValueMeaning

Supports alpha-test comparisons.

Antialiased lines are supported.

Supports source-blending.

Supports fog.

Supports texture-mapping.

Supports z-buffer comparisons.

?

bb172513 D3DLINECAPS LineCaps D3DLINECAPS LineCaps

Maximum texture width for this device.

bb172513 unsigned int MaxTextureWidth unsigned int MaxTextureWidth

Maximum texture height for this device.

bb172513 unsigned int MaxTextureHeight unsigned int MaxTextureHeight

Maximum value for any of the three dimensions (width, height, and depth) of a volume texture.

bb172513 unsigned int MaxVolumeExtent unsigned int MaxVolumeExtent

This number represents the maximum range of the integer bits of the post-normalized texture coordinates. A texture coordinate is stored as a 32-bit signed integer using 27 bits to store the integer part and 5 bits for the floating point fraction. The maximum integer index, 227, is used to determine the maximum texture coordinate, depending on how the hardware does texture-coordinate scaling.

Some hardware reports the cap . For this case, the device defers scaling texture coordinates by the texture size until after interpolation and application of the texture address mode, so the number of times a texture can be wrapped is given by the integer value in MaxTextureRepeat.

Less desirably, on some hardware is not set and the device scales the texture coordinates by the texture size (using the highest level of detail) prior to interpolation. This limits the number of times a texture can be wrapped to MaxTextureRepeat / texture size.

For example, assume that MaxTextureRepeat is equal to 32k and the size of the texture is 4k. If the hardware sets , then the number of times a texture can be wrapped is equal to MaxTextureRepeat, which is 32k in this example. Otherwise, the number of times a texture can be wrapped is equal to MaxTextureRepeat divided by texture size, which is 32k/4k in this example.

bb172513 unsigned int MaxTextureRepeat unsigned int MaxTextureRepeat

Maximum texture aspect ratio supported by the hardware, typically a power of 2.

bb172513 unsigned int MaxTextureAspectRatio unsigned int MaxTextureAspectRatio

Maximum valid value for the texture-stage state.

bb172513 unsigned int MaxAnisotropy unsigned int MaxAnisotropy

Maximum W-based depth value that the device supports.

bb172513 float MaxVertexW float MaxVertexW

Screen-space coordinate of the guard-band clipping region. Coordinates inside this rectangle but outside the viewport rectangle are automatically clipped.

bb172513 float GuardBandLeft float GuardBandLeft

Screen-space coordinate of the guard-band clipping region. Coordinates inside this rectangle but outside the viewport rectangle are automatically clipped.

bb172513 float GuardBandTop float GuardBandTop

Screen-space coordinate of the guard-band clipping region. Coordinates inside this rectangle but outside the viewport rectangle are automatically clipped.

bb172513 float GuardBandRight float GuardBandRight

Screen-space coordinate of the guard-band clipping region. Coordinates inside this rectangle but outside the viewport rectangle are automatically clipped.

bb172513 float GuardBandBottom float GuardBandBottom

Number of pixels to adjust the extents rectangle outward to accommodate antialiasing kernels.

bb172513 float ExtentsAdjust float ExtentsAdjust

Flags specifying supported stencil-buffer operations. Stencil operations are assumed to be valid for all three stencil-buffer operation render states (, , and ).

For more information, see .

bb172513 D3DSTENCILCAPS StencilCaps D3DSTENCILCAPS StencilCaps

Flexible vertex format capabilities.

ValueMeaning

It is preferable that vertex elements not be stripped. That is, if the vertex format contains elements that are not used with the current render states, there is no need to regenerate the vertices. If this capability flag is not present, stripping extraneous elements from the vertex format provides better performance.

Point size is determined by either the render state or the vertex data. If an FVF is used, point size can come from point size data in the vertex declaration. Otherwise, point size is determined by the render state . If the application provides point size in both (the render state and the vertex declaration), the vertex data overrides the render-state data.

Masks the low WORD of FVFCaps. These bits, cast to the WORD data type, describe the total number of texture coordinate sets that the device can simultaneously use for multiple texture blending. (You can use up to eight texture coordinate sets for any vertex, but the device can blend using only the specified number of texture coordinate sets.)

?

bb172513 D3DFVFCAPS FVFCaps D3DFVFCAPS FVFCaps

Combination of flags describing the texture operations supported by this device. The following flags are defined.

ValueMeaning

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

The texture-blending operation is supported.

?

bb172513 D3DTEXOPCAPS TextureOpCaps D3DTEXOPCAPS TextureOpCaps

Maximum number of texture-blending stages supported in the fixed function pipeline. This value is the number of blenders available. In the programmable pixel pipeline, this corresponds to the number of unique texture registers used by pixel shader instructions.

bb172513 unsigned int MaxTextureBlendStages unsigned int MaxTextureBlendStages

Maximum number of textures that can be simultaneously bound to the fixed-function pipeline sampler stages. If the same texture is bound to two sampler stages, it counts as two textures.

This value has no meaning in the programmable pipeline where the number of sampler stages is determined by each pixel shader version. Each pixel shader version also determines the number of texture declaration instructions. See Pixel Shaders.

bb172513 unsigned int MaxSimultaneousTextures unsigned int MaxSimultaneousTextures

Vertex processing capabilities. For a given physical device, this capability might vary across Direct3D devices depending on the parameters supplied to CreateDevice. See .

bb172513 D3DVTXPCAPS VertexProcessingCaps D3DVTXPCAPS VertexProcessingCaps

Maximum number of lights that can be active simultaneously. For a given physical device, this capability might vary across Direct3D devices depending on the parameters supplied to CreateDevice.

bb172513 unsigned int MaxActiveLights unsigned int MaxActiveLights

Maximum number of user-defined clipping planes supported. This member can be 0. For a given physical device, this capability may vary across Direct3D devices depending on the parameters supplied to CreateDevice.

bb172513 unsigned int MaxUserClipPlanes unsigned int MaxUserClipPlanes

Maximum number of matrices that this device can apply when performing multimatrix vertex blending. For a given physical device, this capability may vary across Direct3D devices depending on the parameters supplied to CreateDevice.

bb172513 unsigned int MaxVertexBlendMatrices unsigned int MaxVertexBlendMatrices

DWORD value that specifies the maximum matrix index that can be indexed into using the per-vertex indices. The number of matrices is MaxVertexBlendMatrixIndex + 1, which is the size of the matrix palette. If normals are present in the vertex data that needs to be blended for lighting, then the number of matrices is half the number specified by this capability flag. If MaxVertexBlendMatrixIndex is set to zero, the driver does not support indexed vertex blending. If this value is not zero then the valid range of indices is zero through MaxVertexBlendMatrixIndex.

A zero value for MaxVertexBlendMatrixIndex indicates that the driver does not support indexed matrices.

When software vertex processing is used, 256 matrices could be used for indexed vertex blending, with or without normal blending.

For a given physical device, this capability may vary across Direct3D devices depending on the parameters supplied to CreateDevice.

bb172513 unsigned int MaxVertexBlendMatrixIndex unsigned int MaxVertexBlendMatrixIndex

Maximum size of a point primitive. If set to 1.0f then device does not support point size control. The range is greater than or equal to 1.0f.

bb172513 float MaxPointSize float MaxPointSize

Maximum number of primitives for each DrawPrimitive call. There are two cases:

  • If MaxPrimitiveCount is not equal to 0xffff, you can draw at most MaxPrimitiveCount primitives with each draw call.
  • However, if MaxPrimitiveCount equals 0xffff, you can still draw at most MaxPrimitiveCount primitive, but you may also use no more than MaxPrimitiveCount unique vertices (since each primitive can potentially use three different vertices).
bb172513 unsigned int MaxPrimitiveCount unsigned int MaxPrimitiveCount

Maximum size of indices supported for hardware vertex processing. It is possible to create 32-bit index buffers; however, you will not be able to render with the index buffer unless this value is greater than 0x0000FFFF.

bb172513 unsigned int MaxVertexIndex unsigned int MaxVertexIndex

Maximum number of concurrent data streams for SetStreamSource. The valid range is 1 to 16. Note that if this value is 0, then the driver is not a Direct3D 9 driver.

bb172513 unsigned int MaxStreams unsigned int MaxStreams

Maximum stride for SetStreamSource.

bb172513 unsigned int MaxStreamStride unsigned int MaxStreamStride

Two numbers that represent the vertex shader main and sub versions. For more information about the instructions supported for each vertex shader version, see Version 1_x, Version 2_0, Version 2_0 Extended, or Version 3_0.

bb172513 unsigned int VertexShaderVersion unsigned int VertexShaderVersion

The number of vertex shader Vertex Shader Registers that are reserved for constants.

bb172513 unsigned int MaxVertexShaderConst unsigned int MaxVertexShaderConst

Two numbers that represent the pixel shader main and sub versions. For more information about the instructions supported for each pixel shader version, see Version 1_x, Version 2_0, Version 2_0 Extended, or Version 3_0.

bb172513 unsigned int PixelShaderVersion unsigned int PixelShaderVersion

Maximum value of pixel shader arithmetic component. This value indicates the internal range of values supported for pixel color blending operations. Within the range that they report to, implementations must allow data to pass through pixel processing unmodified (unclamped). Normally, the value of this member is an absolute value. For example, a 1.0 indicates that the range is -1.0 to 1, and an 8.0 indicates that the range is -8.0 to 8.0. The value must be >= 1.0 for any hardware that supports pixel shaders.

bb172513 float PixelShader1xMaxValue float PixelShader1xMaxValue

Device driver capabilities for adaptive tessellation. For more information, see

bb172513 D3DDEVCAPS2 DevCaps2 D3DDEVCAPS2 DevCaps2

This number indicates which device is the master for this subordinate. This number is taken from the same space as the adapter values.

For multihead support, one head will be denoted the master head, and all other heads on the same card will be denoted subordinate heads. If more than one multihead adapter is present in a system, the master and its subordinates from one multihead adapter are called a group.

bb172513 float MaxNpatchTessellationLevel float MaxNpatchTessellationLevel

This number indicates the order in which heads are referenced by the API. The value for the master adapter is always 0. These values do not correspond to the adapter ordinals. They apply only to heads within a group.

bb172513 unsigned int Reserved5 unsigned int Reserved5

This number indicates which device is the master for this subordinate. This number is taken from the same space as the adapter values.

For multihead support, one head will be denoted the master head, and all other heads on the same card will be denoted subordinate heads. If more than one multihead adapter is present in a system, the master and its subordinates from one multihead adapter are called a group.

bb172513 unsigned int MasterAdapterOrdinal unsigned int MasterAdapterOrdinal

This number indicates the order in which heads are referenced by the API. The value for the master adapter is always 0. These values do not correspond to the adapter ordinals. They apply only to heads within a group.

bb172513 unsigned int AdapterOrdinalInGroup unsigned int AdapterOrdinalInGroup

Number of adapters in this adapter group (only if master). This will be 1 for conventional adapters. The value will be greater than 1 for the master adapter of a multihead card. The value will be 0 for a subordinate adapter of a multihead card. Each card can have at most one master, but may have many subordinates.

bb172513 unsigned int NumberOfAdaptersInGroup unsigned int NumberOfAdaptersInGroup

A combination of one or more data types contained in a vertex declaration. See .

bb172513 D3DDTCAPS DeclTypes D3DDTCAPS DeclTypes

Number of simultaneous render targets. This number must be at least one.

bb172513 unsigned int NumSimultaneousRTs unsigned int NumSimultaneousRTs

Combination of constants that describe the operations supported by StretchRect. The flags that may be set in this field are:

ConstantDescription
Device supports point-sample filtering for minifying rectangles. This filter type is requested by calling StretchRect using .
Device supports point-sample filtering for magnifying rectangles. This filter type is requested by calling StretchRect using .
Device supports bilinear interpolation filtering for minifying rectangles. This filter type is requested by calling StretchRect using .
Device supports bilinear interpolation filtering for magnifying rectangles. This filter type is requested by calling StretchRect using .

?

For more information, see and .

bb172513 D3DPTFILTERCAPS StretchRectFilterCaps D3DPTFILTERCAPS StretchRectFilterCaps

Device supports vertex shader version 2_0 extended capability. See .

bb172513 D3DVSHADERCAPS2_0 VS20Caps D3DVSHADERCAPS2_0 VS20Caps

Device supports pixel shader version 2_0 extended capability. See .

bb172513 D3DPSHADERCAPS2_0 PS20Caps D3DPSHADERCAPS2_0 PS20Caps

Device supports vertex shader texture filter capability. See .

bb172513 D3DPTFILTERCAPS VertexTextureFilterCaps D3DPTFILTERCAPS VertexTextureFilterCaps

Maximum number of vertex shader instructions that can be run when using flow control. The maximum number of instructions that can be programmed is MaxVertexShader30InstructionSlots.

bb172513 unsigned int MaxVShaderInstructionsExecuted unsigned int MaxVShaderInstructionsExecuted

Maximum number of pixel shader instructions that can be run when using flow control. The maximum number of instructions that can be programmed is MaxPixelShader30InstructionSlots.

bb172513 unsigned int MaxPShaderInstructionsExecuted unsigned int MaxPShaderInstructionsExecuted

Maximum number of vertex shader instruction slots supported. The maximum value that can be set on this cap is 32768. Devices that support vs_3_0 are required to support at least 512 instruction slots.

bb172513 unsigned int MaxVertexShader30InstructionSlots unsigned int MaxVertexShader30InstructionSlots

Maximum number of pixel shader instruction slots supported. The maximum value that can be set on this cap is 32768. Devices that support ps_3_0 are required to support at least 512 instruction slots.

bb172513 unsigned int MaxPixelShader30InstructionSlots unsigned int MaxPixelShader30InstructionSlots
Shader compilation results. Initializes a new instance of the class. The bytecode. The result code. The message. Performs an implicit conversion from to . The input. The result of the conversion.

The interface is used to access the constant table. This table contains the variables that are used by high-level language shaders and effects.

The LPD3DXCONSTANTTABLE type is defined as a reference to the interface.

 typedef interface  ;	
            typedef interface  *LPD3DXCONSTANTTABLE;	
            
bb205762 ID3DXConstantTable ID3DXConstantTable
Gets the buffer. Gets a single constant description in the constant table. The effect handle. The constant description HRESULT ID3DXConstantTable::GetConstantDesc([In] D3DXHANDLE hConstant,[Out, Buffer] D3DXCONSTANT_DESC* pConstantDesc,[InOut] unsigned int* pCount) Gets an array of constant descriptions in the constant table. The effect handle. An array of constant descriptions HRESULT ID3DXConstantTable::GetConstantDesc([In] D3DXHANDLE hConstant,[Out, Buffer] D3DXCONSTANT_DESC* pConstantDesc,[InOut] unsigned int* pCount) Sets a bool value. The device. The effect handle. The value. A object describing the result of the operation. HRESULT ID3DXConstantTable::SetBool([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] BOOL b) Sets a float value. The device. The effect handle. The value. A object describing the result of the operation. HRESULT ID3DXConstantTable::SetFloat([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] float f) Sets an int value. The device. The effect handle. The value. A object describing the result of the operation. HRESULT ID3DXConstantTable::SetInt([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] int n) Sets a matrix. The device. The effect handle. The value. A object describing the result of the operation. HRESULT ID3DXConstantTable::SetMatrix([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const D3DXMATRIX* pMatrix) Sets a 4D vector. The device. The effect handle. The value. A object describing the result of the operation. HRESULT ID3DXConstantTable::SetVector([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const D3DXVECTOR4* pVector) Sets a typed value. Type of the value to set The device. The effect handle. The value. A object describing the result of the operation. HRESULT ID3DXConstantTable::SetValue([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const void* pData,[In] unsigned int Bytes) Sets an array of bools. The device. The effect handle. The values. A object describing the result of the operation. HRESULT ID3DXConstantTable::SetBoolArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const BOOL* pb,[In] unsigned int Count) Sets an array of floats. The device. The effect handle. The values. A object describing the result of the operation. HRESULT ID3DXConstantTable::SetFloatArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const float* pf,[In] unsigned int Count) Sets an array of ints. The device. The effect handle. The values. A object describing the result of the operation. HRESULT ID3DXConstantTable::SetIntArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const int* pn,[In] unsigned int Count) Sets an array of matrices. The device. The effect handle. The values. A object describing the result of the operation. HRESULT ID3DXConstantTable::SetMatrixArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const D3DXMATRIX* pMatrix,[In] unsigned int Count) Sets an array of 4D vectors. The device. The effect handle. The values. A object describing the result of the operation. HRESULT ID3DXConstantTable::SetVectorArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const D3DXVECTOR4* pVector,[In] unsigned int Count) Sets an array of elements. Type of the array element The device. The effect handle. The values. A object describing the result of the operation. HRESULT ID3DXConstantTable::SetValue([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const void* pData,[In] unsigned int Bytes) Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets a reference to the buffer that contains the constant table.

bb205763 GetBufferPointer GetBufferPointer void* ID3DXConstantTable::GetBufferPointer()

Gets the buffer size of the constant table.

bb205764 GetBufferSize GetBufferSize unsigned int ID3DXConstantTable::GetBufferSize()

Gets a description of the constant table.

bb205769 GetDesc GetDesc HRESULT ID3DXConstantTable::GetDesc([Out] D3DXCONSTANTTABLE_DESC* pDesc)

Gets a reference to the buffer that contains the constant table.

Returns a reference the buffer.

bb205763 void* ID3DXConstantTable::GetBufferPointer() ID3DXConstantTable::GetBufferPointer

Gets the buffer size of the constant table.

Returns the size of the buffer, in bytes.

bb205764 unsigned int ID3DXConstantTable::GetBufferSize() ID3DXConstantTable::GetBufferSize

Gets a description of the constant table.

Description of the constant table. See .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

bb205769 HRESULT ID3DXConstantTable::GetDesc([Out] D3DXCONSTANTTABLE_DESC* pDesc) ID3DXConstantTable::GetDesc

Gets a reference to an array of constant descriptions in the constant table.

Unique identifier to a constant. See .

Returns a reference to an array of descriptions. See .

The input supplied must be the maximum size of the array. The output is the number of elements that are filled in the array when the function returns.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

will sometimes return a with a Register_Count of 0. This will happen with a constant appears in more than one Register_Set but does not have space in that register set allocated.

Because a sampler can appear more than once in a constant table, this method can return an array of descriptions, each one with a different register index.

bb205767 HRESULT ID3DXConstantTable::GetConstantDesc([In] D3DXHANDLE hConstant,[Out, Buffer] D3DXCONSTANT_DESC* pConstantDesc,[InOut] unsigned int* pCount) ID3DXConstantTable::GetConstantDesc

Returns the sampler index.

The sampler handle.

Returns the sampler index number from the constant table.

bb205770 unsigned int ID3DXConstantTable::GetSamplerIndex([In] D3DXHANDLE hConstant) ID3DXConstantTable::GetSamplerIndex

Gets a constant by looking up its index.

Unique identifier to the parent data structure. If the constant is a top-level parameter (there is no parent data structure), use null.

Zero-based index of the constant.

Returns a unique identifier to the constant.

To get a constant from an array of constants, use .

bb205765 D3DXHANDLE ID3DXConstantTable::GetConstant([In] D3DXHANDLE hConstant,[In] unsigned int Index) ID3DXConstantTable::GetConstant

Gets a constant by looking up its name.

Unique identifier to the parent data structure. If the constant is a top-level parameter (there is no parent data structure), use null.

Name of the constant.

Returns a unique identifier to the constant.

bb205766 D3DXHANDLE ID3DXConstantTable::GetConstantByName([In] D3DXHANDLE hConstant,[In] const char* pName) ID3DXConstantTable::GetConstantByName

Gets a constant from an array of constants. An array is made up of elements.

Unique identifier to the array of constants. This value may not be null.

Zero-based index of the element in the array.

Returns a unique identifier to the element constant.

To get a constant that is not part of an array, use or .

bb205768 D3DXHANDLE ID3DXConstantTable::GetConstantElement([In] D3DXHANDLE hConstant,[In] unsigned int Index) ID3DXConstantTable::GetConstantElement

Sets the constants to their default values. The default values are declared in the variable declarations in the shader.

Pointer to an interface, representing the device associated with the constant table.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205773 HRESULT ID3DXConstantTable::SetDefaults([In] IDirect3DDevice9* pDevice) ID3DXConstantTable::SetDefaults

Sets the contents of the buffer to the constant table.

Pointer to an interface, representing the device associated with the constant table.

Unique identifier to a constant. See .

Buffer containing data.

Size of the buffer, in bytes.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205785 HRESULT ID3DXConstantTable::SetValue([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const void* pData,[In] unsigned int Bytes) ID3DXConstantTable::SetValue

Sets a Boolean value.

Pointer to an interface, representing the device associated with the constant table.

Unique identifier to the constant. See .

Boolean value.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205771 HRESULT ID3DXConstantTable::SetBool([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] BOOL b) ID3DXConstantTable::SetBool

Sets an array of Boolean values.

Pointer to an interface, representing the device associated with the constant table.

Unique identifier to the array of constants. See .

Array of Boolean values.

Number of Boolean values in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205772 HRESULT ID3DXConstantTable::SetBoolArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const BOOL* pb,[In] unsigned int Count) ID3DXConstantTable::SetBoolArray

Sets an integer value.

Pointer to an interface, representing the device associated with the constant table.

Unique identifier to the constant. See .

Integer.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205776 HRESULT ID3DXConstantTable::SetInt([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] int n) ID3DXConstantTable::SetInt

Sets an array of integers.

Pointer to an interface, representing the device associated with the constant table.

Unique identifier to the array of constants. See .

Array of integers.

Number of integers in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205778 HRESULT ID3DXConstantTable::SetIntArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const int* pn,[In] unsigned int Count) ID3DXConstantTable::SetIntArray

Sets a floating-point number.

Pointer to an interface, representing the device associated with the constant table.

Unique identifier to the constant. See .

Floating-point number.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205774 HRESULT ID3DXConstantTable::SetFloat([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] float f) ID3DXConstantTable::SetFloat

Sets an array of floating-point numbers.

Pointer to an interface, representing the device associated with the constant table.

Unique identifier to the array of constants. See .

Array of floating-point numbers.

Number of floating-point values in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205775 HRESULT ID3DXConstantTable::SetFloatArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const float* pf,[In] unsigned int Count) ID3DXConstantTable::SetFloatArray

Sets a 4D vector.

Pointer to an interface, representing the device associated with the constant table.

Unique identifier to the vector constant. See .

Pointer to a 4D vector.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205786 HRESULT ID3DXConstantTable::SetVector([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const D3DXVECTOR4* pVector) ID3DXConstantTable::SetVector

Sets an array of 4D vectors.

Pointer to an interface, representing the device associated with the constant table.

Unique identifier to the array of vector constants. See .

Array of 4D vectors.

Number of vectors in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205787 HRESULT ID3DXConstantTable::SetVectorArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const D3DXVECTOR4* pVector,[In] unsigned int Count) ID3DXConstantTable::SetVectorArray

Sets a nontransposed matrix.

Pointer to an interface, representing the device associated with the constant table.

Unique identifier to the matrix of constants. See .

Pointer to a nontransposed matrix. See .

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205779 HRESULT ID3DXConstantTable::SetMatrix([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const D3DXMATRIX* pMatrix) ID3DXConstantTable::SetMatrix

Sets an array of nontransposed matrices.

Pointer to an interface, representing the device associated with the constant table.

Unique identifier to the array of constant matrices. See .

Array of nontransposed matrices. See .

Number of matrices in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205780 HRESULT ID3DXConstantTable::SetMatrixArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const D3DXMATRIX* pMatrix,[In] unsigned int Count) ID3DXConstantTable::SetMatrixArray

Sets an array of references to nontransposed matrices.

Pointer to an interface, representing the device associated with the constant table.

Unique identifier to an array of constant matrices. See .

Array of references to nontransposed matrices. See .

Number of matrices in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

A nontransposed matrix contains row-major data; that is, each vector is contained in a row.

bb205781 HRESULT ID3DXConstantTable::SetMatrixPointerArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const D3DXMATRIX** ppMatrix,[In] unsigned int Count) ID3DXConstantTable::SetMatrixPointerArray

Sets a transposed matrix.

Pointer to an interface, representing the device associated with the constant table.

Unique identifier to the matrix of constants. See .

Pointer to a transposed matrix. See .

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205782 HRESULT ID3DXConstantTable::SetMatrixTranspose([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const D3DXMATRIX* pMatrix) ID3DXConstantTable::SetMatrixTranspose

Sets an array of transposed matrices.

Pointer to an interface, representing the device associated with the constant table.

Unique identifier to the array of matrix constants. See .

Array of transposed matrices. See .

Number of matrices in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205783 HRESULT ID3DXConstantTable::SetMatrixTransposeArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In, Buffer] const D3DXMATRIX* pMatrix,[In] unsigned int Count) ID3DXConstantTable::SetMatrixTransposeArray

Sets an array of references to transposed matrices.

Pointer to an interface, representing the device associated with the constant table.

Unique identifier to the array of matrix constants. See .

Array of references to transposed matrices. See .

Number of matrices in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

A transposed matrix contains column-major data; that is, each vector is contained in a column.

bb205784 HRESULT ID3DXConstantTable::SetMatrixTransposePointerArray([In] IDirect3DDevice9* pDevice,[In] D3DXHANDLE hConstant,[In] const D3DXMATRIX** ppMatrix,[In] unsigned int Count) ID3DXConstantTable::SetMatrixTransposePointerArray

Applications use the methods of the interface to manipulate a cube texture resource.

The interface can be obtained by calling the method or one of the xxx functions.

This interface inherits additional functionality from the interface.

This interface, like all COM interfaces, inherits additional functionality from the interface.

The LPDIRECT3DCUBETEXTURE9 and PDIRECT3DCubeTexture9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DCUBETEXTURE9, *PDIRECT3DCubeTexture9;	
            
bb174329 IDirect3DCubeTexture9 IDirect3DCubeTexture9
Initializes a new instance of the class. The device. Length of the edge. The level count. The usage. The format. The pool. Initializes a new instance of the class. The device. Length of the edge. The level count. The usage. The format. The pool. The shared handle. Checks texture-creation parameters. Device associated with the texture. Requested size of the texture. Null if Requested number of mipmap levels for the texture. The requested usage for the texture. Requested format for the texture. Memory class where the resource will be placed. A value type containing the proposed values to pass to the texture creation functions. HRESULT D3DXCheckCubeTextureRequirements([In] IDirect3DDevice9* pDevice,[InOut] unsigned int* pSize,[InOut] unsigned int* pNumMipLevels,[In] unsigned int Usage,[InOut] D3DFORMAT* pFormat,[In] D3DPOOL Pool) Uses a user-provided function to fill each texel of each mip level of a given cube texture. A function that is used to fill the texture. A object describing the result of the operation. Uses a compiled high-level shader language (HLSL) function to fill each texel of each mipmap level of a texture. A texture shader object that is used to fill the texture. A object describing the result of the operation. Locks a rectangle on a cube texture resource. Type of the face. The level. The flags. A describing the region locked. HRESULT IDirect3DCubeTexture9::LockRect([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level,[In] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) Locks a rectangle on a cube texture resource. Type of the face. The level. The flags. The stream pointing to the locked region. A describing the region locked. HRESULT IDirect3DCubeTexture9::LockRect([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level,[In] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) Locks a rectangle on a cube texture resource. Type of the face. The level. The rectangle. The flags. A describing the region locked. HRESULT IDirect3DCubeTexture9::LockRect([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level,[In] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) Locks a rectangle on a cube texture resource. Type of the face. The level. The rectangle. The flags. The stream pointing to the locked region. A describing the region locked. HRESULT IDirect3DCubeTexture9::LockRect([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level,[In] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) Adds a dirty region to a cube texture resource. Type of the face. A object describing the result of the operation. HRESULT IDirect3DCubeTexture9::AddDirtyRect([In] D3DCUBEMAP_FACES FaceType,[In] const void* pDirtyRect) Adds a dirty region to a cube texture resource. Type of the face. The dirty rect ref. A object describing the result of the operation. HRESULT IDirect3DCubeTexture9::AddDirtyRect([In] D3DCUBEMAP_FACES FaceType,[In] const void* pDirtyRect) Creates a from a file The device. The filename. A HRESULT D3DXCreateCubeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a file The device. The filename. The usage. The pool. A HRESULT D3DXCreateCubeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a file The device. The filename. The size. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. A HRESULT D3DXCreateCubeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a file The device. The filename. The size. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. A HRESULT D3DXCreateCubeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a file The device. The filename. The size. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateCubeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a memory buffer. The device. The buffer. A HRESULT D3DXCreateCubeTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a memory buffer. The device. The buffer. The usage. The pool. A HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a memory buffer. The device. The buffer. The size. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. A HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a memory buffer. The device. The buffer. The size. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. A HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a memory buffer. The device. The buffer. The size. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a stream. The device. The stream. A HRESULT D3DXCreateCubeTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a stream. The device. The stream. The usage. The pool. A HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a stream. The device. The stream. The size. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. A HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a stream. The device. The stream. The size bytes. The size. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. A HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a stream. The device. The stream. The size bytes. The size. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. A HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a stream. The device. The stream. The size bytes. The size. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a stream. The device. The buffer. The size. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a stream. The device. The stream. The size bytes. The size. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a stream. The device. The pointer. The size in bytes. The size. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Creates a from a stream. The device. Name of the file. The size. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves a description of one face of the specified cube texture level.

Specifies a level of a mipmapped cube texture.

Pointer to a structure, describing one face of the specified cube texture level.

The structure contains Width and Height members, which describe the size of one face in the cube. To get the size of the entire cube, multiply six (the number of cube faces) by the product of Width and Height.

bb174332 HRESULT IDirect3DCubeTexture9::GetLevelDesc([In] unsigned int Level,[Out] D3DSURFACE_DESC* pDesc) IDirect3DCubeTexture9::GetLevelDesc

Retrieves a cube texture map surface.

Member of the enumerated type, identifying a cube map face.

Specifies a level of a mipmapped cube texture.

Address of a reference to an interface, representing the returned cube texture map surface.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb174331 HRESULT IDirect3DCubeTexture9::GetCubeMapSurface([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level,[Out] IDirect3DSurface9** ppCubeMapSurface) IDirect3DCubeTexture9::GetCubeMapSurface

Locks a rectangle on a cube texture resource.

Member of the enumerated type, identifying a cube map face.

Specifies a level of a mipmapped cube texture.

Pointer to a structure, describing the region to lock.

Pointer to a rectangle to lock. Specified by a reference to a structure. Specifying null for this parameter expands the dirty region to cover the entire cube texture.

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

You may not specify a subrect when using . For a description of the flags, see .

If the method succeeds, the return value is . is returned if one or more of the arguments is invalid.

For performance reasons, dirty regions are only recorded for level zero of a texture. Dirty regions are automatically recorded when is called without or . See for more information.

Cube textures created with are not lockable. Cube textures created in video memory are lockable when created with USAGE_DYNAMIC.

The only lockable format for a depth-stencil texture is .

bb174334 HRESULT IDirect3DCubeTexture9::LockRect([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level,[Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) IDirect3DCubeTexture9::LockRect

Unlocks a rectangle on a cube texture resource.

Member of the enumerated type, identifying a cube map face.

Specifies a level of a mipmapped cube texture.

If the method succeeds, the return value is . If the method fails, the return value can be: .

bb174335 HRESULT IDirect3DCubeTexture9::UnlockRect([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level) IDirect3DCubeTexture9::UnlockRect

Adds a dirty region to a cube texture resource.

Member of the enumerated type, identifying the cube map face.

Pointer to a structure, specifying the dirty region. Specifying null expands the dirty region to cover the entire cube texture.

If the method succeeds, the return value is . If the method fails, the return value can be: .

For performance reasons, dirty regions are only recorded for level zero of a texture. For sublevels, it is assumed that the corresponding (scaled) rectangle or box is also dirty. Dirty regions are automatically recorded when is called without or . The destination surface of is also marked dirty automatically.

Using and explicitly specifying dirty regions can be used to increase the efficiency of . Using this method, applications can optimize what subset of a resource is copied by specifying dirty regions on the resource. However, the dirty regions may be expanded to optimize alignment.

bb174330 HRESULT IDirect3DCubeTexture9::AddDirtyRect([In] D3DCUBEMAP_FACES FaceType,[In] const void* pDirtyRect) IDirect3DCubeTexture9::AddDirtyRect
A Cube Texture requirement. The corrected size of the texture, in pixels. The corrected surface format. The corrected mip level count. D3DX constants and methods The value used to signify that the default value for a parameter should be used. D3DX_DEFAULT The default value for non power-of-two textures. D3DX_DEFAULT_NONPOW2 Indicates that the method should format from file. D3DFMT_FROM_FILE Indicates that the method should load from file. D3DX_FROM_FILE Checks the D3DX runtime version against this compiled version. True if version are compatible BOOL D3DXCheckVersion([In] unsigned int D3DSdkVersion,[In] unsigned int D3DXSdkVersion) Get and set debug mute mode. if set to true [mute]. Return the debug mute mode BOOL D3DXDebugMute([In] BOOL Mute) Converts a declarator from a flexible vertex format (FVF) code. Combination of that describes the FVF from which to generate the returned declarator array.. A declarator from a flexible vertex format (FVF) code. HRESULT D3DXDeclaratorFromFVF([In] D3DFVF FVF,[In, Buffer] D3DVERTEXELEMENT9* pDeclarator) Converts a flexible vertex format (FVF) code from a declarator. The declarator array. A that describes the vertex format returned from the declarator. HRESULT D3DXFVFFromDeclarator([In, Buffer] const D3DVERTEXELEMENT9* pDeclarator,[Out] D3DFVF* pFVF) Generates an output vertex declaration from the input declaration. The output declaration is intended for use by the mesh tessellation functions. The input declaration. The output declaration HRESULT D3DXGenerateOutputDecl([In, Buffer] D3DVERTEXELEMENT9* pOutput,[In, Buffer] const D3DVERTEXELEMENT9* pInput) Gets the number of elements in the vertex declaration. The declaration. The number of elements in the vertex declaration. unsigned int D3DXGetDeclLength([In, Buffer] const D3DVERTEXELEMENT9* pDecl) Gets the size of a vertex from the vertex declaration. The elements. The stream. The vertex declaration size, in bytes. unsigned int D3DXGetDeclVertexSize([In, Buffer] const D3DVERTEXELEMENT9* pDecl,[In] unsigned int Stream) Returns the size of a vertex for a flexible vertex format (FVF). The vertex format. The FVF vertex size, in bytes. unsigned int D3DXGetFVFVertexSize([In] D3DFVF FVF) Gets the size of the rectangle patch. The segment count. The triangle count. The vertex count. A object describing the result of the operation. HRESULT D3DXRectPatchSize([In] const float* pfNumSegs,[In] unsigned int* pdwTriangles,[In] unsigned int* pdwVertices) Gets the size of the triangle patch. The segment count. The triangle count. The vertex count. A object describing the result of the operation. HRESULT D3DXTriPatchSize([In] const float* pfNumSegs,[In] unsigned int* pdwTriangles,[In] unsigned int* pdwVertices) Gets an array of from a . The stream. The vertex count. The format. An array of Gets an array of from a . The stream. The vertex count. The stride. An array of Creates a FOURCC Format code from bytes description. The c1. The c2. The c3. The c4. A Format FourCC MAKEFOURCC Generates an optimized face remapping for a triangle list. The indices. The face count. The vertex count. The original mesh face that was split to generate the current face. HRESULT D3DXOptimizeFaces([In] const void* pbIndices,[In] unsigned int cFaces,[In] unsigned int cVertices,[In] BOOL b32BitIndices,[In, Buffer] int* pFaceRemap) Generates an optimized vertex remapping for a triangle list. This function is commonly used after applying the face remapping generated by D3DXOptimizeFaces. The indices. The face count. The vertex count. The original mesh face that was split to generate the current face. HRESULT D3DXOptimizeFaces([In] const void* pbIndices,[In] unsigned int cFaces,[In] unsigned int cVertices,[In] BOOL b32BitIndices,[In, Buffer] int* pFaceRemap) Generates an optimized vertex remapping for a triangle list. This function is commonly used after applying the face remapping generated by . The indices. The face count. The vertex count. A buffer that will contain the new index for each vertex. The value stored in pVertexRemap for a given element is the source vertex location in the new vertex ordering. HRESULT D3DXOptimizeVertices([In] const void* pbIndices,[In] unsigned int cFaces,[In] unsigned int cVertices,[In] BOOL b32BitIndices,[In, Buffer] int* pVertexRemap) Generates an optimized vertex remapping for a triangle list. This function is commonly used after applying the face remapping generated by . The indices. The face count. The vertex count. A buffer that will contain the new index for each vertex. The value stored in pVertexRemap for a given element is the source vertex location in the new vertex ordering. HRESULT D3DXOptimizeVertices([In] const void* pbIndices,[In] unsigned int cFaces,[In] unsigned int cVertices,[In] BOOL b32BitIndices,[In, Buffer] int* pVertexRemap)

Applications use the methods of the interface to perform DrawPrimitive-based rendering, create resources, work with system-level variables, adjust gamma ramp levels, work with palettes, and create shaders.

The interface is obtained by calling the method.

This interface, like all COM interfaces, inherits the interface methods.

The LPDIRECT3DDEVICE9 and PDIRECT3DDEVICE9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DDEVICE9, *PDIRECT3DDEVICE9;	
            
bb174336 IDirect3DDevice9 IDirect3DDevice9
Creates a device to represent the display adapter. This method returns a fully working device interface, set to the required display mode (or windowed), and allocated with the appropriate back buffers. To begin rendering, the application needs only to create and set a depth buffer (assuming EnableAutoDepthStencil is FALSE in ). When you create a Direct3D device, you supply two different window parameters: a focus window (hFocusWindow) and a device window (the hDeviceWindow in ). The purpose of each window is: The focus window alerts Direct3D when an application switches from foreground mode to background mode (via Alt-Tab, a mouse click, or some other method). A single focus window is shared by each device created by an application. The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back buffer contents are copied to the front buffer during {{Present}}. This method should not be run during the handling of WM_CREATE. An application should never pass a window handle to Direct3D while handling WM_CREATE. Any call to create, release, or reset the device must be done using the same thread as the window procedure of the focus window. Note that D3DCREATE_HARDWARE_VERTEXPROCESSING, D3DCREATE_MIXED_VERTEXPROCESSING, and D3DCREATE_SOFTWARE_VERTEXPROCESSING are mutually exclusive flags, and at least one of these vertex processing flags must be specified when calling this method. Back buffers created as part of the device are only lockable if D3DPRESENTFLAG_LOCKABLE_BACKBUFFER is specified in the presentation parameters. (Multisampled back buffers and depth surfaces are never lockable.) The methods {{Reset}}, , and {{TestCooperativeLevel}} must be called from the same thread that used this method to create a device. D3DFMT_UNKNOWN can be specified for the windowed mode back buffer format when calling CreateDevice, {{Reset}}, and {{CreateAdditionalSwapChain}}. This means the application does not have to query the current desktop format before calling CreateDevice for windowed mode. For full-screen mode, the back buffer format must be specified. If you attempt to create a device on a 0x0 sized window, CreateDevice will fail. an instance of Ordinal number that denotes the display adapter. {{D3DADAPTER_DEFAULT}} is always the primary display adapter. Member of the enumerated type that denotes the desired device type. If the desired device type is not available, the method will fail. The focus window alerts Direct3D when an application switches from foreground mode to background mode. See Remarks. For full-screen mode, the window specified must be a top-level window. For windowed mode, this parameter may be NULL only if the hDeviceWindow member of pPresentationParameters is set to a valid, non-NULL value. Combination of one or more options that control device creation. For more information, see {{D3DCREATE}}. Pointer to a structure, describing the presentation parameters for the device to be created. If BehaviorFlags specifies {{D3DCREATE_ADAPTERGROUP_DEVICE}}, pPresentationParameters is an array. Regardless of the number of heads that exist, only one depth/stencil surface is automatically created. For Windows 2000 and Windows XP, the full-screen device display refresh rate is set in the following order: User-specified nonzero ForcedRefreshRate registry key, if supported by the device. Application-specified nonzero refresh rate value in the presentation parameter. Refresh rate of the latest desktop mode, if supported by the device. 75 hertz if supported by the device. 60 hertz if supported by the device. Device default. An unsupported refresh rate will default to the closest supported refresh rate below it. For example, if the application specifies 63 hertz, 60 hertz will be used. There are no supported refresh rates below 57 hertz. pPresentationParameters is both an input and an output parameter. Calling this method may change several members including: If BackBufferCount, BackBufferWidth, and BackBufferHeight are 0 before the method is called, they will be changed when the method returns. If BackBufferFormat equals before the method is called, it will be changed when the method returns. If the method succeeds, the return value is D3D_OK. If the method fails, the return value can be one of the following: D3DERR_DEVICELOST, D3DERR_INVALIDCALL, D3DERR_NOTAVAILABLE, D3DERR_OUTOFVIDEOMEMORY. HRESULT CreateDevice([None] UINT Adapter,[None] D3DDEVTYPE DeviceType,[None] HWND hFocusWindow,[None] int BehaviorFlags,[None] D3DPRESENT_PARAMETERS* pPresentationParameters,[None] IDirect3DDevice9** ppReturnedDeviceInterface) Gets the available texture memory. Gets the driver level. Gets the pixel shader profile. Gets the vertex shader profile. Clears one or more surfaces such as a render target, a stencil buffer, and a depth buffer. Flags that specify which surfaces will be cleared. The color that will be used to fill the cleared render target. The value that will be used to fill the cleared depth buffer. The value that will be used to fill the cleared stencil buffer. A object describing the result of the operation. HRESULT IDirect3DDevice9::Clear([None] int Count,[In, Buffer, Optional] const D3DRECT* pRects,[None] int Flags,[None] D3DCOLOR Color,[None] float Z,[None] int Stencil) Clears one or more surfaces such as a render target, a stencil buffer, and a depth buffer. Flags that specify which surfaces will be cleared. The color that will be used to fill the cleared render target. The value that will be used to fill the cleared depth buffer. The value that will be used to fill the cleared stencil buffer. The areas on the surfaces that will be cleared. A object describing the result of the operation. HRESULT IDirect3DDevice9::Clear([None] int Count,[In, Buffer, Optional] const D3DRECT* pRects,[None] int Flags,[None] D3DCOLOR Color,[None] float Z,[None] int Stencil) Allows an application to fill a rectangular area of a D3DPOOL_DEFAULT surface with a specified color. This method can only be applied to a render target, a render-target texture surface, or an off-screen plain surface with a pool type of D3DPOOL_DEFAULT. IDirect3DDevice9::ColorFill will work with all formats. However, when using a reference or software device, the only formats supported are D3DFMT_X1R5G5B5, D3DFMT_A1R5G5B5, D3DFMT_R5G6B5, D3DFMT_X8R8G8B8, D3DFMT_A8R8G8B8, D3DFMT_YUY2, D3DFMT_G8R8_G8B8, D3DFMT_UYVY, D3DFMT_R8G8_B8G8, D3DFMT_R16F, D3DFMT_G16R16F, D3DFMT_A16B16G16R16F, D3DFMT_R32F, D3DFMT_G32R32F, and D3DFMT_A32B32G32R32F. When using a DirectX 7 or DirectX 8.x driver, the only YUV formats supported are D3DFMT_UYVY and D3DFMT_YUY2. Pointer to the surface to be filled. Color used for filling. A object describing the result of the operation. HRESULT IDirect3DDevice9::ColorFill([None] IDirect3DSurface9* pSurface,[In, Optional] const RECT* pRect,[None] D3DCOLOR color) Draws the indexed user primitives. Type of the primitive. Minimum index of the vertex. The vertex count. The primitive count. The index data. The index data format. The vertex data. The vertex stride. A object describing the result of the operation. Draws the indexed user primitives. Type of the primitive. The start index. Minimum index of the vertex. The vertex count. The primitive count. The index data. The index data format. The vertex data. A object describing the result of the operation. Draws the indexed user primitives. Type of the primitive. The start index. The start vertex. Minimum index of the vertex. The vertex count. The primitive count. The index data. The index data format. The vertex data. A object describing the result of the operation. Draws the rectangle patch. The handle. The segment counts. A object describing the result of the operation. HRESULT IDirect3DDevice9::DrawRectPatch([In] unsigned int Handle,[In, Buffer] const float* pNumSegs,[In] const void* pRectPatchInfo) Draws the rectangle patch. The handle. The segment counts. The info. A object describing the result of the operation. IDirect3DDevice9::DrawRectPatch Draws the triangle patch. The handle. The segment counts. A object describing the result of the operation. HRESULT IDirect3DDevice9::DrawTriPatch([In] unsigned int Handle,[In, Buffer] const float* pNumSegs,[In] const void* pTriPatchInfo) Draws the triangle patch. The handle. The segment counts. The info. A object describing the result of the operation. Draws the user primitives. Type of the primitive. The primitive count. The data. A object describing the result of the operation. Draws the user primitives. Type of the primitive. The start index. The primitive count. The data. A object describing the result of the operation. Gets the back buffer. The swap chain. The back buffer. A object describing the result of the operation. Gets the palette entries. The palette number. An array of Gets the pixel shader boolean constant. The start register. The count. An array of boolean constants Gets the pixel shader float constant. The start register. The count. An array of float constants Gets the pixel shader integer constant. The start register. The count. An array of int constants Gets the state of the render. The state. The render state value HRESULT IDirect3DDevice9::GetRenderState([In] D3DRENDERSTATETYPE State,[In] void* pValue) Gets the state of the render. Type of the state value. The state. The render state value HRESULT IDirect3DDevice9::GetRenderState([In] D3DRENDERSTATETYPE State,[In] void* pValue) Gets the state of the sampler. The sampler. The state. The sampler state value HRESULT IDirect3DDevice9::GetSamplerState([In] unsigned int Sampler,[In] D3DSAMPLERSTATETYPE Type,[In] void* pValue) Gets the state of the sampler. Type of the sampler state value The sampler. The state. The sampler state value HRESULT IDirect3DDevice9::GetSamplerState([In] unsigned int Sampler,[In] D3DSAMPLERSTATETYPE Type,[In] void* pValue) Gets the state of the texture stage. The stage. The type. The texture stage state. HRESULT IDirect3DDevice9::GetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] void* pValue) Gets the state of the texture stage. Type of the texture stage state The stage. The type. The texture stage state. HRESULT IDirect3DDevice9::GetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] void* pValue) Gets the vertex shader boolean constant. The start register. The count. An array of boolean constants HRESULT IDirect3DDevice9::GetVertexShaderConstantB([In] unsigned int StartRegister,[In] void* pConstantData,[In] unsigned int BoolCount) Gets the vertex shader float constant. The start register. The count. An array of float constants HRESULT IDirect3DDevice9::GetVertexShaderConstantF([In] unsigned int StartRegister,[In, Buffer] float* pConstantData,[In] unsigned int Vector4fCount) Gets the vertex shader integer constant. The start register. The count. An array of int constants HRESULT IDirect3DDevice9::GetVertexShaderConstantI([In] unsigned int StartRegister,[Out] int* pConstantData,[In] unsigned int Vector4iCount) Sets the cursor position. The point. if set to true [flags]. void IDirect3DDevice9::SetCursorPosition([In] int X,[In] int Y,[In] unsigned int Flags) Sets the cursor position. The x. The y. if set to true [flags]. void IDirect3DDevice9::SetCursorPosition([In] int X,[In] int Y,[In] unsigned int Flags) Sets the cursor properties. The point. The cursor bitmap ref. HRESULT IDirect3DDevice9::SetCursorProperties([In] unsigned int XHotSpot,[In] unsigned int YHotSpot,[In] IDirect3DSurface9* pCursorBitmap) Sets the gamma ramp. The swap chain. The ramp ref. if set to true [calibrate]. void IDirect3DDevice9::SetGammaRamp([In] unsigned int iSwapChain,[In] unsigned int Flags,[In] const D3DGAMMARAMP* pRamp) Presents the contents of the next buffer in the sequence of back buffers to the screen. A object describing the result of the operation. IDirect3DDevice9::Present Presents the contents of the next buffer in the sequence of back buffers to the screen. The area of the back buffer that should be presented. The area of the front buffer that should receive the result of the presentation. A object describing the result of the operation. IDirect3DDevice9::Present Presents the contents of the next buffer in the sequence of back buffers to the screen. The area of the back buffer that should be presented. The area of the front buffer that should receive the result of the presentation. The destination window whose client area is taken as the target for this presentation. A object describing the result of the operation. IDirect3DDevice9::Present Presents the contents of the next buffer in the sequence of back buffers to the screen. The area of the back buffer that should be presented. The area of the front buffer that should receive the result of the presentation. The destination window whose client area is taken as the target for this presentation. Specifies a region on the back buffer that contains the minimal amount of pixels that need to be updated. A object describing the result of the operation. IDirect3DDevice9::Present Resets the stream source frequency by setting the frequency to 1. The stream index. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetStreamSourceFreq([In] unsigned int StreamNumber,[In] unsigned int Setting) Sets the pixel shader constant. The start register. The data. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the pixel shader constant. The start register. The data. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the pixel shader constant. The start register. The data. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetPixelShaderConstantB([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int BoolCount) Sets the pixel shader constant. The start register. The data. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetPixelShaderConstantI([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4iCount) Sets the pixel shader constant. The start register. The data. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the pixel shader constant. The start register. The data. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the pixel shader constant. The start register. The data. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the pixel shader constant. The start register. The data. The count. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the pixel shader constant. The start register. The data. The offset. The count. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the pixel shader constant. The start register. The data. The offset. The count. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the pixel shader constant. The start register. The data. The offset. The count. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetPixelShaderConstantB([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int BoolCount) Sets the pixel shader constant. The start register. The data. The offset. The count. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetPixelShaderConstantI([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4iCount) Sets the pixel shader constant. The start register. The data. The offset. The count. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the RenderState. State of the render. if set to true [enable]. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetRenderState([In] D3DRENDERSTATETYPE State,[In] unsigned int Value) Sets the RenderState. State of the render. A float value. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetRenderState([In] D3DRENDERSTATETYPE State,[In] unsigned int Value) Sets the RenderState. Type of the enum value State of the render. An enum value. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetRenderState([In] D3DRENDERSTATETYPE State,[In] unsigned int Value) Sets the SamplerState. The sampler. The type. The texture filter. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetSamplerState([In] unsigned int Sampler,[In] D3DSAMPLERSTATETYPE Type,[In] unsigned int Value) Sets the SamplerState. The sampler. The type. The texture address. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetSamplerState([In] unsigned int Sampler,[In] D3DSAMPLERSTATETYPE Type,[In] unsigned int Value) Sets the SamplerState. The sampler. The type. A float value. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetSamplerState([In] unsigned int Sampler,[In] D3DSAMPLERSTATETYPE Type,[In] unsigned int Value) Sets the stream source frequency. The stream. The frequency. The source. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetStreamSourceFreq([In] unsigned int StreamNumber,[In] unsigned int Setting) Sets the state of the texture stage. The stage. The type. The texture argument. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] unsigned int Value) Sets the state of the texture stage. The stage. The type. The texture operation. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] unsigned int Value) Sets the state of the texture stage. The stage. The type. The texture transform. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] unsigned int Value) Sets the state of the texture stage. The stage. The type. The value. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] unsigned int Value) Sets the transform. The state. The matrix ref. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetTransform([In] D3DTRANSFORMSTATETYPE State,[In] const D3DMATRIX* pMatrix) Sets the transform. The index. The matrix ref. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetTransform([In] D3DTRANSFORMSTATETYPE State,[In] const D3DMATRIX* pMatrix) Sets the transform. The state. The matrix ref. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetTransform([In] D3DTRANSFORMSTATETYPE State,[In] const D3DMATRIX* pMatrix) Sets the transform. The index. The matrix ref. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetTransform([In] D3DTRANSFORMSTATETYPE State,[In] const D3DMATRIX* pMatrix) Sets the vertex shader constant. The start register. The data. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the vertex shader constant. The start register. The data. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the vertex shader constant. The start register. The data. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetVertexShaderConstantB([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int BoolCount) Sets the vertex shader constant. The start register. The data. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetVertexShaderConstantI([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4iCount) Sets the vertex shader constant. The start register. The data. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the vertex shader constant. The start register. The data. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the vertex shader constant. The start register. The data. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the vertex shader constant. The start register. The data. The count. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the vertex shader constant. The start register. The data. The offset. The count. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the vertex shader constant. The start register. The data. The offset. The count. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Sets the vertex shader constant. The start register. The data. The offset. The count. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetVertexShaderConstantB([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int BoolCount) Sets the vertex shader constant. The start register. The data. The offset. The count. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetVertexShaderConstantI([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4iCount) Sets the vertex shader constant. The start register. The data. The offset. The count. A object describing the result of the operation. HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) Stretches the rectangle. The source surface ref. The dest surface ref. The filter. A object describing the result of the operation. HRESULT IDirect3DDevice9::StretchRect([In] IDirect3DSurface9* pSourceSurface,[In, Optional] const RECT* pSourceRect,[In] IDirect3DSurface9* pDestSurface,[In, Optional] const RECT* pDestRect,[In] D3DTEXTUREFILTERTYPE Filter) Gets or sets a value indicating whether the cursor can be displayed. true if the cursor can be displayed; otherwise, false. Updates the surface. The source surface ref. The destination surface ref. A object describing the result of the operation. HRESULT IDirect3DDevice9::UpdateSurface([In] IDirect3DSurface9* pSourceSurface,[In] const RECT* pSourceRect,[In] IDirect3DSurface9* pDestinationSurface,[In] const POINT* pDestPoint) Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Returns an interface to the instance of the Direct3D object that created the device.

Calling will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb174386 GetDirect3D GetDirect3D HRESULT IDirect3DDevice9::GetDirect3D([Out] IDirect3D9** ppD3D9)

Retrieves the capabilities of the rendering device.

retrieves the software vertex pipeline capabilities when the device is being used in software vertex processing mode.

bb174385 GetDeviceCaps GetDeviceCaps HRESULT IDirect3DDevice9::GetDeviceCaps([Out] D3DCAPS9* pCaps)

Retrieves the creation parameters of the device.

You can query the AdapterOrdinal member of the returned structure to retrieve the ordinal of the adapter represented by this device.

bb174382 GetCreationParameters GetCreationParameters HRESULT IDirect3DDevice9::GetCreationParameters([Out] D3DDEVICE_CREATION_PARAMETERS* pParameters)

Gets the number of implicit swap chains.

Implicit swap chains are created by the device during . This method returns the number of swap chains created by CreateDevice.

An application may create additional swap chains using .

bb174396 GetNumberOfSwapChains GetNumberOfSwapChains unsigned int IDirect3DDevice9::GetNumberOfSwapChains()

This method allows the use of GDI dialog boxes in full-screen mode applications.

The GDI dialog boxes must be created as child to the device window. They should also be created within the same thread that created the device because this enables the parent window to manage redrawing the child window.

The method has no effect for windowed mode applications, but this setting will be respected if the application resets the device into full-screen mode. If SetDialogBoxMode succeeds in a windowed mode application, any subsequent reset to full-screen mode will be checked against the restrictions listed above. Also, SetDialogBoxMode causes all back buffers on the swap chain to be discarded, so an application is expected to refresh its content for all back buffers after this call.

bb174432 SetDialogBoxMode SetDialogBoxMode HRESULT IDirect3DDevice9::SetDialogBoxMode([In] BOOL bEnableDialogs)

Gets or sets the depth-stencil surface owned by the Direct3DDevice object.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb174384 GetDepthStencilSurface / SetDepthStencilSurface GetDepthStencilSurface HRESULT IDirect3DDevice9::GetDepthStencilSurface([Out] IDirect3DSurface9** ppZStencilSurface)

Retrieves or sets the viewport parameters currently set for the device.

Typically, methods that return state will not work on a device that is created using . This method however, will work even on a pure device.

bb174420 GetViewport / SetViewport GetViewport HRESULT IDirect3DDevice9::GetViewport([Out] D3DVIEWPORT9* pViewport)

Retrieves or sets the current material properties for the device.

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other values in .

bb174394 GetMaterial / SetMaterial GetMaterial HRESULT IDirect3DDevice9::GetMaterial([Out] D3DMATERIAL9* pMaterial)

Retrieves or sets the clip status.

When clipping is enabled during vertex processing (by , , or other drawing functions), Direct3D computes a clip code for every vertex. The clip code is a combination of D3DCS_* bits. When a vertex is outside a particular clipping plane, the corresponding bit is set in the clipping code. Direct3D maintains the clip status using , which has ClipUnion and ClipIntersection members. ClipUnion is a bitwise "OR" of all vertex clip codes and ClipIntersection is a bitwise "AND" of all vertex clip codes. Initial values are zero for ClipUnion and 0xFFFFFFFF for ClipIntersection. When is set to , ClipUnion and ClipIntersection are set to zero. Direct3D updates the clip status during drawing calls. To compute clip status for a particular object, set ClipUnion and ClipIntersection to their initial value and continue drawing.

Clip status is not updated by and because there is no software emulation for them.

Clip status is used during software vertex processing. Therefore, this method is not supported on pure or nonpure hardware processing devices. For more information about pure devices, see .

bb174381 GetClipStatus / SetClipStatus GetClipStatus HRESULT IDirect3DDevice9::GetClipStatus([Out] D3DCLIPSTATUS9* pClipStatus)

Retrieves or sets the current texture palette.

bb174383 GetCurrentTexturePalette / SetCurrentTexturePalette GetCurrentTexturePalette HRESULT IDirect3DDevice9::GetCurrentTexturePalette([Out] unsigned int* PaletteNumber)

Gets or sets the scissor rectangle.

The scissor rectangle is used as a rectangular clipping region.

See Rectangles (Direct3D 9) for further information on the use of rectangles in DirectX.

bb174407 GetScissorRect / SetScissorRect GetScissorRect HRESULT IDirect3DDevice9::GetScissorRect([Out] RECT* pRect)

Gets or sets the vertex processing (hardware or software) mode.

An application can create a mixed-mode device to use both the software vertex processing and the hardware vertex processing. To switch between the two vertex processing modes in DirectX 8.x, use with the render state D3DRS_SOFTWAREVERTEXPROCESSING and the appropriate argument. The drawback of the render state approach was the difficulty in defining the semantics for state blocks. Applications and the runtime had to do extra work and be careful while recording and playing back state blocks.

In Direct3D 9, use instead. This new API is not recorded by StateBlocks.

bb174408 GetSoftwareVertexProcessing / SetSoftwareVertexProcessing GetSoftwareVertexProcessing BOOL IDirect3DDevice9::GetSoftwareVertexProcessing()

Gets or sets the N-patch mode segments.

bb174395 GetNPatchMode / SetNPatchMode GetNPatchMode float IDirect3DDevice9::GetNPatchMode()

Gets or sets a vertex shader declaration.

bb174415 GetVertexDeclaration / SetVertexDeclaration GetVertexDeclaration HRESULT IDirect3DDevice9::GetVertexDeclaration([Out] IDirect3DVertexDeclaration9** ppDecl)

Gets or sets the fixed vertex function declaration.

The fixed vertex function declaration is a set of FVF flags that determine how vertices processed by the fixed function pipeline will be used.

bb174389 GetFVF / SetFVF GetFVF HRESULT IDirect3DDevice9::GetFVF([Out] D3DFVF* pFVF)

Retrieves or sets the currently set vertex shader.

Typically, methods that return state will not work on a device that is created using . This method however, will work even on a pure device because it returns an interface.

bb174416 GetVertexShader / SetVertexShader GetVertexShader HRESULT IDirect3DDevice9::GetVertexShader([Out] IDirect3DVertexShader9** ppShader)

Retrieves or sets index data.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb174391 GetIndices / SetIndices GetIndices HRESULT IDirect3DDevice9::GetIndices([Out] IDirect3DIndexBuffer9** ppIndexData)

Retrieves or sets the currently set pixel shader.

This method will not work on a device that is created using .

bb174398 GetPixelShader / SetPixelShader GetPixelShader HRESULT IDirect3DDevice9::GetPixelShader([Out] IDirect3DPixelShader9** ppShader)

Reports the current cooperative-level status of the Direct3D device for a windowed or full-screen application.

If the method succeeds, the return value is , indicating that the device is operational and the calling application can continue. If the method fails, the return value can be one of the following values: , , .

If the device is lost but cannot be restored at the current time, returns the return code. This would be the case, for example, when a full-screen device has lost focus. If an application detects a lost device, it should pause and periodically call until it receives a return value of . The application may then attempt to reset the device by calling and, if this succeeds, restore the necessary resources and resume normal operation. Note that will return if the device is either "lost" or "not reset".

A call to will fail if called on a different thread than that used to create the device being reset.

bb174472 HRESULT IDirect3DDevice9::TestCooperativeLevel() IDirect3DDevice9::TestCooperativeLevel

Returns an estimate of the amount of available texture memory.

The function returns an estimate of the available texture memory.

The returned value is rounded to the nearest MB. This is done to reflect the fact that video memory estimates are never precise due to alignment and other issues that affect consumption by certain resources. Applications can use this value to make gross estimates of memory availability to make large-scale resource decisions such as how many levels of a mipmap to attempt to allocate, but applications cannot use this value to make small-scale decisions such as if there is enough memory left to allocate another resource.

bb174378 unsigned int IDirect3DDevice9::GetAvailableTextureMem() IDirect3DDevice9::GetAvailableTextureMem

Evicts all managed resources, including both Direct3D and driver-managed resources.

If the method succeeds, the return value is . If the method fails, the return value can be , D3DERR_COMMAND_UNPARSED.

This function causes only the copy of resources to be evicted. The resource copy in system memory is retained. See .

bb174377 HRESULT IDirect3DDevice9::EvictManagedResources() IDirect3DDevice9::EvictManagedResources

Returns an interface to the instance of the Direct3D object that created the device.

Address of a reference to an interface, representing the interface of the Direct3D object that created the device.

If the method succeeds, the return value is . If the method fails, the return value can be .

Calling will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb174386 HRESULT IDirect3DDevice9::GetDirect3D([Out] IDirect3D9** ppD3D9) IDirect3DDevice9::GetDirect3D

Retrieves the capabilities of the rendering device.

Pointer to a structure, describing the returned device.

If the method succeeds, the return value is . If the method fails, the return value can be .

retrieves the software vertex pipeline capabilities when the device is being used in software vertex processing mode.

bb174385 HRESULT IDirect3DDevice9::GetDeviceCaps([Out] D3DCAPS9* pCaps) IDirect3DDevice9::GetDeviceCaps

Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.

An unsigned integer specifying the swap chain.

Pointer to a structure containing data about the display mode of the adapter. As opposed to the display mode of the device, which may not be active if the device does not own full-screen mode.

bb174387 HRESULT IDirect3DDevice9::GetDisplayMode([In] unsigned int iSwapChain,[Out] D3DDISPLAYMODE* pMode) IDirect3DDevice9::GetDisplayMode

Retrieves the creation parameters of the device.

Pointer to a structure, describing the creation parameters of the device.

If the method succeeds, the return value is .

is returned if the argument is invalid.

You can query the AdapterOrdinal member of the returned structure to retrieve the ordinal of the adapter represented by this device.

bb174382 HRESULT IDirect3DDevice9::GetCreationParameters([Out] D3DDEVICE_CREATION_PARAMETERS* pParameters) IDirect3DDevice9::GetCreationParameters

Sets properties for the cursor.

X-coordinate offset (in pixels) that marks the center of the cursor. The offset is relative to the upper-left corner of the cursor. When the cursor is given a new position, the image is drawn at an offset from this new position determined by subtracting the hot spot coordinates from the position.

Y-coordinate offset (in pixels) that marks the center of the cursor. The offset is relative to the upper-left corner of the cursor. When the cursor is given a new position, the image is drawn at an offset from this new position determined by subtracting the hot spot coordinates from the position.

Pointer to an interface. This parameter must point to an 8888 ARGB surface (format ). The contents of this surface will be copied and potentially format-converted into an internal buffer from which the cursor is displayed. The dimensions of this surface must be less than the dimensions of the display mode, and must be a power of two in each direction, although not necessarily the same power of two. The alpha channel must be either 0.0 or 1.0.

If the method succeeds, the return value is . If the method fails, the return value can be .

An operating system cursor is created and used under either of these conditions:

  • The hardware has set (see ), and the cursor size is 32x32 (which is the cursor size in the operating system).
  • The application is running in windowed mode.

Otherwise, DirectX uses an emulated cursor. An application uses to move an emulated cursor to follow mouse movement.

It is recommended for applications to always trap WM_MOUSEMOVE events and call DXSetCursorPosition.

Direct3D cursor functions use either GDI cursor or software emulation, depending on the hardware. Users typically want to respond to a WM_SETCURSOR message. For example, they might want to write the message handler as follows:

 case WM_SETCURSOR:	
            // Turn off window cursor. 	
            SetCursor( null );	
            m_pd3dDevice->ShowCursor( TRUE );	
            return TRUE; // Prevent Windows from setting cursor to window class cursor.	
            break;	
            

Or, users might want to call the method if they want to change the cursor.

The application can determine what hardware support is available for cursors by examining appropriate members of the structure. Typically, hardware supports only 32x32 cursors and, when windowed, the system might support only 32x32 cursors. In this case, still succeeds but the cursor might be reduced to that size. The hot spot is scaled appropriately.

The cursor does not survive when the device is lost. This method must be called after the device is reset.

bb174430 HRESULT IDirect3DDevice9::SetCursorProperties([In] unsigned int XHotSpot,[In] unsigned int YHotSpot,[In] IDirect3DSurface9* pCursorBitmap) IDirect3DDevice9::SetCursorProperties

Sets the cursor position and update options.

The new X-position of the cursor in virtual desktop coordinates. See Remarks.

The new Y-position of the cursor in virtual desktop coordinates. See Remarks.

Specifies the update options for the cursor. Currently, only one flag is defined.

ValueMeaning
D3DCURSOR_IMMEDIATE_UPDATE

Update cursor at the refresh rate.

If this flag is specified, the system guarantees that the cursor will be updated at a minimum of half the display refresh rate, but never more frequently than the display refresh rate. Otherwise, the method delays cursor updates until the next call. Not setting this flag usually results in better performance than if the flag is set. However, applications should set this flag if the rate of calls to Present is low enough that users would notice a significant delay in cursor motion. This flag has no effect in a windowed-mode application. Some video cards implement hardware color cursors. This flag does not have an effect on these cards.

?

When running in full-screen mode, screen space coordinates are the back buffer coordinates appropriately scaled to the current display mode. When running in windowed mode, screen space coordinates are the desktop coordinates. The cursor image is drawn at the specified position minus the hotspot-offset specified by the SetCursorProperties method.

If the cursor has been hidden by ShowCursor, the cursor is not drawn.

bb174429 void IDirect3DDevice9::SetCursorPosition([In] int X,[In] int Y,[In] unsigned int Flags) IDirect3DDevice9::SetCursorPosition

Displays or hides the cursor.

If bShow is TRUE, the cursor is shown. If bShow is , the cursor is hidden.

Value indicating whether the cursor was previously visible. TRUE if the cursor was previously visible, or if the cursor was not previously visible.

Direct3D cursor functions use either GDI cursor or software emulation, depending on the hardware. Users usually want to respond to a WM_SETCURSOR message. For example, the users might want to write the message handler like this:

 case WM_SETCURSOR: // Turn off window cursor  SetCursor( null ); m_pd3dDevice->ShowCursor( TRUE ); return TRUE; // prevent Windows from setting cursor to window class cursor break;	
            

Or users might want to call the method if they want to change the cursor. See the code in the DirectX Graphics C/C++ Samples for more detail.

bb174470 BOOL IDirect3DDevice9::ShowCursor([In] BOOL bShow) IDirect3DDevice9::ShowCursor

Creates an additional swap chain for rendering multiple views.

Pointer to a structure, containing the presentation parameters for the new swap chain. This value cannot be null.

Calling this method changes the value of members of the structure.

  • If BackBufferCount == 0, calling CreateAdditionalSwapChain will increase it to 1.
  • If the application is in windowed mode, and if either the BackBufferWidth or the BackBufferHeight == 0, they will be set to the client area width and height of the hwnd.

Address of a reference to an interface, representing the additional swap chain.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , , , E_OUTOFMEMORY.

There is always at least one swap chain (the implicit swap chain) for each device because Direct3D 9 has one swap chain as a property of the device.

Note that any given device can support only one full-screen swap chain.

can be specified for the windowed mode back buffer format when calling , and CreateAdditionalSwapChain. This means the application does not have to query the current desktop format before calling CreateDevice for windowed mode. For full-screen mode, the back buffer format must be specified.

bb174354 HRESULT IDirect3DDevice9::CreateAdditionalSwapChain([In] D3DPRESENT_PARAMETERS* pPresentationParameters,[Out, Fast] IDirect3DSwapChain9** pSwapChain) IDirect3DDevice9::CreateAdditionalSwapChain

Gets a reference to a swap chain.

The swap chain ordinal value. For more information, see NumberOfAdaptersInGroup in .

Pointer to an interface that will receive a copy of swap chain.

bb174411 HRESULT IDirect3DDevice9::GetSwapChain([In] unsigned int iSwapChain,[Out] IDirect3DSwapChain9** pSwapChain) IDirect3DDevice9::GetSwapChain

Gets the number of implicit swap chains.

Number of implicit swap chains. See Remarks.

Implicit swap chains are created by the device during . This method returns the number of swap chains created by CreateDevice.

An application may create additional swap chains using .

bb174396 unsigned int IDirect3DDevice9::GetNumberOfSwapChains() IDirect3DDevice9::GetNumberOfSwapChains

Resets the type, size, and format of the swap chain.

Pointer to a structure, describing the new presentation parameters. This value cannot be null.

When switching to full-screen mode, Direct3D will try to find a desktop format that matches the back buffer format, so that back buffer and front buffer formats will be identical (to eliminate the need for color conversion).

When this method returns:

  • BackBufferCount, BackBufferWidth, and BackBufferHeight are set to zero.
  • BackBufferFormat is set to for windowed mode only; a full-screen mode must specify a format.

Possible return values include: , , , , or (see D3DERR).

If a call to fails, the device will be placed in the "lost" state (as indicated by a return value of from a call to ) unless it is already in the "not reset" state (as indicated by a return value of from a call to ). Refer to and Lost Devices (Direct3D 9) for further information concerning the use of in the context of lost devices.

Calling causes all texture memory surfaces to be lost, managed textures to be flushed from video memory, and all state information to be lost. Before calling the method for a device, an application should release any explicit render targets, depth stencil surfaces, additional swap chains, state blocks, and resources associated with the device.

There are two different types of swap chains: full-screen or windowed. If the new swap chain is full-screen, the adapter will be placed in the display mode that matches the new size.

Direct3D 9 applications can expect messages to be sent to them during this call (for example, before this call is returned); applications should take precautions not to call into Direct3D at this time. In addition, when fails, the only valid methods that can be called are , , and the various Release member functions. Calling any other method can result in an exception.

A call to will fail if called on a different thread than that used to create the device being reset.

Pixel shaders and vertex shaders survive calls for Direct3D 9. They do not need to be re-created explicitly by the application.

can be specified for the windowed mode back buffer format when calling , , and . This means the application does not have to query the current desktop format before calling for windowed mode. For full-screen mode, the back buffer format must be specified. Setting BackBufferCount equal to zero (BackBufferCount = 0) results in one back buffer.

When trying to reset more than one display adapter in a group, set pPresentationParameters to point to an array of structures, one for each display in the adapter group.

If a multihead device was created with , requires an array of structures wherein each structure must specify a full-screen display. To switch back to windowed mode, the application must destroy the device and re-create a non-multihead device in windowed mode.

bb174425 HRESULT IDirect3DDevice9::Reset([In, Out, Params] D3DPRESENT_PARAMETERS* pPresentationParameters) IDirect3DDevice9::Reset

Presents the contents of the next buffer in the sequence of back buffers owned by the device.

Pointer to a value that must be null unless the swap chain was created with . pSourceRect is a reference to a structure containing the source rectangle. If null, the entire source surface is presented. If the rectangle exceeds the source surface, the rectangle is clipped to the source surface.

Pointer to a value that must be null unless the swap chain was created with . pDestRect is a reference to a structure containing the destination rectangle, in window client coordinates. If null, the entire client area is filled. If the rectangle exceeds the destination client area, the rectangle is clipped to the destination client area.

Pointer to a destination window whose client area is taken as the target for this presentation. If this value is null, the runtime uses the hDeviceWindow member of for the presentation.

Value must be null unless the swap chain was created with . For more information about swap chains, see Flipping Surfaces (Direct3D 9) and . If this value is non-null, the contained region is expressed in back buffer coordinates. The rectangles within the region are the minimal set of pixels that need to be updated. This method takes these rectangles into account when optimizing the presentation by copying only the pixels within the region, or some suitably expanded set of rectangles. This is an aid to optimization only, and the application should not rely on the region being copied exactly. The implementation can choose to copy the whole source rectangle.

Possible return values include: or (see D3DERR).

If necessary, a stretch operation is applied to transfer the pixels within the source rectangle to the destination rectangle in the client area of the target window.

Present will fail, returning , if called between BeginScene and EndScene pairs unless the render target is not the current render target (such as the back buffer you get from creating an additional swap chain). This is a new behavior for Direct3D 9.

bb174423 HRESULT IDirect3DDevice9::Present([In] const void* pSourceRect,[In] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const void* pDirtyRegion) IDirect3DDevice9::Present

Retrieves a back buffer from the device's swap chain.

An unsigned integer specifying the swap chain.

Index of the back buffer object to return. Back buffers are numbered from 0 to the total number of back buffers minus one. A value of 0 returns the first back buffer, not the front buffer. The front buffer is not accessible through this method. Use to retrieve a copy of the front buffer.

Stereo view is not supported in Direct3D 9, so the only valid value for this parameter is .

Address of a reference to an interface, representing the returned back buffer surface.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb174379 HRESULT IDirect3DDevice9::GetBackBuffer([In] unsigned int iSwapChain,[In] unsigned int iBackBuffer,[In] D3DBACKBUFFER_TYPE Type,[Out] IDirect3DSurface9** ppBackBuffer) IDirect3DDevice9::GetBackBuffer

Returns information describing the raster of the monitor on which the swap chain is presented.

An unsigned integer specifying the swap chain.

Pointer to a structure filled with information about the position or other status of the raster on the monitor driven by this adapter.

bb174402 HRESULT IDirect3DDevice9::GetRasterStatus([In] unsigned int iSwapChain,[Out] D3DRASTER_STATUS* pRasterStatus) IDirect3DDevice9::GetRasterStatus

This method allows the use of GDI dialog boxes in full-screen mode applications.

TRUE to enable GDI dialog boxes, and to disable them.

If the method succeeds, the return value is . If the method fails, the return value can be unless all of the following are true.

  • The application specified a back buffer format compatible with GDI, in other words, one of , , or .
  • The application specified no multisampling.
  • The application specified .
  • The application specified .
  • The application did not specify .
  • The application is not between BeginScene and EndScene.

The GDI dialog boxes must be created as child to the device window. They should also be created within the same thread that created the device because this enables the parent window to manage redrawing the child window.

The method has no effect for windowed mode applications, but this setting will be respected if the application resets the device into full-screen mode. If SetDialogBoxMode succeeds in a windowed mode application, any subsequent reset to full-screen mode will be checked against the restrictions listed above. Also, SetDialogBoxMode causes all back buffers on the swap chain to be discarded, so an application is expected to refresh its content for all back buffers after this call.

bb174432 HRESULT IDirect3DDevice9::SetDialogBoxMode([In] BOOL bEnableDialogs) IDirect3DDevice9::SetDialogBoxMode

Sets the gamma correction ramp for the implicit swap chain. This method will affect the entire screen (not just the active window if you are running in windowed mode).

Unsigned integer specifying the swap chain.

Indicates whether correction should be applied. Gamma correction results in a more consistent display, but can incur processing overhead and should not be used frequently. Short-duration effects, such as flashing the whole screen red, should not be calibrated, but long-duration gamma changes should be calibrated. One of the following values can be set:

ItemDescription

D3DSGR_CALIBRATE

If a gamma calibrator is installed, the ramp will be modified before being sent to the device to account for the system and monitor response curves. If a calibrator is not installed, the ramp will be passed directly to the device.

D3DSGR_NO_CALIBRATION

No gamma correction is applied. The supplied gamma table is transferred directly to the device.

?

Pointer to a structure, representing the gamma correction ramp to be set for the implicit swap chain.

There is always at least one swap chain (the implicit swap chain) for each device, because Direct3D 9 has one swap chain as a property of the device. The gamma ramp takes effect immediately; there is no wait for a vertical sync.

If the device does not support gamma ramps in the swap chain's current presentation mode (full-screen or windowed), no error return is given. Applications can check the and capability bits in the Caps2 member of the structure to determine the capabilities of the device and whether a calibrator is installed.

For windowed gamma correction presentation, use if the hardware supports the feature. In DirectX 8, SetGammaRamp will set the gamma ramp only on a full-screen mode application. For more information about gamma correction, see Gamma (Direct3D 9).

bb174434 void IDirect3DDevice9::SetGammaRamp([In] unsigned int iSwapChain,[In] unsigned int Flags,[In] const D3DGAMMARAMP* pRamp) IDirect3DDevice9::SetGammaRamp

Retrieves the gamma correction ramp for the swap chain.

An unsigned integer specifying the swap chain.

bb174390 void IDirect3DDevice9::GetGammaRamp([In] unsigned int iSwapChain,[Out] D3DGAMMARAMP* pRamp) IDirect3DDevice9::GetGammaRamp

Creates a texture resource.

Width of the top-level of the texture, in pixels. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by 2 results in 0, 1 will be taken instead.

Height of the top-level of the texture, in pixels. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by 2 results in 0, 1 will be taken instead.

Number of levels in the texture. If this is zero, Direct3D will generate all texture sublevels down to 1 by 1 pixels for hardware that supports mipmapped textures. Call to see the number of levels generated.

Usage can be 0, which indicates no usage value. However, if usage is desired, use a combination of one or more constants. It is good practice to match the usage parameter with the behavior flags in .

Member of the enumerated type, describing the format of all levels in the texture.

Member of the enumerated type, describing the memory class into which the texture should be placed.

Pointer to an interface, representing the created texture resource.

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , E_OUTOFMEMORY.

An application can discover support for Automatic Generation of Mipmaps (Direct3D 9) in a particular format by calling with . If returns , will succeed but it will return a one-level texture.

In Windows Vista CreateTexture can create a texture from a system memory reference allowing the application more flexibility over the use, allocation and deletion of the system memory. For example, an application could pass a GDI system memory bitmap reference and get a Direct3D texture interface around it. Using a system memory reference with CreateTexture has the following restrictions.

  • The pitch of the texture must be equal to the width multiplied by the number of bytes per pixel.
  • Only textures with a single mipmap level are supported. The Levels argument must be 1.
  • The Pool argument must be .
  • The pSharedHandle argument must be a valid reference to a buffer that can hold the system memory point; *pSharedHandle must be a valid reference to system memory with a size in bytes of texture width * texture height * bytes per pixel of the texture format.
bb174363 HRESULT IDirect3DDevice9::CreateTexture([In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Levels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DTexture9** ppTexture,[In] void** pSharedHandle) IDirect3DDevice9::CreateTexture

Creates a volume texture resource.

Width of the top-level of the volume texture, in pixels. This value must be a power of two if the member of is set. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by two results in 0 (zero), 1 will be taken instead. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

Height of the top-level of the volume texture, in pixels. This value must be a power of two if the member of is set. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by 2 results in 0 (zero), 1 will be taken instead. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

Depth of the top-level of the volume texture, in pixels. This value must be a power of two if the member of is set. The pixel dimensions of subsequent levels will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by 2 results in 0 (zero), 1 will be taken instead. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

Number of levels in the texture. If this is zero, Direct3D will generate all texture sublevels down to 1x1 pixels for hardware that supports mipmapped volume textures. Call to see the number of levels generated.

Usage can be 0, which indicates no usage value. If usage is desired, use or . For more information, see .

Member of the enumerated type, describing the format of all levels in the volume texture.

Member of the enumerated type, describing the memory class into which the volume texture should be placed.

Address of a reference to an interface, representing the created volume texture resource.

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , E_OUTOFMEMORY.

bb174367 HRESULT IDirect3DDevice9::CreateVolumeTexture([In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Depth,[In] unsigned int Levels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DVolumeTexture9** ppVolumeTexture,[In] void** pSharedHandle) IDirect3DDevice9::CreateVolumeTexture

Creates a cube texture resource.

Size of the edges of all the top-level faces of the cube texture. The pixel dimensions of subsequent levels of each face will be the truncated value of half of the previous level's pixel dimension (independently). Each dimension clamps at a size of 1 pixel. Thus, if the division by 2 results in 0 (zero), 1 will be taken instead.

Number of levels in each face of the cube texture. If this is zero, Direct3D will generate all cube texture sublevels down to 1x1 pixels for each face for hardware that supports mipmapped cube textures. Call to see the number of levels generated.

Usage can be 0, which indicates no usage value. However, if usage is desired, use a combination of one or more constants. It is good practice to match the usage parameter in CreateCubeTexture with the behavior flags in . For more information, see Remarks.

Member of the enumerated type, describing the format of all levels in all faces of the cube texture.

Member of the enumerated type, describing the memory class into which the cube texture should be placed.

Address of a reference to an interface, representing the created cube texture resource.

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , E_OUTOFMEMORY.

A mipmap (texture) is a collection of successively downsampled (mipmapped) surfaces. On the other hand, a cube texture (created by ) is a collection of six textures (mipmaps), one for each face. All faces must be present in the cube texture. Also, a cube map surface must be the same pixel size in all three dimensions (x, y, and z).

An application can discover support for Automatic Generation of Mipmaps (Direct3D 9) in a particular format by calling with . If returns , will succeed but it will return a one-level texture.

bb174355 HRESULT IDirect3DDevice9::CreateCubeTexture([In] unsigned int EdgeLength,[In] unsigned int Levels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DCubeTexture9** ppCubeTexture,[In] void** pSharedHandle) IDirect3DDevice9::CreateCubeTexture

Creates a vertex buffer.

Size of the vertex buffer, in bytes. For FVF vertex buffers, Length must be large enough to contain at least one vertex, but it need not be a multiple of the vertex size. Length is not validated for non-FVF buffers. See Remarks.

Usage can be 0, which indicates no usage value. However, if usage is desired, use a combination of one or more constants. It is good practice to match the usage parameter in CreateVertexBuffer with the behavior flags in . For more information, see Remarks.

Combination of , a usage specifier that describes the vertex format of the vertices in this buffer. If this parameter is set to a valid FVF code, the created vertex buffer is an FVF vertex buffer (see Remarks). Otherwise, if this parameter is set to zero, the vertex buffer is a non-FVF vertex buffer.

Member of the enumerated type, describing a valid memory class into which to place the resource. Do not set to .

Address of a reference to an interface, representing the created vertex buffer resource.

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , E_OUTOFMEMORY.

A vertex buffer can be used with either hardware or software vertex processing. This is determined by how the device and the vertex buffer are created.

When a device is created, CreateDevice uses the behavior flag to determine whether to process vertices in hardware or software. There are three possibilities:

  • Process vertices in hardware by setting .
  • Process vertices in software by setting .
  • Process vertices in either hardware or software by setting .

Mixed-mode devices might need to switch between software and hardware processing (using ) after the device is created.

When a vertex buffer is created, CreateVertexBuffer uses the usage parameter to decide whether to process vertices in hardware or software.

  • If CreateDevice uses , CreateVertexBuffer must use 0.
  • If CreateDevice uses , CreateVertexBuffer must use either 0 or . For either value, vertices will be processed in software.
  • If CreateDevice uses , CreateVertexBuffer can use either 0 or .

To use a vertex buffer with a mixed mode device, create a single vertex buffer which can be used for both hardware or software processing. Use to set the current vertex buffer and use , if necessary, to change the device behavior to match. It is recommended that the vertex buffer usage matches the device behavior. Note that a vertex buffer created for software processing cannot be located in video memory.

The interface supports rendering of primitives using vertex data stored in vertex buffer objects. Vertex buffers are created from the , and are usable only with the object from which they are created.

When set to a nonzero value, which must be a valid FVF code, the FVF parameter indicates that the buffer content is to be characterized by an FVF code. A vertex buffer that is created with an FVF code is referred to as an FVF vertex buffer. For more information, see FVF Vertex Buffers (Direct3D 9).

Non-FVF buffers can be used to interleave data during multipass rendering or multitexture rendering in a single pass. To do this, one buffer contains geometry data and the others contain texture coordinates for each texture to be rendered. When rendering, the buffer containing the geometry data is interleaved with each of the buffers containing the texture coordinates. If FVF buffers were used instead, each of them would need to contain identical geometry data in addition to the texture coordinate data specific to each texture rendered. This would result in either a speed or memory penalty, depending on the strategy used. For more information about texture coordinates, see Texture Coordinates (Direct3D 9).

bb174364 HRESULT IDirect3DDevice9::CreateVertexBuffer([In] unsigned int Length,[In] D3DUSAGE Usage,[In] D3DFVF FVF,[In] D3DPOOL Pool,[Out, Fast] IDirect3DVertexBuffer9** ppVertexBuffer,[In] void** pSharedHandle) IDirect3DDevice9::CreateVertexBuffer

Creates an index buffer.

Size of the index buffer, in bytes.

Usage can be 0, which indicates no usage value. However, if usage is desired, use a combination of one or more constants. It is good practice to match the usage parameter in CreateIndexBuffer with the behavior flags in . For more information, see Remarks.

Member of the enumerated type, describing the format of the index buffer. For more information, see Remarks. The valid settings are the following:

ItemDescription

Indices are 16 bits each.

Indices are 32 bits each.

?

Member of the enumerated type, describing a valid memory class into which to place the resource.

Address of a reference to an interface, representing the created index buffer resource.

This parameter can be used in Direct3D?9 for Windows?Vista to share resources; set it to null to not share a resource. This parameter is not used in Direct3D?9 for operating systems earlier than Windows?Vista; set it to null.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

Index buffers are memory resources used to hold indices, they are similar to both surfaces and vertex buffers. The use of index buffers enables Direct3D to avoid unnecessary data copying and to place the buffer in the optimal memory type for the expected usage.

To use index buffers, create an index buffer, lock it, fill it with indices, unlock it, pass it to , set up the vertices, set up the vertex shader, and call for rendering.

The MaxVertexIndex member of the structure indicates the types of index buffers that are valid for rendering.

bb174357 HRESULT IDirect3DDevice9::CreateIndexBuffer([In] unsigned int Length,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DIndexBuffer9** ppIndexBuffer,[In] void** pSharedHandle) IDirect3DDevice9::CreateIndexBuffer

Creates a render-target surface.

Width of the render-target surface, in pixels.

Height of the render-target surface, in pixels.

Member of the enumerated type, describing the format of the render target.

Member of the enumerated type, which describes the multisampling buffer type. This parameter specifies the antialiasing type for this render target. When this surface is passed to , its multisample type must be the same as that of the depth-stencil set by .

Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by . Passing a larger value returns the error, . The MultisampleQuality values of paired render targets, depth stencil surfaces, and the multisample type must all match.

Render targets are not lockable unless the application specifies TRUE for Lockable.

Note that lockable render targets reduce performance on some graphics hardware. The readback performance (moving data from video memory to system memory) depends on the type of hardware used (AGP vs. PCI Express) and is usually far lower than upload performance (moving data from system to video memory). If you need read access to render targets, use GetRenderTargetData instead of lockable render targets.

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

Address of a reference to an interface.

Render-target surfaces are placed in the memory class.

The creation of lockable, multisampled render targets is not supported.

bb174361 HRESULT IDirect3DDevice9::CreateRenderTarget([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Lockable,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) IDirect3DDevice9::CreateRenderTarget

Creates a depth-stencil resource.

Width of the depth-stencil surface, in pixels.

Height of the depth-stencil surface, in pixels.

Member of the enumerated type, describing the format of the depth-stencil surface. This value must be one of the enumerated depth-stencil formats for this device.

Member of the enumerated type, describing the multisampling buffer type. This value must be one of the allowed multisample types. When this surface is passed to , its multisample type must be the same as that of the render target set by .

Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by . Passing a larger value returns the error . The MultisampleQuality values of paired render targets, depth stencil surfaces, and the MultiSample type must all match.

Set this flag to TRUE to enable z-buffer discarding, and otherwise. If this flag is set, the contents of the depth stencil buffer will be invalid after calling either or with a different depth surface.

This flag has the same behavior as the constant, , in .

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

Address of a reference to an interface, representing the created depth-stencil surface resource.

The memory class of the depth-stencil buffer is always .

bb174356 HRESULT IDirect3DDevice9::CreateDepthStencilSurface([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Discard,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) IDirect3DDevice9::CreateDepthStencilSurface

Copies rectangular subsets of pixels from one surface to another.

Pointer to an interface, representing the source surface. This parameter must point to a different surface than pDestinationSurface.

Pointer to a rectangle on the source surface. Specifying null for this parameter causes the entire surface to be copied.

Pointer to an interface, representing the destination surface.

Pointer to the upper left corner of the destination rectangle. Specifying null for this parameter causes the entire surface to be copied.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: .

This method is similar to CopyRects in DirectX 8.

This function has the following restrictions.

  • The source surface must have been created with .
  • The destination surface must have been created with .
  • Neither surface can be locked or holding an outstanding device context.
  • Neither surface can be created with multisampling. The only valid flag for both surfaces is .
  • The surface format cannot be a depth stencil format.
  • The source and dest rects must fit within the surface.
  • No stretching or shrinking is allowed (the rects must be the same size).
  • The source format must match the dest format.

The following table shows the supported combinations.

Dest formats
TextureRT textureRTOff-screen plain
Src formatsTextureYesYesYes*Yes
RT textureNoNoNoNo
RTNoNoNoNo
Off-screen plainYesYesYesYes

?

* If the driver does not support the requested copy, it will be emulated using lock and copy.

If the application needs to copy data from a render target to a surface, it can use GetRenderTargetData.

bb205857 HRESULT IDirect3DDevice9::UpdateSurface([In] IDirect3DSurface9* pSourceSurface,[In, Optional] const RECT* pSourceRect,[In] IDirect3DSurface9* pDestinationSurface,[In, Optional] const POINT* pDestPoint) IDirect3DDevice9::UpdateSurface

Updates the dirty portions of a texture.

Pointer to an interface, representing the source texture. The source texture must be in system memory ().

Pointer to an interface, representing the destination texture. The destination texture must be in the memory pool.

If the method succeeds, the return value is . If the method fails, the return value can be .

You can dirty a portion of a texture by locking it, or by calling one of the following methods.

retrieves the dirty portions of the texture by calculating what has been accumulated since the last update operation.

For performance reasons, dirty regions are only recorded for level zero of a texture. For sublevels, it is assumed that the corresponding (scaled) rectangle or box is also dirty. Dirty regions are automatically recorded when LockRect or is called without or . Also, the destination surface of is marked dirty.

This method fails if the textures are of different types, if their bottom-level buffers are of different sizes, or if their matching levels do not match. For example, consider a six-level source texture with the following dimensions.

 32x16, 16x8, 8x4, 4x2, 2x1, 1x1	
            

This six-level source texture could be the source for the following one-level destination.

 1x1	
            

For the following two-level destination.

 2x1, 1x1	
            

Or, for the following three-level destination.

 4x2, 2x1, 1x1	
            

In addition, this method will fail if the textures are of different formats. If the destination texture has fewer levels than the source, only the matching levels are copied. If the source texture has fewer levels than the destination, the method will fail.

If the source texture has dirty regions, the copy can be optimized by restricting the copy to only those regions. It is not guaranteed that only those bytes marked dirty will be copied.

Here are the possibilities for source and destination surface combinations:

  • If pSourceTexture is a non-autogenerated mipmap and pDestinationTexture is an autogenerated mipmap, only the topmost matching level is updated, and the destination sublevels are regenerated. All other source sublevels are ignored.
  • If both pSourceTexture and pDestinationTexture are autogenerated mipmaps, only the topmost matching level is updated. The sublevels from the source are ignored and the destination sublevels are regenerated.
  • If pSourceTexture is an autogenerated mipmap and pDestinationTexture a non-autogenerated mipmap, UpdateTexture will fail.
bb205858 HRESULT IDirect3DDevice9::UpdateTexture([In] IDirect3DBaseTexture9* pSourceTexture,[In] IDirect3DBaseTexture9* pDestinationTexture) IDirect3DDevice9::UpdateTexture

Copies the render-target data from device memory to system memory.

Pointer to an object, representing a render target.

Pointer to an object, representing a destination surface.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , .

The destination surface must be either an off-screen plain surface or a level of a texture (mipmap or cube texture) created with .

The source surface must be a regular render target or a level of a render-target texture (mipmap or cube texture) created with POOL_DEFAULT.

This method will fail if:

  • The render target is multisampled.
  • The source render target is a different size than the destination surface.
  • The source render target and destination surface formats do not match.
bb174405 HRESULT IDirect3DDevice9::GetRenderTargetData([In] IDirect3DSurface9* pRenderTarget,[In] IDirect3DSurface9* pDestSurface) IDirect3DDevice9::GetRenderTargetData

Generates a copy of the device's front buffer and places that copy in a system memory buffer provided by the application.

An unsigned integer specifying the swap chain.

Pointer to an interface that will receive a copy of the contents of the front buffer. The data is returned in successive rows with no intervening space, starting from the vertically highest row on the device's output to the lowest.

For windowed mode, the size of the destination surface should be the size of the desktop. For full-screen mode, the size of the destination surface should be the screen size.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , ,

The buffer pointed to by pDestSurface will be filled with a representation of the front buffer, converted to the standard 32 bits per pixel format .

This method is the only way to capture an antialiased screen shot.

This function is very slow, by design, and should not be used in any performance-critical path.

For more information, see Lost Devices and Retrieved Data.

bb174388 HRESULT IDirect3DDevice9::GetFrontBufferData([In] unsigned int iSwapChain,[In] IDirect3DSurface9* pDestSurface) IDirect3DDevice9::GetFrontBufferData

Copy the contents of the source rectangle to the destination rectangle. The source rectangle can be stretched and filtered by the copy. This function is often used to change the aspect ratio of a video stream.

Pointer to the source surface. See .

Pointer to the source rectangle. A null for this parameter causes the entire source surface to be used.

Pointer to the destination surface. See .

Pointer to the destination rectangle. A null for this parameter causes the entire destination surface to be used.

Filter type. Allowable values are , , or . For more information, see .

If the method succeeds, the return value is . If the method fails, the return value can be: .

StretchRect Restrictions

  • Driver support varies. See the section on driver support (below) to see which drivers support which source and destination formats.
  • The source and destination surfaces must be created in the default memory pool.
  • If filtering is specified, you must set the appropriate filter caps (see StretchRectFilterCaps in ).
  • Stretching is not supported between source and destination rectangles on the same surface.
  • Stretching is not supported if the destination surface is an off-screen plain surface but the source is not.
  • You many not stretch between source and destination rectangles if either surface is in a compressed format (see Using Compressed Textures (Direct3D 9)).
  • Stretching supports color-space conversion from YUV to high-precision RGBA only. Since color conversion support is not supported by software emulation, use to test the hardware for color conversion support.
  • If the source or destination surface is a texture surface (or a cube texture surface), you must use a Direct3D 9 driver that supports (see ).

Additional Restrictions for Depth and Stencil Surfaces

  • The source and destination surfaces must be plain depth stencil surfaces (not textures) (see ).
  • Neither of the surfaces can be discardable.
  • The entire surface must be copied (that is: sub-rectangle copies are not allowed).
  • Format conversion, stretching, and shrinking are not supported.
  • StretchRect cannot be called inside of a BeginScene/EndScene pair.

Using StretchRect to downsample a Multisample Rendertarget

You can use StretchRect to copy from one rendertarget to another. If the source rendertarget is multisampled, this results in downsampling the source rendertarget. For instance you could:

  • Create a multisampled rendertarget.
  • Create a second rendertarget of the same size, that is not multisampled.
  • Copy (using StretchRect the multisample rendertarget to the second rendertarget.

Note that use of the extra surface involved in using StretchRect to downsample a Multisample Rendertarget will result in a performance hit.

Driver Support

There are many restrictions as to which surface combinations are valid for StretchRect. Factors include whether the driver is a Direct3D 9 driver or older, and whether the operation will result in stretching/shrinking. Since applications are not expected to recognize if the driver is a Direct3D 9 driver or not, the runtime will automatically set a new cap, cap (see ), for Direct3D 9-level drivers and above.

DirectX 8 Driver (no stretching)
Dest formats
TextureRT textureRTOff-screen plain
Src formatsTextureNoNoNoNo
RT textureNoYesYesNo
RTNoYesYesNo
Off-screen plainYesYesYesYes

?

DirectX 8 Driver (stretching)
Dest formats
TextureRT textureRTOff-screen plain
Src formatsTextureNoNoNoNo
RT textureNoNoNoNo
RTNoYesYesNo
Off-screen plainNoYesYesNo

?

Direct3D 9 Driver (no stretching)
Dest formats
TextureRT textureRTOff-screen plain
Src formatsTextureNoYesYesNo
RT textureNoYesYesNo
RTNoYesYesNo
Off-screen plainNoYesYesYes

?

Direct3D 9 Driver (stretching)
Dest formats
TextureRT textureRTOff-screen plain
Src formatsTextureNoYesYesNo
RT textureNoYesYesNo
RTNoYesYesNo
Off-screen plainNoYesYesNo

?

bb174471 HRESULT IDirect3DDevice9::StretchRect([In] IDirect3DSurface9* pSourceSurface,[In, Optional] const RECT* pSourceRect,[In] IDirect3DSurface9* pDestSurface,[In, Optional] const RECT* pDestRect,[In] D3DTEXTUREFILTERTYPE Filter) IDirect3DDevice9::StretchRect

Allows an application to fill a rectangular area of a surface with a specified color.

Pointer to the surface to be filled.

Pointer to the source rectangle. Using null means that the entire surface will be filled.

Color used for filling.

If the method succeeds, the return value is . If the method fails, the return value can be .

This method can only be applied to a render target, a render-target texture surface, or an off-screen plain surface with a pool type of .

will work with all formats. However, when using a reference or software device, the only formats supported are , , , , , , , , , , , , , , and .

When using a DirectX 7 or DirectX 8.x driver, the only YUV formats supported are and .

bb174353 HRESULT IDirect3DDevice9::ColorFill([In] IDirect3DSurface9* pSurface,[In, Optional] const RECT* pRect,[In] D3DCOLOR color) IDirect3DDevice9::ColorFill

Create an off-screen surface.

Width of the surface.

Height of the surface.

Format of the surface. See .

Surface pool type. See .

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

Pointer to the interface created.

will return a surface that has identical characteristics to a surface created by the DirectX 8.x method CreateImageSurface.

is the appropriate pool for use with the and .

is not allowed when creating an offscreen plain surface. For more information about memory pools, see .

Off-screen plain surfaces are always lockable, regardless of their pool types.

bb174358 HRESULT IDirect3DDevice9::CreateOffscreenPlainSurface([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) IDirect3DDevice9::CreateOffscreenPlainSurface

Sets a new color buffer for the device.

Index of the render target. See Remarks.

Pointer to a new color buffer. If null, the color buffer for the corresponding RenderTargetIndex is disabled. Devices always must be associated with a color buffer. The new render-target surface must have at least specified.

If the method succeeds, the return value is . This method will return if either:

  • pRenderTarget = null and RenderTargetIndex = 0
  • pRenderTarget is != null and the render target is invalid.

The device can support multiple render targets. The number of render targets supported by a device is contained in the NumSimultaneousRTs member of . See Multiple Render Targets (Direct3D 9).

Setting a new render target will cause the viewport (see Viewports and Clipping (Direct3D 9)) to be set to the full size of the new render target.

Some hardware tests the compatibility of the depth stencil buffer with the color buffer. If this is done, it is only done in a debug build.

Restrictions for using this method include the following:

  • The multisample type must be the same for the render target and the depth stencil surface.
  • The formats must be compatible for the render target and the depth stencil surface. See .
  • The size of the depth stencil surface must be greater than or equal to the size of the render target.

These restrictions are validated only when using the debug runtime when any of the Draw methods are called.

Cube textures differ from other surfaces in that they are collections of surfaces. To call with a cube texture, you must select an individual face using and pass the resulting surface to .

bb174455 HRESULT IDirect3DDevice9::SetRenderTarget([In] unsigned int RenderTargetIndex,[In] IDirect3DSurface9* pRenderTarget) IDirect3DDevice9::SetRenderTarget

Retrieves a render-target surface.

Index of the render target. See Remarks.

Address of a reference to an interface, representing the returned render-target surface for this device.

Typically, methods that return state will not work on a device that is created using . This method however, will work even on a pure device because it returns an interface.

The device can now support multiple render targets. The number of render targets supported by a device is contained in the NumSimultaneousRTs member of . See Multiple Render Targets (Direct3D 9).

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using the interface results in a memory leak.

bb174404 HRESULT IDirect3DDevice9::GetRenderTarget([In] unsigned int RenderTargetIndex,[Out] IDirect3DSurface9** ppRenderTarget) IDirect3DDevice9::GetRenderTarget

Sets the depth stencil surface.

Address of a reference to an interface representing the depth stencil surface. Setting this to null disables the depth stencil operation.

If the method succeeds, the return value is . If pZStencilSurface is other than null, the return value is when the stencil surface is invalid.

Restrictions for using this method include the following:

  • The multisample type must be the same for the render target and the depth stencil surface.
  • The formats must be compatible for the render target and the depth stencil surface. See .
  • The size of the depth stencil surface must be greater than or equal to the size of the render target.

These restrictions are validated only when using the debug runtime when any of the Draw methods are called.

Cube textures differ from other surfaces in that they are collections of surfaces. To call with a cube texture, you must select an individual face using and pass the resulting surface to .

bb174431 HRESULT IDirect3DDevice9::SetDepthStencilSurface([In] IDirect3DSurface9* pNewZStencil) IDirect3DDevice9::SetDepthStencilSurface

Gets the depth-stencil surface owned by the Direct3DDevice object.

Address of a reference to an interface, representing the returned depth-stencil surface.

If the method succeeds, the return value is .If the device doesn't have a depth stencil buffer associated with it, the return value will be . Otherwise, if the method fails, the return value can be .

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb174384 HRESULT IDirect3DDevice9::GetDepthStencilSurface([Out] IDirect3DSurface9** ppZStencilSurface) IDirect3DDevice9::GetDepthStencilSurface

Begins a scene.

If the method succeeds, the return value is . The method will fail with if is called while already in a / pair. This happens only when is called twice without first calling .

Applications must call before performing any rendering and must call when rendering is complete and before calling again.

If fails, the device was unable to begin the scene, and there is no need to call . In fact, calls to will fail if the previous failed. This applies to any application that creates multiple swap chains.

There should be one / pair between any successive calls to present (either or ). should be called once before any rendering is performed, and should be called once after all rendering for a frame has been submitted to the runtime. Multiple non-nested / pairs between calls to present are legal, but having more than one pair may incur a performance hit. To enable maximal parallelism between the CPU and the graphics accelerator, it is advantageous to call as far ahead of calling present as possible.

bb174350 HRESULT IDirect3DDevice9::BeginScene() IDirect3DDevice9::BeginScene

Ends a scene that was begun by calling .

If the method succeeds, the return value is . The method will fail with if is called while already in a / pair. This happens only when is called twice without first calling .

When this method succeeds, the scene has been queued up for rendering by the driver. This is not a synchronous method, so the scene is not guaranteed to have completed rendering when this method returns.

Applications must call before performing any rendering and must call when rendering is complete and before calling again.

If fails, the device was unable to begin the scene, and there is no need to call . In fact, calls to will fail if the previous failed. This applies to any application that creates multiple swap chains.

There should be at most one / pair between any successive calls to present (either or ). should be called once before any rendering is performed, and should be called once after all rendering for a frame has been submitted to the runtime. To enable maximal parallelism between the CPU and the graphics accelerator, it is advantageous to call as far ahead of calling present as possible.

bb174375 HRESULT IDirect3DDevice9::EndScene() IDirect3DDevice9::EndScene

Clears one or more surfaces such as a render target, multiple render targets, a stencil buffer, and a depth buffer.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the method succeeds, the return value is . If the method fails, the return value can be: .

Use this method to clear a surface including: a render target, all render targets in an MRT, a stencil buffer, or a depth buffer. Flags determines how many surfaces are cleared. Use pRects to clear a subset of a surface defined by an array of rectangles.

will fail if you:

  • Try to clear either the depth buffer or the stencil buffer of a render target that does not have an attached depth buffer.
  • Try to clear the stencil buffer when the depth buffer does not contain stencil data.
bb174352 HRESULT IDirect3DDevice9::Clear([In] unsigned int Count,[In, Buffer, Optional] const D3DRECT* pRects,[In] D3DCLEAR Flags,[In] D3DCOLOR Color,[In] float Z,[In] unsigned int Stencil) IDirect3DDevice9::Clear

Sets a single device transformation-related state.

Device-state variable that is being modified. This parameter can be any member of the enumerated type, or the D3DTS_WORLDMATRIX macro.

Pointer to a structure that modifies the current transformation.

If the method succeeds, the return value is . is returned if one of the arguments is invalid.

bb174463 HRESULT IDirect3DDevice9::SetTransform([In] int State,[In] const D3DMATRIX* pMatrix) IDirect3DDevice9::SetTransform

Retrieves a matrix describing a transformation state.

Device state variable that is being modified. This parameter can be any member of the enumerated type, or the D3DTS_WORLDMATRIX macro.

Pointer to a structure, describing the returned transformation state.

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other flag values in .

bb174414 HRESULT IDirect3DDevice9::GetTransform([In] D3DTRANSFORMSTATETYPE State,[Out] D3DMATRIX* pMatrix) IDirect3DDevice9::GetTransform

Multiplies a device's world, view, or projection matrices by a specified matrix.

Member of the enumerated type, or the D3DTS_WORLDMATRIX macro that identifies which device matrix is to be modified. The most common setting, D3DTS_WORLDMATRIX(0), modifies the world matrix, but you can specify that the method modify the view or projection matrices, if needed.

Pointer to a structure that modifies the current transformation.

If the method succeeds, the return value is . if one of the arguments is invalid.

The multiplication order is pMatrix times State.

An application might use the method to work with hierarchies of transformations. For example, the geometry and transformations describing an arm might be arranged in the following hierarchy.

 shoulder_transformation upper_arm geometry elbow transformation lower_arm geometry wrist transformation hand geometry	
            

An application might use the following series of calls to render this hierarchy. Not all the parameters are shown in this pseudocode.

 (D3DTS_WORLDMATRIX(0),  shoulder_transform)	
            (upper_arm)	
            (D3DTS_WORLDMATRIX(0),  elbow_transform)	
            (lower_arm)	
            (D3DTS_WORLDMATRIX(0),  wrist_transform)	
            (hand)
bb174422 HRESULT IDirect3DDevice9::MultiplyTransform([In] D3DTRANSFORMSTATETYPE arg0,[In] const D3DMATRIX* arg1) IDirect3DDevice9::MultiplyTransform

Sets the viewport parameters for the device.

Pointer to a structure, specifying the viewport parameters to set.

If the method succeeds, the return value is . If the method fails, it will return . This will happen if pViewport is invalid, or if pViewport describes a region that cannot exist within the render target surface.

Direct3D sets the following default values for the viewport.

  vp;	
            vp.X      = 0;	
            vp.Y      = 0;	
            vp.Width  = RenderTarget.Width;	
            vp.Height = RenderTarget.Height;	
            vp.MinZ   = 0.0f;	
            vp.MaxZ   = 1.0f;	
            

can be used to draw on part of the screen. Make sure to call it before any geometry is drawn so the viewport settings will take effect.

To draw multiple views within a scene, repeat the and draw geometry sequence for each view.

bb174469 HRESULT IDirect3DDevice9::SetViewport([In] const D3DVIEWPORT9* pViewport) IDirect3DDevice9::SetViewport

Retrieves the viewport parameters currently set for the device.

Pointer to a structure, representing the returned viewport parameters.

If the method succeeds, the return value is . is returned if the pViewport parameter is invalid.

Typically, methods that return state will not work on a device that is created using . This method however, will work even on a pure device.

bb174420 HRESULT IDirect3DDevice9::GetViewport([Out] D3DVIEWPORT9* pViewport) IDirect3DDevice9::GetViewport

Sets the material properties for the device.

Pointer to a structure, describing the material properties to set.

If the method succeeds, the return value is . if the pMaterial parameter is invalid.

bb174437 HRESULT IDirect3DDevice9::SetMaterial([In] const D3DMATERIAL9* pMaterial) IDirect3DDevice9::SetMaterial

Retrieves the current material properties for the device.

Pointer to a structure to fill with the currently set material properties.

If the method succeeds, the return value is . if the pMaterial parameter is invalid.

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other values in .

bb174394 HRESULT IDirect3DDevice9::GetMaterial([Out] D3DMATERIAL9* pMaterial) IDirect3DDevice9::GetMaterial

Assigns a set of lighting properties for this device.

Zero-based index of the set of lighting properties to set. If a set of lighting properties exists at this index, it is overwritten by the new properties specified in pLight.

Pointer to a structure, containing the lighting parameters to set.

If the method succeeds, the return value is . If the method fails, the return value can be .

Set light properties by preparing a structure and then calling the method. The method accepts the index at which the device should place the set of light properties to its internal list of light properties, and the address of a prepared structure that defines those properties. You can call with new information as needed to update the light's illumination properties.

The system allocates memory to accommodate a set of lighting properties each time you call the method with an index that has never been assigned properties. Applications can set a number of lights, with only a subset of the assigned lights enabled at a time. Check the MaxActiveLights member of the structure when you retrieve device capabilities to determine the maximum number of active lights supported by that device. If you no longer need a light, you can disable it or overwrite it with a new set of light properties.

The following example prepares and sets properties for a white point-light whose emitted light will not attenuate over distance.

 // Assume d3dDevice is a valid reference to an  interface.	
             d3dLight;	
               hr; // Initialize the structure.	
            ZeroMemory(&d3dLight, sizeof(d3dLight)); // Set up a white point light.	
            d3dLight.Type = ;	
            d3dLight.Diffuse.r  = 1.0f;	
            d3dLight.Diffuse.g  = 1.0f;	
            d3dLight.Diffuse.b  = 1.0f;	
            d3dLight.Ambient.r  = 1.0f;	
            d3dLight.Ambient.g  = 1.0f;	
            d3dLight.Ambient.b  = 1.0f;	
            d3dLight.Specular.r = 1.0f;	
            d3dLight.Specular.g = 1.0f;	
            d3dLight.Specular.b = 1.0f; // Position it high in the scene and behind the user.	
            // Remember, these coordinates are in world space, so	
            // the user could be anywhere in world space, too. 	
            // For the purposes of this example, assume the user	
            // is at the origin of world space.	
            d3dLight.Position.x = 0.0f;	
            d3dLight.Position.y = 1000.0f;	
            d3dLight.Position.z = -100.0f; // Don't attenuate.	
            d3dLight.Attenuation0 = 1.0f; 	
            d3dLight.Range        = 1000.0f; // Set the property information for the first light.	
            hr = d3dDevice->SetLight(0, &d3dLight);	
            if (SUCCEEDED(hr)) // Handle Success	
            else // Handle failure	
            

Enable a light source by calling the method for the device.

bb174436 HRESULT IDirect3DDevice9::SetLight([In] unsigned int Index,[In] const D3DLIGHT9* arg1) IDirect3DDevice9::SetLight

Retrieves a set of lighting properties that this device uses.

Zero-based index of the lighting property set to retrieve. This method will fail if a lighting property has not been set for this index by calling the method.

Pointer to a structure that is filled with the retrieved lighting-parameter set.

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other values in .

Retrieve all the properties for an existing light source by calling the method for the device. When calling the method, pass the zero-based index of the light source for which the properties will be retrieved as the first parameter, and supply the address of a structure as the second parameter. The device fills the structure to describe the lighting properties it uses for the light source at that index.

 // Assume d3dDevice is a valid reference to an  interface.	
             hr;	
            D3DLight9 light; // Get the property information for the first light.	
            hr = pd3dDevice->GetLight(0, &light);	
            if (SUCCEEDED(hr)) // Handle Success	
            else // Handle failure	
            

If you supply an index outside the range of the light sources assigned in the device, the method fails, returning .

When you assign a set of light properties for a light source in a scene, the light source can be activated by calling the method for the device. New light sources are disabled by default. The method accepts two parameters. Set the first parameter to the zero-based index of the light source to be affected by the method, and set the second parameter to TRUE to enable the light or to disable it. The following code example illustrates the use of this method by enabling the first light source in the device's list of light source properties.

 // Assume d3dDevice is a valid reference to an  interface.	
             hr; hr = pd3dDevice->LightEnable(0, TRUE);	
            if (SUCCEEDED(hr)) // Handle Success	
            else // Handle failure	
            

Check the MaxActiveLights member of the structure when you retrieve device capabilities to determine the maximum number of active lights supported by that device.

If you enable or disable a light that has no properties that are set with , the method creates a light source with the properties listed in following table and enables or disables it.

bb174392 HRESULT IDirect3DDevice9::GetLight([In] unsigned int Index,[Out] D3DLIGHT9* arg1) IDirect3DDevice9::GetLight

Enables or disables a set of lighting parameters within a device.

Zero-based index of the set of lighting parameters that are the target of this method.

Value that indicates if the set of lighting parameters are being enabled or disabled. Set this parameter to TRUE to enable lighting with the parameters at the specified index, or to disable it.

If the method succeeds, the return value is . If the method fails, the return value can be .

If a value for LightIndex is outside the range of the light property sets assigned within the device, the method creates a light source represented by a structure with the following properties and sets its enabled state to the value specified in bEnable.

MemberDefault
Type
Diffuse (R:1, G:1, B:1, A:0)
Specular (R:0, G:0, B:0, A:0)
Ambient (R:0, G:0, B:0, A:0)
Position (0, 0, 0)
Direction (0, 0, 1)
Range 0
Falloff 0
Attenuation0 0
Attenuation1 0
Attenuation2 0
Theta 0
Phi 0

?

bb174421 HRESULT IDirect3DDevice9::LightEnable([In] unsigned int Index,[In] BOOL Enable) IDirect3DDevice9::LightEnable

Retrieves the activity status - enabled or disabled - for a set of lighting parameters within a device.

Zero-based index of the set of lighting parameters that are the target of this method.

Pointer to a variable to fill with the status of the specified lighting parameters. After the call, a nonzero value at this address indicates that the specified lighting parameters are enabled; a value of 0 indicates that they are disabled.

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other values in .

bb174393 HRESULT IDirect3DDevice9::GetLightEnable([In] unsigned int Index,[Out] BOOL* pEnable) IDirect3DDevice9::GetLightEnable

Sets the coefficients of a user-defined clipping plane for the device.

Index of the clipping plane for which the plane equation coefficients are to be set.

Pointer to an address of a four-element array of values that represent the clipping plane coefficients to be set, in the form of the general plane equation. See Remarks.

If the method succeeds, the return value is . If the method fails, the return value is . This error indicates that the value in Index exceeds the maximum clipping plane index supported by the device or that the array at pPlane is not large enough to contain four floating-point values.

The coefficients that this method sets take the form of the general plane equation. If the values in the array at pPlane were labeled A, B, C, and D in the order that they appear in the array, they would fit into the general plane equation so that Ax + By + Cz + Dw = 0. A point with homogeneous coordinates (x, y, z, w) is visible in the half space of the plane if Ax + By + Cz + Dw >= 0. Points that exist behind the clipping plane are clipped from the scene.

When the fixed function pipeline is used the plane equations are assumed to be in world space. When the programmable pipeline is used the plane equations are assumed to be in the clipping space (the same space as output vertices).

This method does not enable the clipping plane equation being set. To enable a clipping plane, set the corresponding bit in the DWORD value applied to the render state.

bb174426 HRESULT IDirect3DDevice9::SetClipPlane([In] unsigned int Index,[In] const SHARPDX_VECTOR4* pPlane) IDirect3DDevice9::SetClipPlane

Retrieves the coefficients of a user-defined clipping plane for the device.

Index of the clipping plane for which the plane equation coefficients are retrieved.

Pointer to a four-element array of values that represent the coefficients of the clipping plane in the form of the general plane equation. See Remarks.

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other values in ."

The coefficients that this method reports take the form of the general plane equation. If the values in the array at pPlane were labeled A, B, C, and D in the order that they appear in the array, they would fit into the general plane equation so that Ax + By + Cz + Dw = 0. A point with homogeneous coordinates (x, y, z, w) is visible in the half space of the plane if Ax + By + Cz + Dw >= 0. Points that exist on or behind the clipping plane are clipped from the scene.

The plane equation used by this method exists in world space and is set by a previous call to the method.

bb174380 HRESULT IDirect3DDevice9::GetClipPlane([In] unsigned int Index,[Out] float* pPlane) IDirect3DDevice9::GetClipPlane

Sets a single device render-state parameter.

Device state variable that is being modified. This parameter can be any member of the enumerated type.

New value for the device render state to be set. The meaning of this parameter is dependent on the value specified for State. For example, if State were , the second parameter would be one member of the enumerated type.

If the method succeeds, the return value is . is returned if one of the arguments is invalid.

bb174454 HRESULT IDirect3DDevice9::SetRenderState([In] D3DRENDERSTATETYPE State,[In] unsigned int Value) IDirect3DDevice9::SetRenderState

Retrieves a render-state value for a device.

Device state variable that is being queried. This parameter can be any member of the enumerated type.

Pointer to a variable that receives the value of the queried render state variable when the method returns.

If the method succeeds, the return value is . if one of the arguments is invalid.

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other values in ."

bb174403 HRESULT IDirect3DDevice9::GetRenderState([In] D3DRENDERSTATETYPE State,[In] void* pValue) IDirect3DDevice9::GetRenderState

Creates a new state block that contains the values for all device states, vertex-related states, or pixel-related states.

Type of state data that the method should capture. This parameter can be set to a value defined in the enumerated type.

Pointer to a state block interface. See .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , E_OUTOFMEMORY.

Vertex-related device states typically refer to those states that affect how the system processes vertices. Pixel-related states generally refer to device states that affect how the system processes pixel or depth-buffer data during rasterization. Some states are contained in both groups.

Differences between Direct3D 9 and Direct3D 10:

In Direct3D 9, a state block contains state data, for the states it was requested to capture, when the object is created. To change the value of the state block, call or /. There is no state saved when a state block object is created in Direct3D 10.

?

bb174362 HRESULT IDirect3DDevice9::CreateStateBlock([In] D3DSTATEBLOCKTYPE Type,[Out, Fast] IDirect3DStateBlock9** ppSB) IDirect3DDevice9::CreateStateBlock

Signals Direct3D to begin recording a device-state block.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

Applications can ensure that all recorded states are valid by calling the method prior to calling this method.

The following methods can be recorded in a state block, after calling and before .

The ordering of state changes in a state block is not guaranteed. If the same state is specified multiple times in a state block, only the last value is used.

bb174351 HRESULT IDirect3DDevice9::BeginStateBlock() IDirect3DDevice9::BeginStateBlock

Signals Direct3D to stop recording a device-state block and retrieve a reference to the state block interface.

Pointer to a state block interface. See .

bb174376 HRESULT IDirect3DDevice9::EndStateBlock([In] IDirect3DStateBlock9** ppSB) IDirect3DDevice9::EndStateBlock

Sets the clip status.

Pointer to a structure, describing the clip status settings to be set.

If the method succeeds, the return value is . If one of the arguments is invalid, the return value is .

Clip status is used during software vertex processing. Therefore, this method is not supported on pure or nonpure hardware processing devices. For more information about pure devices, see .

When clipping is enabled during vertex processing (by , , or other drawing functions), Direct3D computes a clip code for every vertex. The clip code is a combination of D3DCS_* bits. When a vertex is outside a particular clipping plane, the corresponding bit is set in the clipping code. Direct3D maintains the clip status using , which has ClipUnion and ClipIntersection members. ClipUnion is a bitwise "OR" of all vertex clip codes and ClipIntersection is a bitwise "AND" of all vertex clip codes. Initial values are zero for ClipUnion and 0xFFFFFFFF for ClipIntersection. When is set to , ClipUnion and ClipIntersection are set to zero. Direct3D updates the clip status during drawing calls. To compute clip status for a particular object, set ClipUnion and ClipIntersection to their initial value and continue drawing.

Clip status is not updated by and because there is no software emulation for them.

bb174427 HRESULT IDirect3DDevice9::SetClipStatus([In] const D3DCLIPSTATUS9* pClipStatus) IDirect3DDevice9::SetClipStatus

Retrieves the clip status.

Pointer to a structure that describes the clip status.

If the method succeeds, the return value is .

is returned if the argument is invalid.

When clipping is enabled during vertex processing (by , , or other drawing functions), Direct3D computes a clip code for every vertex. The clip code is a combination of D3DCS_* bits. When a vertex is outside a particular clipping plane, the corresponding bit is set in the clipping code. Direct3D maintains the clip status using , which has ClipUnion and ClipIntersection members. ClipUnion is a bitwise "OR" of all vertex clip codes and ClipIntersection is a bitwise "AND" of all vertex clip codes. Initial values are zero for ClipUnion and 0xFFFFFFFF for ClipIntersection. When is set to , ClipUnion and ClipIntersection are set to zero. Direct3D updates the clip status during drawing calls. To compute clip status for a particular object, set ClipUnion and ClipIntersection to their initial value and continue drawing.

Clip status is not updated by and because there is no software emulation for them.

Clip status is used during software vertex processing. Therefore, this method is not supported on pure or nonpure hardware processing devices. For more information about pure devices, see .

bb174381 HRESULT IDirect3DDevice9::GetClipStatus([Out] D3DCLIPSTATUS9* pClipStatus) IDirect3DDevice9::GetClipStatus

Retrieves a texture assigned to a stage for a device.

Stage identifier of the texture to retrieve. Stage identifiers are zero-based.

Address of a reference to an interface, representing the returned texture.

Typically, methods that return state will not work on a device that is created using . This method however, will work even on a pure device because it returns an interface.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb174412 HRESULT IDirect3DDevice9::GetTexture([In] unsigned int Stage,[Out] IDirect3DBaseTexture9** ppTexture) IDirect3DDevice9::GetTexture

Assigns a texture to a stage for a device.

Zero based sampler number. Textures are bound to samplers; samplers define sampling state such as the filtering mode and the address wrapping mode. Textures are referenced differently by the programmable and the fixed function pipeline:

  • Programmable shaders reference textures using the sampler number. The number of samplers available to a programmable shader is dependent on the shader version. For vertex shaders, see Sampler (Direct3D 9 asm-vs). For pixel shaders see Sampler (Direct3D 9 asm-ps).
  • The fixed function pipeline on the other hand, references textures by texture stage number. The maximum number of samplers is determined from two caps: MaxSimultaneousTextures and MaxTextureBlendStages of the structure.

There are two other special cases for stage/sampler numbers.

  • A special number called D3DDMAPSAMPLER is used for Displacement Mapping (Direct3D 9).
  • A programmable vertex shader uses a special number defined by a when accessing Vertex Textures in vs_3_0 (DirectX HLSL).

Pointer to an interface, representing the texture being set.

If the method succeeds, the return value is . If the method fails, the return value can be .

SetTexture is not allowed if the texture is created with a pool type of . SetTexture is not allowed with a pool type of texture unless DevCaps is set with .

bb174461 HRESULT IDirect3DDevice9::SetTexture([In] unsigned int Stage,[In] IDirect3DBaseTexture9* pTexture) IDirect3DDevice9::SetTexture

Retrieves a state value for an assigned texture.

Stage identifier of the texture for which the state is retrieved. Stage identifiers are zero-based. Devices can have up to eight set textures, so the maximum value allowed for Stage is 7.

Texture state to retrieve. This parameter can be any member of the enumerated type.

Pointer a variable to fill with the retrieved state value. The meaning of the retrieved value is determined by the Type parameter.

If the method succeeds, the return value is . If the method fails, the return value can be .

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other flag values in ."

bb174413 HRESULT IDirect3DDevice9::GetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] void* pValue) IDirect3DDevice9::GetTextureStageState

Sets the state value for the currently assigned texture.

Stage identifier of the texture for which the state value is set. Stage identifiers are zero-based. Devices can have up to eight set textures, so the maximum value allowed for Stage is 7.

Texture state to set. This parameter can be any member of the enumerated type.

State value to set. The meaning of this value is determined by the Type parameter.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174462 HRESULT IDirect3DDevice9::SetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] unsigned int Value) IDirect3DDevice9::SetTextureStageState

Gets the sampler state value.

The sampler stage index.

This parameter can be any member of the enumerated type.

State value to get. The meaning of this value is determined by the Type parameter.

If the method succeeds, the return value is . If the method fails, the return value can be .

This method will not return device state for a device that is created using . If you want to use this method, you must create your device with any of the other values in ."

bb174406 HRESULT IDirect3DDevice9::GetSamplerState([In] unsigned int Sampler,[In] D3DSAMPLERSTATETYPE Type,[In] void* pValue) IDirect3DDevice9::GetSamplerState

Sets the sampler state value.

The sampler stage index. For more info about sampler stage, see Sampling Stage Registers in vs_3_0 (DirectX HLSL).

This parameter can be any member of the enumerated type.

State value to set. The meaning of this value is determined by the Type parameter.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174456 HRESULT IDirect3DDevice9::SetSamplerState([In] unsigned int Sampler,[In] D3DSAMPLERSTATETYPE Type,[In] unsigned int Value) IDirect3DDevice9::SetSamplerState

Reports the device's ability to render the current texture-blending operations and arguments in a single pass.

Pointer to a DWORD value to fill with the number of rendering passes needed to complete the desired effect through multipass rendering.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , , , , , , , , , , ,.

The method should be used to validate scenarios only when other capabilities are deficient. For example, in a multistage texturing scenario, you could query the MaxTextureBlendStages and MaxSimultaneousTextures members of a structure to determine if multistage texturing is possible on the device.

Current hardware does not necessarily implement all possible combinations of operations and arguments. You can determine whether a particular blending operation can be performed with given arguments by setting the desired blending operation, and then calling the method.

The method uses the current render states, textures, and texture-stage states to perform validation at the time of the call. Changes to these factors after the call invalidate the previous result, and the method must be called again before rendering a scene.

For best performance, call at initialization time; do not use it within a render loop.

Using diffuse iterated values, either as an argument or as an operation (D3DTA_DIFFUSED3DTOP_BLENDDIFFUSEALPHA) is rarely supported on current hardware. Most hardware can introduce iterated color data only at the last texture operation stage.

Try to specify the texture () for each stage as the first argument, rather than the second argument.

Many cards do not support use of diffuse or scalar values at arbitrary texture stages. Often, these are available only at the first or last texture-blending stage.

Many cards do not have a blending unit associated with the first texture that is capable of more than replicating alpha to color channels or inverting the input. Therefore, your application might need to use only the second texture stage, if possible. On such hardware, the first unit is presumed to be in its default state, which has the first color argument set to with the operation.

Operations on the output alpha that are more intricate than or substantially different from the color operations are less likely to be supported.

Some hardware does not support simultaneous use of and .

Many cards do not support simultaneous use of multiple textures and mipmapped trilinear filtering. If trilinear filtering has been requested for a texture involved in multitexture blending operations and validation fails, turn off trilinear filtering and revalidate. In this case, you might want to perform multipass rendering instead.

bb205859 HRESULT IDirect3DDevice9::ValidateDevice([In] unsigned int* pNumPasses) IDirect3DDevice9::ValidateDevice

Sets palette entries.

An ordinal value identifying the particular palette upon which the operation is to be performed.

Pointer to a structure, representing the palette entries to set. The number of structures pointed to by pEntries is assumed to be 256. See Remarks.

If the method succeeds, the return value is . If the method fails, the return value can be .

For Direct3D 9 applications, any palette sent to this method must conform to the capability bit of the structure. If is not set, every entry in the palette must have alpha set to 1.0 or this method will fail with . If is set, then any set of alpha values are allowed. Note that the debug runtime will print a warning message if all palette entries have alpha set to 0.

A single logical palette is associated with the device, and is shared by all texture stages.

bb174439 HRESULT IDirect3DDevice9::SetPaletteEntries([In] unsigned int PaletteNumber,[In, Buffer] const PALETTEENTRY* pEntries) IDirect3DDevice9::SetPaletteEntries

Retrieves palette entries.

An ordinal value identifying the particular palette to retrieve.

Pointer to a structure, representing the returned palette entries.

If the method succeeds, the return value is . If the method fails, the return value can be .

For more information about , see the Platform SDK.

Note??As of Direct3D 9, the peFlags member of the structure does not work the way it is documented in the Platform SDK. The peFlags member is now the alpha channel for 8-bit palettized formats.

bb174397 HRESULT IDirect3DDevice9::GetPaletteEntries([In] unsigned int PaletteNumber,[In, Buffer] PALETTEENTRY* pEntries) IDirect3DDevice9::GetPaletteEntries

Sets the current texture palette.

Value that specifies the texture palette to set as the current texture palette.

If the method succeeds, the return value is . If the method fails, the return value can be .

A single logical palette is associated with the device, and is shared by all texture stages.

bb174428 HRESULT IDirect3DDevice9::SetCurrentTexturePalette([In] unsigned int PaletteNumber) IDirect3DDevice9::SetCurrentTexturePalette

Retrieves the current texture palette.

Pointer to a returned value that identifies the current texture palette.

If the method succeeds, the return value is . If the method fails, the return value can be: .

bb174383 HRESULT IDirect3DDevice9::GetCurrentTexturePalette([Out] unsigned int* PaletteNumber) IDirect3DDevice9::GetCurrentTexturePalette

Sets the scissor rectangle.

Pointer to a structure that defines the rendering area within the render target if scissor test is enabled. This parameter may not be null.

If the method succeeds, the return value is . If the method fails, the return value can be .

The scissor rectangle is used as a rectangular clipping region.

See Rectangles (Direct3D 9) for further information on the use of rectangles in DirectX.

bb174457 HRESULT IDirect3DDevice9::SetScissorRect([In] const RECT* pRect) IDirect3DDevice9::SetScissorRect

Gets the scissor rectangle.

Returns a reference to a structure that defines the rendering area within the render target if scissor test is enabled.

If the method succeeds, the return value is . If the method fails, the return value can be the following: .

The scissor rectangle is used as a rectangular clipping region.

See Rectangles (Direct3D 9) for further information on the use of rectangles in DirectX.

bb174407 HRESULT IDirect3DDevice9::GetScissorRect([Out] RECT* pRect) IDirect3DDevice9::GetScissorRect

Use this method to switch between software and hardware vertex processing.

TRUE to specify software vertex processing; to specify hardware vertex processing.

If the method succeeds, the return value is . If the method fails, the return value can be .

The restrictions for changing modes are as follows:

  • If a device is created with , the vertex processing will be done in software and cannot be changed.
  • If a device is created with , the vertex processing will be done in hardware and cannot be changed.
  • If a device is created with , the vertex processing will be done in hardware by default. The processing can be switched to software (or back to hardware) using .

An application can create a mixed-mode device to use both the software vertex processing and the hardware vertex processing. To switch between the two vertex processing modes in DirectX 8.x, use IDirect3DDevice8::SetRenderState with the render state D3DRS_SOFTWAREVERTEXPROCESSING and the appropriate DWORD argument. The drawback of the render state approach was the difficulty in defining the semantics for state blocks. Applications and the runtime had to do extra work and be careful while recording and playing back state blocks.

In Direct3D 9, use SetSoftwareVertexProcessing instead. This new API is not recorded by StateBlocks.

bb174458 HRESULT IDirect3DDevice9::SetSoftwareVertexProcessing([In] BOOL bSoftware) IDirect3DDevice9::SetSoftwareVertexProcessing

Gets the vertex processing (hardware or software) mode.

Returns TRUE if software vertex processing is set. Otherwise, it returns .

An application can create a mixed-mode device to use both the software vertex processing and the hardware vertex processing. To switch between the two vertex processing modes in DirectX 8.x, use with the render state D3DRS_SOFTWAREVERTEXPROCESSING and the appropriate argument. The drawback of the render state approach was the difficulty in defining the semantics for state blocks. Applications and the runtime had to do extra work and be careful while recording and playing back state blocks.

In Direct3D 9, use instead. This new API is not recorded by StateBlocks.

bb174408 BOOL IDirect3DDevice9::GetSoftwareVertexProcessing() IDirect3DDevice9::GetSoftwareVertexProcessing

Enable or disable N-patches.

Specifies the number of subdivision segments. If the number of segments is less than 1.0, N-patches are disabled. The default value is 0.0.

If the method succeeds, the return value is .

bb174438 HRESULT IDirect3DDevice9::SetNPatchMode([In] float nSegments) IDirect3DDevice9::SetNPatchMode

Gets the N-patch mode segments.

Specifies the number of subdivision segments. If the number of segments is less than 1.0, N-patches are disabled. The default value is 0.0.

bb174395 float IDirect3DDevice9::GetNPatchMode() IDirect3DDevice9::GetNPatchMode

Renders a sequence of nonindexed, geometric primitives of the specified type from the current set of data input streams.

Member of the enumerated type, describing the type of primitive to render.

Index of the first vertex to load. Beginning at StartVertex the correct number of vertices will be read out of the vertex buffer.

Number of primitives to render. The maximum number of primitives allowed is determined by checking the MaxPrimitiveCount member of the structure. PrimitiveCount is the number of primitives as determined by the primitive type. If it is a line list, each primitive has two vertices. If it is a triangle list, each primitive has three vertices.

If the method succeeds, the return value is . If the method fails, the return value can be .

When converting a legacy application to Direct3D 9, you must add a call to either to use the fixed function pipeline, or to use a vertex shader before you make any Draw calls.

bb174371 HRESULT IDirect3DDevice9::DrawPrimitive([In] D3DPRIMITIVETYPE PrimitiveType,[In] unsigned int StartVertex,[In] unsigned int PrimitiveCount) IDirect3DDevice9::DrawPrimitive

Based on indexing, renders the specified geometric primitive into an array of vertices.

Member of the enumerated type, describing the type of primitive to render. is not supported with this method. See Remarks.

Offset from the start of the vertex buffer to the first vertex. See Scenario 4.

Minimum vertex index for vertices used during this call. This is a zero based index relative to BaseVertexIndex.

Number of vertices used during this call. The first vertex is located at index: BaseVertexIndex + MinIndex.

Index of the first index to use when accesssing the vertex buffer. Beginning at StartIndex to index vertices from the vertex buffer.

Number of primitives to render. The number of vertices used is a function of the primitive count and the primitive type. The maximum number of primitives allowed is determined by checking the MaxPrimitiveCount member of the structure.

If the method succeeds, the return value is . If the method fails, the return value can be the following: .

This method draws indexed primitives from the current set of data input streams. MinIndex and all the indices in the index stream are relative to the BaseVertexIndex.

The MinIndex and NumVertices parameters specify the range of vertex indices used for each call. These are used to optimize vertex processing of indexed primitives by processing a sequential range of vertices prior to indexing into these vertices. It is invalid for any indices used during this call to reference any vertices outside of this range.

fails if no index array is set.

The member of the enumerated type is not supported and is not a valid type for this method.

When converting a legacy application to Direct3D 9, you must add a call to either to use the fixed function pipeline, or to use a vertex shader before you make any Draw calls.

bb174369 HRESULT IDirect3DDevice9::DrawIndexedPrimitive([In] D3DPRIMITIVETYPE arg0,[In] int BaseVertexIndex,[In] unsigned int MinVertexIndex,[In] unsigned int NumVertices,[In] unsigned int startIndex,[In] unsigned int primCount) IDirect3DDevice9::DrawIndexedPrimitive

Renders data specified by a user memory reference as a sequence of geometric primitives of the specified type.

Member of the enumerated type, describing the type of primitive to render.

Number of primitives to render. The maximum number of primitives allowed is determined by checking the MaxPrimitiveCount member of the structure.

User memory reference to the vertex data.

The number of bytes of data for each vertex. This value may not be 0.

If the method succeeds, the return value is . If the method fails, the return value can be: .

This method is intended for use in applications that are unable to store their vertex data in vertex buffers. This method supports only a single vertex stream. The effect of this call is to use the provided vertex data reference and stride for vertex stream 0. It is invalid to have the declaration of the current vertex shader refer to vertex streams other than stream 0.

Following any call, the stream 0 settings, referenced by , are set to null.

The vertex data passed to does not need to persist after the call. Direct3D completes its access to that data prior to returning from the call.

When converting a legacy application to Direct3D 9, you must add a call to either to use the fixed function pipeline, or to use a vertex shader before you make any Draw calls.

bb174372 HRESULT IDirect3DDevice9::DrawPrimitiveUP([In] D3DPRIMITIVETYPE PrimitiveType,[In] unsigned int PrimitiveCount,[In] const void* pVertexStreamZeroData,[In] unsigned int VertexStreamZeroStride) IDirect3DDevice9::DrawPrimitiveUP

Renders the specified geometric primitive with data specified by a user memory reference.

Member of the enumerated type, describing the type of primitive to render.

Minimum vertex index. This is a zero-based index.

Number of vertices used during this call. The first vertex is located at index: MinVertexIndex.

Number of primitives to render. The maximum number of primitives allowed is determined by checking the MaxPrimitiveCount member of the structure (the number of indices is a function of the primitive count and the primitive type).

User memory reference to the index data.

Member of the enumerated type, describing the format of the index data. The valid settings are either:

User memory reference to the vertex data. The vertex data must be in stream 0.

The number of bytes of data for each vertex. This value may not be 0.

If the method succeeds, the return value is . If the method fails, the return value can be the following: .

This method is intended for use in applications that are unable to store their vertex data in vertex buffers. This method supports only a single vertex stream, which must be declared as stream 0.

Following any call, the stream 0 settings, referenced by , are set to null. Also, the index buffer setting for is set to null.

The vertex data passed to does not need to persist after the call. Direct3D completes its access to that data prior to returning from the call.

When converting a legacy application to Direct3D 9, you must add a call to either to use the fixed function pipeline, or to use a vertex shader before you make any Draw calls.

bb174370 HRESULT IDirect3DDevice9::DrawIndexedPrimitiveUP([In] D3DPRIMITIVETYPE PrimitiveType,[In] unsigned int MinVertexIndex,[In] unsigned int NumVertices,[In] unsigned int PrimitiveCount,[In] const void* pIndexData,[In] D3DFORMAT IndexDataFormat,[In] const void* pVertexStreamZeroData,[In] unsigned int VertexStreamZeroStride) IDirect3DDevice9::DrawIndexedPrimitiveUP

Applies the vertex processing defined by the vertex shader to the set of input data streams, generating a single stream of interleaved vertex data to the destination vertex buffer.

Index of first vertex to load.

Index of first vertex in the destination vertex buffer into which the results are placed.

Number of vertices to process.

Pointer to an interface, the destination vertex buffer representing the stream of interleaved vertex data.

Pointer to an interface that represents the output vertex data declaration. When vertex shader 3.0 or above is set as the current vertex shader, the output vertex declaration must be present.

Processing options. Set this parameter to 0 for default processing. Set to D3DPV_DONOTCOPYDATA to prevent the system from copying vertex data not affected by the vertex operation into the destination buffer. The D3DPV_DONOTCOPYDATA value may be combined with one or more values appropriate for the destination buffer.

If the method succeeds, the return value is . If the method fails, the return value can be .

The order of operations for this method is as follows:

  • Transform vertices to projection space using the world + view + projection matrix.
  • Compute screen coordinates using viewport settings.
  • If clipping is enabled, compute clipping codes and store them in an internal buffer, associated with the destination vertex buffer. If a vertex is inside the viewing frustum, its screen coordinates are computed. If the vertex is outside the viewing frustum, the vertex is stored in the destination vertex buffer in projection space coordinates.
  • Other notes: The user does not have access to the internal clip code buffer. No clipping is done on triangles or any other primitives.

The destination vertex buffer, pDestBuffer, must be created with a nonzero FVF parameter in . The FVF code specified during the call to the method specifies the vertex elements present in the destination vertex buffer.

When Direct3D generates texture coordinates, or copies or transforms input texture coordinates, and the output texture coordinate format defines more texture coordinate components than Direct3D generates, Direct3D does not change these extra components.

bb174424 HRESULT IDirect3DDevice9::ProcessVertices([In] unsigned int SrcStartIndex,[In] unsigned int DestIndex,[In] unsigned int VertexCount,[In] IDirect3DVertexBuffer9* pDestBuffer,[In] IDirect3DVertexDeclaration9* pVertexDecl,[In] D3DLOCK Flags) IDirect3DDevice9::ProcessVertices

Create a vertex shader declaration from the device and the vertex elements.

An array of vertex elements.

Pointer to an reference that returns the created vertex shader declaration.

If the method succeeds, the return value is . If the method fails, the return value can be .

See the Vertex Declaration (Direct3D 9) page for a detailed description of how to map vertex declarations between different versions of DirectX.

bb174365 HRESULT IDirect3DDevice9::CreateVertexDeclaration([In, Buffer] const D3DVERTEXELEMENT9* pVertexElements,[Out, Fast] IDirect3DVertexDeclaration9** ppDecl) IDirect3DDevice9::CreateVertexDeclaration

Sets a Vertex Declaration (Direct3D 9).

No documentation.

If the method succeeds, the return value is . The return value can be .

A vertex declaration is an object that defines the data members of a vertex (i.e. texture coordinates, colors, normals, etc.). This data can be useful for implementing vertex shaders and pixel shaders.

bb174464 HRESULT IDirect3DDevice9::SetVertexDeclaration([In] IDirect3DVertexDeclaration9* pDecl) IDirect3DDevice9::SetVertexDeclaration

Gets a vertex shader declaration.

Pointer to an object that is returned.

If the method succeeds, the return value is . The return value can be .

bb174415 HRESULT IDirect3DDevice9::GetVertexDeclaration([Out] IDirect3DVertexDeclaration9** ppDecl) IDirect3DDevice9::GetVertexDeclaration

Sets the current vertex stream declaration.

DWORD containing the fixed function vertex type. For more information, see .

If the method succeeds, the return value is . If the method fails, the return value can be: .

Here are the steps necessary to initialize and use vertices that have a position, diffuse and specular color, and texture coordinates:

  1. Define the custom vertex type and FVF code.
     struct LVertex	
                { FLOAT    x, y, z;  specular, diffuse; FLOAT    tu, tv;	
                }; const DWORD VertexFVF = ( |  |  |  );	
                
  2. Create a vertex buffer with enough room for four vertices using .
     g_d3dDevice->CreateVertexBuffer( 4*sizeof(LVertex),   , VertexFVF, , &pBigSquareVB, null );	
                
  3. Set the values for each vertex.
     LVertex * v;	
                pBigSquareVB->Lock( 0, 0, (BYTE**)&v, 0 ); v[0].x  = 0.0f;  v[0].y  = 10.0;  v[0].z  = 10.0f;	
                v[0].diffuse  = 0xffff0000;	
                v[0].specular = 0xff00ff00;	
                v[0].tu = 0.0f;  v[0].tv = 0.0f; v[1].x  = 0.0f;  v[1].y  = 0.0f;  v[1].z  = 10.0f;	
                v[1].diffuse  = 0xff00ff00;	
                v[1].specular = 0xff00ffff;	
                v[1].tu = 0.0f;  v[1].tv = 0.0f; v[2].x  = 10.0f; v[2].y  = 10.0f; v[2].z  = 10.0f;	
                v[2].diffuse  = 0xffff00ff;	
                v[2].specular = 0xff000000;	
                v[2].tu = 0.0f;  v[2].tv = 0.0f; v[3].x  = 0.0f; v[3].y  = 10.0f;  v[3].z = 10.0f;	
                v[3].diffuse  = 0xffffff00;	
                v[3].specular = 0xffff0000;	
                v[3].tu = 0.0f; v[3].tv = 0.0f; pBigSquareVB->Unlock();	
                
  4. The vertex buffer has been initialized and is ready to render. The following code example shows how to use the legacy FVF to draw a square.
     g_d3dDevice->SetFVF(VertexFVF);	
                g_d3dDevice->SetStreamSource(0, pBigSquareVB, 0, sizeof(LVertex));	
                g_d3dDevice->DrawPrimitive(, 0 ,2);	
                

Here are the steps necessary to initialize and use vertices that have a position, a normal, and texture coordinates:

  1. Define the custom vertex type and FVF code.
     struct Vertex	
                { FLOAT x, y, z; FLOAT nx, ny, nz; FLOAT tu, tv;	
                }; const DWORD VertexFVF = (  |  |  );	
                
  2. Create a vertex buffer with enough room for four vertices using (similar to the example above).
  3. Set the values for each vertex.
     Vertex * v;	
                pBigSquareVB->Lock(0, 0, (BYTE**)&v, 0); v[0].x  = 0.0f;  v[0].y  = 10.0;  v[0].z  = 10.0f;	
                v[0].nx = 0.0f;  v[0].ny = 1.0f;  v[0].nz = 0.0f;	
                v[0].tu = 0.0f;  v[0].tv = 0.0f; v[1].x  = 0.0f;  v[1].y  = 0.0f;  v[1].z  = 10.0f;	
                v[1].nx = 0.0f;  v[1].ny = 1.0f;  v[1].nz = 0.0f;	
                v[1].tu = 0.0f;  v[1].tv = 0.0f; v[2].x  = 10.0f; v[2].y  = 10.0f; v[2].z  = 10.0f;	
                v[2].nx = 0.0f;  v[2].ny = 1.0f;  v[2].nz = 0.0f;	
                v[2].tu = 0.0f;  v[2].tv = 0.0f; v[3].x  = 0.0f; v[3].y  = 10.0f;  v[3].z = 10.0f;	
                v[3].nx = 0.0f; v[3].ny = 1.0f;   v[3].nz = 0.0f;	
                v[3].tu = 0.0f; v[3].tv = 0.0f; pBigSquareVB->Unlock();	
                
  4. Draw the object (similar to the example above).
bb174433 HRESULT IDirect3DDevice9::SetFVF([In] D3DFVF FVF) IDirect3DDevice9::SetFVF

Gets the fixed vertex function declaration.

A DWORD reference to the fixed function vertex type. For more information, see .

If the method succeeds, the return value is . If the method fails, the return value can be .

The fixed vertex function declaration is a set of FVF flags that determine how vertices processed by the fixed function pipeline will be used.

bb174389 HRESULT IDirect3DDevice9::GetFVF([Out] D3DFVF* pFVF) IDirect3DDevice9::GetFVF

Creates a vertex shader.

Pointer to an array of tokens that represents the vertex shader, including any embedded debug and symbol table information.

  • Use a function such as to create the array from a HLSL shader.
  • Use a function like to create the token array from an assembly language shader.
  • Use a function like to create the array from an effect.

Pointer to the returned vertex shader interface (see ).

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , E_OUTOFMEMORY.

When a device is created, uses the behavior flag to determine whether to process vertices in hardware or software. There are three possibilities:

  • Process vertices in hardware by setting .
  • Process vertices in software by setting .
  • Process vertices in either hardware or software by setting . To switch a mixed-mode device between software and hardware processing, use .

For an example using , see HLSLwithoutEffects Sample.

bb174366 HRESULT IDirect3DDevice9::CreateVertexShader([In] const void* pFunction,[Out, Fast] IDirect3DVertexShader9** ppShader) IDirect3DDevice9::CreateVertexShader

Sets the vertex shader.

Vertex shader interface. For more information, see .

If the method succeeds, the return value is . If the method fails, the return value can be .

To set a fixed-function vertex shader (after having set a programmable vertex shader), call (null) to release the programmable shader, and then call with the fixed-function vertex format.

bb174465 HRESULT IDirect3DDevice9::SetVertexShader([In] IDirect3DVertexShader9* pShader) IDirect3DDevice9::SetVertexShader

Retrieves the currently set vertex shader.

Pointer to a vertex shader interface.

If the method succeeds, the return value is . If ppShader is invalid, is returned.

Typically, methods that return state will not work on a device that is created using . This method however, will work even on a pure device because it returns an interface.

bb174416 HRESULT IDirect3DDevice9::GetVertexShader([Out] IDirect3DVertexShader9** ppShader) IDirect3DDevice9::GetVertexShader

Sets a floating-point vertex shader constant.

Register number that will contain the first constant value.

Pointer to an array of constants.

Number of four float vectors in the array of constants.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174467 HRESULT IDirect3DDevice9::SetVertexShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) IDirect3DDevice9::SetVertexShaderConstantF

Gets a floating-point vertex shader constant.

Register number that will contain the first constant value.

Pointer to an array of constants.

Number of four float vectors in the array of constants.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174418 HRESULT IDirect3DDevice9::GetVertexShaderConstantF([In] unsigned int StartRegister,[In, Buffer] float* pConstantData,[In] unsigned int Vector4fCount) IDirect3DDevice9::GetVertexShaderConstantF

Sets an integer vertex shader constant.

Register number that will contain the first constant value.

Pointer to an array of constants.

Number of four integer vectors in the array of constants.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174468 HRESULT IDirect3DDevice9::SetVertexShaderConstantI([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4iCount) IDirect3DDevice9::SetVertexShaderConstantI

Gets an integer vertex shader constant.

Register number that will contain the first constant value.

Pointer to an array of constants.

Number of four integer vectors in the array of constants.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174419 HRESULT IDirect3DDevice9::GetVertexShaderConstantI([In] unsigned int StartRegister,[In, Buffer] int* pConstantData,[In] unsigned int Vector4iCount) IDirect3DDevice9::GetVertexShaderConstantI

Sets a Boolean vertex shader constant.

Register number that will contain the first constant value.

Pointer to an array of constants.

Number of boolean values in the array of constants.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174466 HRESULT IDirect3DDevice9::SetVertexShaderConstantB([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int BoolCount) IDirect3DDevice9::SetVertexShaderConstantB

Gets a Boolean vertex shader constant.

Register number that will contain the first constant value.

Pointer to an array of constants.

Number of Boolean values in the array of constants.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174417 HRESULT IDirect3DDevice9::GetVertexShaderConstantB([In] unsigned int StartRegister,[In] void* pConstantData,[In] unsigned int BoolCount) IDirect3DDevice9::GetVertexShaderConstantB

Binds a vertex buffer to a device data stream. For more information, see Setting the Stream Source (Direct3D 9).

No documentation. No documentation. No documentation. No documentation.

If the method succeeds, the return value is . If the method fails, the return value can be .

When a FVF vertex shader is used, the stride of the vertex stream must match the vertex size, computed from the FVF. When a declaration is used, the stride should be greater than or equal to the stream size computed from the declaration.

When calling SetStreamSource, the stride is normally required to be equal to the vertex size. However, there are times when you may want to draw multiple instances of the same or similar geometry (such as when using instancing to draw). For this case, use a zero stride to tell the runtime not to increment the vertex buffer offset (ie: use the same vertex data for all instances). For more information about instancing, see Efficiently Drawing Multiple Instances of Geometry (Direct3D 9).

bb174459 HRESULT IDirect3DDevice9::SetStreamSource([In] unsigned int StreamNumber,[In] IDirect3DVertexBuffer9* pStreamData,[In] unsigned int OffsetInBytes,[In] unsigned int Stride) IDirect3DDevice9::SetStreamSource

Retrieves a vertex buffer bound to the specified data stream.

Specifies the data stream, in the range from 0 to the maximum number of streams minus one.

Address of a reference to an interface, representing the returned vertex buffer bound to the specified data stream.

Pointer containing the offset from the beginning of the stream to the beginning of the vertex data. The offset is measured in bytes. See Remarks.

Pointer to a returned stride of the component, in bytes. See Remarks.

If the method succeeds, the return value is . If the method fails, the return value can be .

A stream is defined as a uniform array of component data, where each component consists of one or more elements representing a single entity such as position, normal, color, and so on.

When a FVF vertex shader is used, the stride of the vertex stream must match the vertex size, computed from the FVF. When a declaration is used, the stride should be greater than or equal to the stream size computed from the declaration.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb174409 HRESULT IDirect3DDevice9::GetStreamSource([In] unsigned int StreamNumber,[Out] IDirect3DVertexBuffer9** ppStreamData,[Out] unsigned int* pOffsetInBytes,[Out] unsigned int* pStride) IDirect3DDevice9::GetStreamSource

Sets the stream source frequency divider value. This may be used to draw several instances of geometry.

Stream source number.

This parameter may have two different values. See remarks.

If the method succeeds, the return value is . If the method fails, the return value can be .

There are two constants defined in d3d9types.h that are designed to use with SetStreamSourceFreq: and . To see how to use the constants, see Efficiently Drawing Multiple Instances of Geometry (Direct3D 9).

bb174460 HRESULT IDirect3DDevice9::SetStreamSourceFreq([In] unsigned int StreamNumber,[In] unsigned int Setting) IDirect3DDevice9::SetStreamSourceFreq

Gets the stream source frequency divider value.

Stream source number.

Returns the frequency divider value.

If the method succeeds, the return value is . If the method fails, the return value can be .

Vertex shaders can now be invoked more than once per vertex. See Drawing Non-Indexed Geometry.

bb174410 HRESULT IDirect3DDevice9::GetStreamSourceFreq([In] unsigned int StreamNumber,[Out] unsigned int* pSetting) IDirect3DDevice9::GetStreamSourceFreq

Sets index data.

Pointer to an interface, representing the index data to be set.

If the method succeeds, the return value is . If the method fails, the return value can be: .

When an application no longer holds a references to this interface, the interface will automatically be freed.

The method sets the current index array to an index buffer. The single set of indices is used to index all streams.

bb174435 HRESULT IDirect3DDevice9::SetIndices([In] IDirect3DIndexBuffer9* pIndexData) IDirect3DDevice9::SetIndices

Retrieves index data.

Address of a reference to an interface, representing the returned index data.

If the method succeeds, the return value is . If the method fails, the return value can be .

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb174391 HRESULT IDirect3DDevice9::GetIndices([Out] IDirect3DIndexBuffer9** ppIndexData) IDirect3DDevice9::GetIndices

Creates a pixel shader.

Pointer to the pixel shader function token array, specifying the blending operations. This value cannot be null.

Pointer to the returned pixel shader interface. See .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , E_OUTOFMEMORY.

bb174359 HRESULT IDirect3DDevice9::CreatePixelShader([In] const void* pFunction,[Out, Fast] IDirect3DPixelShader9** ppShader) IDirect3DDevice9::CreatePixelShader

Sets the current pixel shader to a previously created pixel shader.

Pixel shader interface.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174450 HRESULT IDirect3DDevice9::SetPixelShader([In] IDirect3DPixelShader9* pShader) IDirect3DDevice9::SetPixelShader

Retrieves the currently set pixel shader.

Pointer to a pixel shader interface.

If the method succeeds, the return value is . If the method fails, the return value can be .

This method will not work on a device that is created using .

bb174398 HRESULT IDirect3DDevice9::GetPixelShader([Out] IDirect3DPixelShader9** ppShader) IDirect3DDevice9::GetPixelShader

Sets a floating-point shader constant.

Register number that will contain the first constant value.

Pointer to an array of constants.

Number of four float vectors in the array of constants.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174452 HRESULT IDirect3DDevice9::SetPixelShaderConstantF([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4fCount) IDirect3DDevice9::SetPixelShaderConstantF

Gets a floating-point shader constant.

Register number that will contain the first constant value.

Pointer to an array of constants.

Number of four float vectors in the array of constants.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174400 HRESULT IDirect3DDevice9::GetPixelShaderConstantF([In] unsigned int StartRegister,[In, Buffer] float* pConstantData,[In] unsigned int Vector4fCount) IDirect3DDevice9::GetPixelShaderConstantF

Sets an integer shader constant.

Register number that will contain the first constant value.

Pointer to an array of constants.

Number of four integer vectors in the array of constants.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174453 HRESULT IDirect3DDevice9::SetPixelShaderConstantI([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int Vector4iCount) IDirect3DDevice9::SetPixelShaderConstantI

Gets an integer shader constant.

Register number that will contain the first constant value.

Pointer to an array of constants.

Number of four integer vectors in the array of constants.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174401 HRESULT IDirect3DDevice9::GetPixelShaderConstantI([In] unsigned int StartRegister,[In, Buffer] int* pConstantData,[In] unsigned int Vector4iCount) IDirect3DDevice9::GetPixelShaderConstantI

Sets a Boolean shader constant.

Register number that will contain the first constant value.

Pointer to an array of constants.

Number of boolean values in the array of constants.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174451 HRESULT IDirect3DDevice9::SetPixelShaderConstantB([In] unsigned int StartRegister,[In] const void* pConstantData,[In] unsigned int BoolCount) IDirect3DDevice9::SetPixelShaderConstantB

Gets a Boolean shader constant.

Register number that will contain the first constant value.

Pointer to an array of constants.

Number of Boolean values in the array of constants.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174399 HRESULT IDirect3DDevice9::GetPixelShaderConstantB([In] unsigned int StartRegister,[In] void* pConstantData,[In] unsigned int BoolCount) IDirect3DDevice9::GetPixelShaderConstantB

Draws a rectangular patch using the currently set streams.

Handle to the rectangular patch to draw.

Pointer to an array of four floating-point values that identify the number of segments each edge of the rectangle patch should be divided into when tessellated. See .

Pointer to a structure, describing the rectangular patch to draw.

If the method succeeds, the return value is . If the method fails, the return value can be .

For static patches: Set the vertex shader, set the appropriate streams, supply patch information in the pRectPatchInfo parameter, and specify a handle so that Direct3D can capture and cache information. Call subsequently with pRectPatchInfo set to null to efficiently draw the patch. When drawing a cached patch, the currently set streams are ignored. Override the cached pNumSegs by specifying a new value for pNumSegs. When rendering a cached patch, you must set the same vertex shader that was set when it was captured.

Calling with a handle invalidates the same handle cached by a previous call.

For dynamic patches, the patch data changes for every rendering of the patch, so it is not efficient to cache information. The application can convey this to Direct3D by setting Handle to 0. In this case, Direct3D draws the patch using the currently set streams and the pNumSegs values, and does not cache any information. It is not valid to simultaneously set Handle to 0 and pRectPatchInfo to null.

bb174373 HRESULT IDirect3DDevice9::DrawRectPatch([In] unsigned int Handle,[In, Buffer] const float* pNumSegs,[In] const void* pRectPatchInfo) IDirect3DDevice9::DrawRectPatch

Draws a triangular patch using the currently set streams.

Handle to the triangular patch to draw.

Pointer to an array of three floating-point values that identify the number of segments each edge of the triangle patch should be divided into when tessellated. See .

Pointer to a structure, describing the triangular high-order patch to draw.

If the method succeeds, the return value is . If the method fails, the return value can be .

For static patches: Set the vertex shader, set the appropriate streams, supply patch information in the pTriPatchInfo parameter, and specify a handle so that Direct3D can capture and cache information. To efficiently draw the patch, call with pTriPatchInfo set to null. When drawing a cached patch, the currently set streams are ignored. Override the cached pNumSegs by specifying a new value for pNumSegs. When rendering a cached patch, you must set the same vertex shader that was set when it was captured.

Calling with a handle invalidates the same handle cached by a previous call.

For dynamic patches, the patch data changes for every rendering of the patch so it is not efficient to cache information. The application can convey this to Direct3D by setting Handle to 0. In this case, Direct3D draws the patch using the currently set streams and the pNumSegs values, and does not cache any information. It is not valid to simultaneously set Handle to 0 and pTriPatchInfo to null.

bb174374 HRESULT IDirect3DDevice9::DrawTriPatch([In] unsigned int Handle,[In, Buffer] const float* pNumSegs,[In] const void* pTriPatchInfo) IDirect3DDevice9::DrawTriPatch

Frees a cached high-order patch.

Handle of the cached high-order patch to delete.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174368 HRESULT IDirect3DDevice9::DeletePatch([In] unsigned int Handle) IDirect3DDevice9::DeletePatch

Creates a status query.

Identifies the query type. For more information, see .

Returns a reference to the query interface that manages the query object. See .

This parameter can be set to null to see if a query is supported. If the query is not supported, the method returns .

If the method succeeds, the return value is . If the method fails, the return value can be or E_OUTOFMEMORY.

This method is provided for both synchronous and asynchronous queries. It takes the place of GetInfo, which is no longer supported in Direct3D 9.

Synchronous and asynchronous queries are created with with . When a query has been created and the API calls have been made that are being queried, use to issue a query and to get the results of the query.

bb174360 HRESULT IDirect3DDevice9::CreateQuery([In] D3DQUERYTYPE Type,[Out, Fast] IDirect3DQuery9** ppQuery) IDirect3DDevice9::CreateQuery

Applications use the methods of the interface to render primitives, create resources, work with system-level variables, adjust gamma ramp levels, work with palettes, and create shaders. The interface derives from the interface.

The interface is obtained by calling .

The LPDIRECT3DDEVICE9EX and PDIRECT3DDEVICE9EX types are defined as references to the interface:

 typedef struct  *LPDIRECT3DDEVICE9EX, *PDIRECT3DDEVICE9EX;	
            
bb174337 IDirect3DDevice9Ex IDirect3DDevice9Ex
Creates a device to represent the display adapter. an instance of Ordinal number that denotes the display adapter. {{D3DADAPTER_DEFAULT}} is always the primary display adapter. Member of the enumerated type that denotes the desired device type. If the desired device type is not available, the method will fail. The focus window alerts Direct3D when an application switches from foreground mode to background mode. See Remarks. For full-screen mode, the window specified must be a top-level window. For windowed mode, this parameter may be NULL only if the hDeviceWindow member of pPresentationParameters is set to a valid, non-NULL value. Combination of one or more options that control device creation. For more information, see {{D3DCREATE}}. Pointer to a structure, describing the presentation parameters for the device to be created. If BehaviorFlags specifies {{D3DCREATE_ADAPTERGROUP_DEVICE}}, pPresentationParameters is an array. Regardless of the number of heads that exist, only one depth/stencil surface is automatically created. For Windows 2000 and Windows XP, the full-screen device display refresh rate is set in the following order: User-specified nonzero ForcedRefreshRate registry key, if supported by the device. Application-specified nonzero refresh rate value in the presentation parameter. Refresh rate of the latest desktop mode, if supported by the device. 75 hertz if supported by the device. 60 hertz if supported by the device. Device default. An unsupported refresh rate will default to the closest supported refresh rate below it. For example, if the application specifies 63 hertz, 60 hertz will be used. There are no supported refresh rates below 57 hertz. pPresentationParameters is both an input and an output parameter. Calling this method may change several members including: If BackBufferCount, BackBufferWidth, and BackBufferHeight are 0 before the method is called, they will be changed when the method returns. If BackBufferFormat equals before the method is called, it will be changed when the method returns. This method returns a fully working device interface, set to the required display mode (or windowed), and allocated with the appropriate back buffers. To begin rendering, the application needs only to create and set a depth buffer (assuming EnableAutoDepthStencil is FALSE in ). When you create a Direct3D device, you supply two different window parameters: a focus window (hFocusWindow) and a device window (the hDeviceWindow in ). The purpose of each window is: The focus window alerts Direct3D when an application switches from foreground mode to background mode (via Alt-Tab, a mouse click, or some other method). A single focus window is shared by each device created by an application. The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back buffer contents are copied to the front buffer during {{Present}}. This method should not be run during the handling of WM_CREATE. An application should never pass a window handle to Direct3D while handling WM_CREATE. Any call to create, release, or reset the device must be done using the same thread as the window procedure of the focus window. Note that D3DCREATE_HARDWARE_VERTEXPROCESSING, D3DCREATE_MIXED_VERTEXPROCESSING, and D3DCREATE_SOFTWARE_VERTEXPROCESSING are mutually exclusive flags, and at least one of these vertex processing flags must be specified when calling this method. Back buffers created as part of the device are only lockable if D3DPRESENTFLAG_LOCKABLE_BACKBUFFER is specified in the presentation parameters. (Multisampled back buffers and depth surfaces are never lockable.) The methods {{Reset}}, , and {{TestCooperativeLevel}} must be called from the same thread that used this method to create a device. D3DFMT_UNKNOWN can be specified for the windowed mode back buffer format when calling CreateDevice, {{Reset}}, and {{CreateAdditionalSwapChain}}. This means the application does not have to query the current desktop format before calling CreateDevice for windowed mode. For full-screen mode, the back buffer format must be specified. If you attempt to create a device on a 0x0 sized window, CreateDevice will fail. HRESULT CreateDevice([None] UINT Adapter,[None] D3DDEVTYPE DeviceType,[None] HWND hFocusWindow,[None] int BehaviorFlags,[None] D3DPRESENT_PARAMETERS* pPresentationParameters,[None] IDirect3DDevice9** ppReturnedDeviceInterface) Creates a device to represent the display adapter. an instance of Ordinal number that denotes the display adapter. {{D3DADAPTER_DEFAULT}} is always the primary display adapter. Member of the enumerated type that denotes the desired device type. If the desired device type is not available, the method will fail. The focus window alerts Direct3D when an application switches from foreground mode to background mode. See Remarks. For full-screen mode, the window specified must be a top-level window. For windowed mode, this parameter may be NULL only if the hDeviceWindow member of pPresentationParameters is set to a valid, non-NULL value. Combination of one or more options that control device creation. For more information, see {{D3DCREATE}}. Pointer to a structure, describing the presentation parameters for the device to be created. If BehaviorFlags specifies {{D3DCREATE_ADAPTERGROUP_DEVICE}}, pPresentationParameters is an array. Regardless of the number of heads that exist, only one depth/stencil surface is automatically created. For Windows 2000 and Windows XP, the full-screen device display refresh rate is set in the following order: User-specified nonzero ForcedRefreshRate registry key, if supported by the device. Application-specified nonzero refresh rate value in the presentation parameter. Refresh rate of the latest desktop mode, if supported by the device. 75 hertz if supported by the device. 60 hertz if supported by the device. Device default. An unsupported refresh rate will default to the closest supported refresh rate below it. For example, if the application specifies 63 hertz, 60 hertz will be used. There are no supported refresh rates below 57 hertz. pPresentationParameters is both an input and an output parameter. Calling this method may change several members including: If BackBufferCount, BackBufferWidth, and BackBufferHeight are 0 before the method is called, they will be changed when the method returns. If BackBufferFormat equals before the method is called, it will be changed when the method returns. This method returns a fully working device interface, set to the required display mode (or windowed), and allocated with the appropriate back buffers. To begin rendering, the application needs only to create and set a depth buffer (assuming EnableAutoDepthStencil is FALSE in ). When you create a Direct3D device, you supply two different window parameters: a focus window (hFocusWindow) and a device window (the hDeviceWindow in ). The purpose of each window is: The focus window alerts Direct3D when an application switches from foreground mode to background mode (via Alt-Tab, a mouse click, or some other method). A single focus window is shared by each device created by an application. The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back buffer contents are copied to the front buffer during {{Present}}. This method should not be run during the handling of WM_CREATE. An application should never pass a window handle to Direct3D while handling WM_CREATE. Any call to create, release, or reset the device must be done using the same thread as the window procedure of the focus window. Note that D3DCREATE_HARDWARE_VERTEXPROCESSING, D3DCREATE_MIXED_VERTEXPROCESSING, and D3DCREATE_SOFTWARE_VERTEXPROCESSING are mutually exclusive flags, and at least one of these vertex processing flags must be specified when calling this method. Back buffers created as part of the device are only lockable if D3DPRESENTFLAG_LOCKABLE_BACKBUFFER is specified in the presentation parameters. (Multisampled back buffers and depth surfaces are never lockable.) The methods {{Reset}}, , and {{TestCooperativeLevel}} must be called from the same thread that used this method to create a device. D3DFMT_UNKNOWN can be specified for the windowed mode back buffer format when calling CreateDevice, {{Reset}}, and {{CreateAdditionalSwapChain}}. This means the application does not have to query the current desktop format before calling CreateDevice for windowed mode. For full-screen mode, the back buffer format must be specified. If you attempt to create a device on a 0x0 sized window, CreateDevice will fail. HRESULT CreateDevice([None] UINT Adapter,[None] D3DDEVTYPE DeviceType,[None] HWND hFocusWindow,[None] int BehaviorFlags,[None] D3DPRESENT_PARAMETERS* pPresentationParameters,[None] IDirect3DDevice9** ppReturnedDeviceInterface) Creates a device to represent the display adapter. an instance of Ordinal number that denotes the display adapter. {{D3DADAPTER_DEFAULT}} is always the primary display adapter. Member of the enumerated type that denotes the desired device type. If the desired device type is not available, the method will fail. The focus window alerts Direct3D when an application switches from foreground mode to background mode. See Remarks. For full-screen mode, the window specified must be a top-level window. For windowed mode, this parameter may be NULL only if the hDeviceWindow member of pPresentationParameters is set to a valid, non-NULL value. Combination of one or more options that control device creation. For more information, see {{D3DCREATE}}. Pointer to a structure, describing the presentation parameters for the device to be created. If BehaviorFlags specifies {{D3DCREATE_ADAPTERGROUP_DEVICE}}, pPresentationParameters is an array. Regardless of the number of heads that exist, only one depth/stencil surface is automatically created. For Windows 2000 and Windows XP, the full-screen device display refresh rate is set in the following order: User-specified nonzero ForcedRefreshRate registry key, if supported by the device. Application-specified nonzero refresh rate value in the presentation parameter. Refresh rate of the latest desktop mode, if supported by the device. 75 hertz if supported by the device. 60 hertz if supported by the device. Device default. An unsupported refresh rate will default to the closest supported refresh rate below it. For example, if the application specifies 63 hertz, 60 hertz will be used. There are no supported refresh rates below 57 hertz. pPresentationParameters is both an input and an output parameter. Calling this method may change several members including: If BackBufferCount, BackBufferWidth, and BackBufferHeight are 0 before the method is called, they will be changed when the method returns. If BackBufferFormat equals before the method is called, it will be changed when the method returns. The full screen display mode. This method returns a fully working device interface, set to the required display mode (or windowed), and allocated with the appropriate back buffers. To begin rendering, the application needs only to create and set a depth buffer (assuming EnableAutoDepthStencil is FALSE in ). When you create a Direct3D device, you supply two different window parameters: a focus window (hFocusWindow) and a device window (the hDeviceWindow in ). The purpose of each window is: The focus window alerts Direct3D when an application switches from foreground mode to background mode (via Alt-Tab, a mouse click, or some other method). A single focus window is shared by each device created by an application. The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back buffer contents are copied to the front buffer during {{Present}}. This method should not be run during the handling of WM_CREATE. An application should never pass a window handle to Direct3D while handling WM_CREATE. Any call to create, release, or reset the device must be done using the same thread as the window procedure of the focus window. Note that D3DCREATE_HARDWARE_VERTEXPROCESSING, D3DCREATE_MIXED_VERTEXPROCESSING, and D3DCREATE_SOFTWARE_VERTEXPROCESSING are mutually exclusive flags, and at least one of these vertex processing flags must be specified when calling this method. Back buffers created as part of the device are only lockable if D3DPRESENTFLAG_LOCKABLE_BACKBUFFER is specified in the presentation parameters. (Multisampled back buffers and depth surfaces are never lockable.) The methods {{Reset}}, , and {{TestCooperativeLevel}} must be called from the same thread that used this method to create a device. D3DFMT_UNKNOWN can be specified for the windowed mode back buffer format when calling CreateDevice, {{Reset}}, and {{CreateAdditionalSwapChain}}. This means the application does not have to query the current desktop format before calling CreateDevice for windowed mode. For full-screen mode, the back buffer format must be specified. If you attempt to create a device on a 0x0 sized window, CreateDevice will fail. HRESULT CreateDevice([None] UINT Adapter,[None] D3DDEVTYPE DeviceType,[None] HWND hFocusWindow,[None] int BehaviorFlags,[None] D3DPRESENT_PARAMETERS* pPresentationParameters,[None] IDirect3DDevice9** ppReturnedDeviceInterface) Creates a device to represent the display adapter. an instance of Ordinal number that denotes the display adapter. {{D3DADAPTER_DEFAULT}} is always the primary display adapter. Member of the enumerated type that denotes the desired device type. If the desired device type is not available, the method will fail. The focus window alerts Direct3D when an application switches from foreground mode to background mode. See Remarks. For full-screen mode, the window specified must be a top-level window. For windowed mode, this parameter may be NULL only if the hDeviceWindow member of pPresentationParameters is set to a valid, non-NULL value. Combination of one or more options that control device creation. For more information, see {{D3DCREATE}}. Pointer to a structure, describing the presentation parameters for the device to be created. If BehaviorFlags specifies {{D3DCREATE_ADAPTERGROUP_DEVICE}}, pPresentationParameters is an array. Regardless of the number of heads that exist, only one depth/stencil surface is automatically created. For Windows 2000 and Windows XP, the full-screen device display refresh rate is set in the following order: User-specified nonzero ForcedRefreshRate registry key, if supported by the device. Application-specified nonzero refresh rate value in the presentation parameter. Refresh rate of the latest desktop mode, if supported by the device. 75 hertz if supported by the device. 60 hertz if supported by the device. Device default. An unsupported refresh rate will default to the closest supported refresh rate below it. For example, if the application specifies 63 hertz, 60 hertz will be used. There are no supported refresh rates below 57 hertz. pPresentationParameters is both an input and an output parameter. Calling this method may change several members including: If BackBufferCount, BackBufferWidth, and BackBufferHeight are 0 before the method is called, they will be changed when the method returns. If BackBufferFormat equals before the method is called, it will be changed when the method returns. The full screen display mode. This method returns a fully working device interface, set to the required display mode (or windowed), and allocated with the appropriate back buffers. To begin rendering, the application needs only to create and set a depth buffer (assuming EnableAutoDepthStencil is FALSE in ). When you create a Direct3D device, you supply two different window parameters: a focus window (hFocusWindow) and a device window (the hDeviceWindow in ). The purpose of each window is: The focus window alerts Direct3D when an application switches from foreground mode to background mode (via Alt-Tab, a mouse click, or some other method). A single focus window is shared by each device created by an application. The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back buffer contents are copied to the front buffer during {{Present}}. This method should not be run during the handling of WM_CREATE. An application should never pass a window handle to Direct3D while handling WM_CREATE. Any call to create, release, or reset the device must be done using the same thread as the window procedure of the focus window. Note that D3DCREATE_HARDWARE_VERTEXPROCESSING, D3DCREATE_MIXED_VERTEXPROCESSING, and D3DCREATE_SOFTWARE_VERTEXPROCESSING are mutually exclusive flags, and at least one of these vertex processing flags must be specified when calling this method. Back buffers created as part of the device are only lockable if D3DPRESENTFLAG_LOCKABLE_BACKBUFFER is specified in the presentation parameters. (Multisampled back buffers and depth surfaces are never lockable.) The methods {{Reset}}, , and {{TestCooperativeLevel}} must be called from the same thread that used this method to create a device. D3DFMT_UNKNOWN can be specified for the windowed mode back buffer format when calling CreateDevice, {{Reset}}, and {{CreateAdditionalSwapChain}}. This means the application does not have to query the current desktop format before calling CreateDevice for windowed mode. For full-screen mode, the back buffer format must be specified. If you attempt to create a device on a 0x0 sized window, CreateDevice will fail. HRESULT CreateDevice([None] UINT Adapter,[None] D3DDEVTYPE DeviceType,[None] HWND hFocusWindow,[None] int BehaviorFlags,[None] D3DPRESENT_PARAMETERS* pPresentationParameters,[None] IDirect3DDevice9** ppReturnedDeviceInterface) Reports the current cooperative-level status of the Direct3D device for a windowed or full-screen application. The window handle. State of the device HRESULT IDirect3DDevice9Ex::CheckDeviceState([In] HWND hDestinationWindow) Checks an array of resources to determine if it is likely that they will cause a large stall at Draw time because the system must make the resources GPU-accessible. An array of that indicate the resources to check. The status. HRESULT IDirect3DDevice9Ex::CheckDeviceState([In] HWND hDestinationWindow) Retrieves the display mode's spatial resolution, color resolution, refresh frequency, and rotation settings. The swap chain. structure containing data about the display mode of the adapter HRESULT IDirect3DDevice9Ex::GetDisplayModeEx([In] unsigned int iSwapChain,[Out] D3DDISPLAYMODEEX* pMode,[In] void* pRotation) Retrieves the display mode's spatial resolution, color resolution, refresh frequency, and rotation settings. The swap chain. The structure indicating the type of screen rotation the application will do. structure containing data about the display mode of the adapter HRESULT IDirect3DDevice9Ex::GetDisplayModeEx([In] unsigned int iSwapChain,[Out] D3DDISPLAYMODEEX* pMode,[In] void* pRotation) Swap the swapchain's next buffer with the front buffer. The flags. A object describing the result of the operation. HRESULT IDirect3DDevice9Ex::PresentEx([In] const void* pSourceRect,[In] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) Swap the swapchain's next buffer with the front buffer. The flags. The source rectangle. The destination rectangle. A object describing the result of the operation. HRESULT IDirect3DDevice9Ex::PresentEx([In] const void* pSourceRect,[In] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) Swap the swapchain's next buffer with the front buffer. The flags. The source rectangle. The destination rectangle. The window override. A object describing the result of the operation. HRESULT IDirect3DDevice9Ex::PresentEx([In] const void* pSourceRect,[In] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) Swap the swapchain's next buffer with the front buffer. The flags. The source rectangle. The destination rectangle. The window override. The region. A object describing the result of the operation. HRESULT IDirect3DDevice9Ex::PresentEx([In] const void* pSourceRect,[In] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) Resets the type, size, and format of the swap chain with all other surfaces persistent. A reference describing the new presentation parameters. A object describing the result of the operation. HRESULT IDirect3DDevice9Ex::ResetEx([In] D3DPRESENT_PARAMETERS* pPresentationParameters,[In] void* pFullscreenDisplayMode) Resets the type, size, and format of the swap chain with all other surfaces persistent. A reference describing the new presentation parameters. The full screen display mode. A object describing the result of the operation. HRESULT IDirect3DDevice9Ex::ResetEx([In] D3DPRESENT_PARAMETERS* pPresentationParameters,[In] void* pFullscreenDisplayMode) Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Get or sets the priority of the GPU thread.

Use to set the priority of a thread.

This method will retrieve the priority of the thread stored with the Direct3D device even if it was created with the flag.

bb174341 GetGPUThreadPriority / SetGPUThreadPriority GetGPUThreadPriority HRESULT IDirect3DDevice9Ex::GetGPUThreadPriority([Out] int* pPriority)

Retrieves or sets the number of frames of data that the system is allowed to queue.

Frame latency is the number of frames that are allowed to be stored in a queue, before submission for rendering. Latency is often used to control how the CPU chooses between responding to user input and frames that are in the render queue.

It is often beneficial for applications that have no user input (for example, video playback) to queue more than 3 frames of data.

bb174342 GetMaximumFrameLatency / SetMaximumFrameLatency GetMaximumFrameLatency HRESULT IDirect3DDevice9Ex::GetMaximumFrameLatency([Out] unsigned int* pMaxLatency)

Prepare the texture sampler for monochrome convolution filtering on a single-color texture.

The width of the filter kernel; ranging from 1 - D3DCONVOLUTIONMONO_MAXWIDTH. The default value is 1.

The height of the filter kernel; ranging from 1 - D3DCONVOLUTIONMONO_MAXHEIGHT. The default value is 1.

An array of weights, one weight for each kernel sub-element in the width. This parameter must be null, which will set the weights equal to the default value.

An array of weights, one weight for each kernel sub-element in the height. This parameter must be null, which will set the weights equal to the default value.

If the method succeeds, the return value is .

This method is designed to filter a single color texture. A monochrome convolution filter is a 2D box filter with all of the weights set to 1.0; the filter kernel resolution ranges from 1 x 1 to 7 x 7. When monochrome texture filtering is set to a texture sampler and texture sampling is performed at location, then Direct3D performs convolution.

Restrictions include:

  • The filter specified by this method is recorded in state blocks as a part of .
  • The only texture address mode supported is: ; the border color is always 0.
  • This method is not supported for mipmaps.
  • Using a non-monochrome texture with convolution filtering will generate a driver error.
bb174345 HRESULT IDirect3DDevice9Ex::SetConvolutionMonoKernel([In] unsigned int width,[In] unsigned int height,[In, Buffer] float* rows,[In, Buffer] float* columns) IDirect3DDevice9Ex::SetConvolutionMonoKernel

Copy a text string to one surface using an alphabet of glyphs on another surface. Composition is done by the GPU using bitwise operations.

A reference to a source surface (prepared by ) that supplies the alphabet glyphs. This surface must be created with the flag.

A reference to the destination surface (prepared by ) that receives the glyph data. The surface must be part of a texture.

A reference to a vertex buffer (see ) containing rectangles (see D3DCOMPOSERECTDESC) that enclose the desired glyphs in the source surface.

The number of rectangles or glyphs that are used in the operation. The number applies to both the source and destination surfaces. The range is 0 to D3DCOMPOSERECTS_MAXNUMRECTS.

A reference to a vertex buffer (see ) containing rectangles (see D3DCOMPOSERECTDESTINATION) that describe the destination to which the indicated glyph from the source surface will be copied.

Specifies how to combine the source and destination surfaces. See .

A value added to the x coordinates of all destination rectangles. This value can be negative, which may cause the glyph to be rejected or clipped if the result is beyond the bounds of the surface.

A value added to the y coordinates of all destination rectangles. This value can be negative, which may cause the glyph to be rejected or clipped if the result is beyond the bounds of the surface.

If the method succeeds, the return value is .

Glyphs from a one-bit source surface are put together into another one-bit texture surface with this method. The destination surface can then be used as the source for a normal texturing operation that will filter and scale the strings of text onto some other non-monochrome surface.

This method has several constraints (which are similar to StretchRect):

  • Surfaces cannot be locked.
  • The source and destination surfaces cannot be the same surface.
  • The source and destination surfaces must be created with the format.
  • The source surface and both vertex buffers must be created with the flag.
  • The destination surface must be created with either the or flags.
  • The source rectangles must be within the source surface.

The method is not recorded in state blocks.

bb174340 HRESULT IDirect3DDevice9Ex::ComposeRects([In] IDirect3DSurface9* pSrc,[In] IDirect3DSurface9* pDst,[In] IDirect3DVertexBuffer9* pSrcRectDescs,[In] unsigned int NumRects,[In] IDirect3DVertexBuffer9* pDstRectDescs,[In] D3DCOMPOSERECTSOP Operation,[In] int Xoffset,[In] int Yoffset) IDirect3DDevice9Ex::ComposeRects

Swap the swapchain's next buffer with the front buffer.

Pointer to a structure indicating region on the source surface to copy in window client coordinates. Only applies when the swapchain was created with the flag. If null, the entire source surface is presented. If the rectangle exceeds the source surface, it is clipped to the source surface.

Pointer to structure indicating the target region on the destination surface in window client coordinates. Only applies when the swapchain was created with the flag. If null, the entire client area is filled. If the rectangle exceeds the destination client area, it is clipped to the destination client area.

Pointer to a destination window whose client area is taken as the target for this presentation. If this value is null, the runtime uses the hDeviceWindow member of for the presentation.

Note??If you create a swap chain with , you must pass null to hDestWindowOverride

Pointer to a structure indicating the smallest set of pixels that need to be transferred. This value must be null unless the swapchain was created with the flag. For more information about swapchains, see Flipping Surfaces (Direct3D 9).

If this value is non-null, the contained region is expressed in back buffer coordinates. The method takes these rectangles into account when optimizing the presentation by copying only the pixels within the region, or some suitably expanded set of rectangles. This is an aid to optimization only, and the application should not rely on the region being copied exactly. The implementation can choose to copy the whole source rectangle.

Allows the application to request that the method return immediately when the driver reports that it cannot schedule a presentation. Valid values are 0, or any combination of flags.

  • If dwFlags = 0, this method behaves as it did prior to Direct3D 9. Present will spin until the hardware is free, without returning an error.
  • If dwFlags = the display driver is called with the front buffer as both the source and target surface. The driver responds by scheduling a frame synch, but not changing the displayed surface. This flag is only available in full-screen mode or when using in windowed mode.
  • If dwFlags = , and the hardware is busy processing or waiting for a vertical sync interval, the method will return .
  • If dwFlags = , is enforced on this Present call. This flag can only be specified when using . This behavior is the same for windowed and full-screen modes.
  • If dwFlags = , gamma correction is performed from linear space to sRGB for windowed swap chains. This flag will take effect only when the driver exposes (see Gamma (Direct3D 9)).

Possible return values include: , , , , or (see D3DERR). See Lost Device Behavior Changes for more information about lost, hung, and removed devices.

Differences between Direct3D 9 and Direct3D 9Ex:

is only available in Direct3D9Ex running on Windows 7 (or more current operating system).

?

Similar to the Method, PresentEx adds a dwflags parameter.

When the swapchain is created with flag, pSourceRect, pDestRect and pDirtyRegion values must be set to null.

bb174343 HRESULT IDirect3DDevice9Ex::PresentEx([In] const void* pSourceRect,[In] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) IDirect3DDevice9Ex::PresentEx

Get the priority of the GPU thread.

Current GPU priority. Valid values range from -7 to 7.

Possible return values include: or (see D3DERR).

Use to set the priority of a thread.

This method will retrieve the priority of the thread stored with the Direct3D device even if it was created with the flag.

bb174341 HRESULT IDirect3DDevice9Ex::GetGPUThreadPriority([Out] int* pPriority) IDirect3DDevice9Ex::GetGPUThreadPriority

Set the priority on the GPU thread.

The thread priority, ranging from -7 to 7.

Possible return values include: , , or (see D3DERR).

GPU thread priority is not reset when a device is lost. The effects of calls to this method are not recorded in state blocks.

bb174346 HRESULT IDirect3DDevice9Ex::SetGPUThreadPriority([In] int Priority) IDirect3DDevice9Ex::SetGPUThreadPriority

Suspend execution of the calling thread until the next vertical blank signal.

Swap chain index. This is an optional, zero-based index used to specify a swap chain on a multihead card.

This method will always return .

This method allows applications to efficiently throttle their frame rate to that of the monitor associated with the device. Following a vertical blank, the amount of time it takes for the thread to wake up is typically very short.

In some scenarios the hardware may stop generating vertical blank signals when nothing is being displayed on the monitor. In this case, the method will wait approximately 100ms and return with .

bb174349 HRESULT IDirect3DDevice9Ex::WaitForVBlank([In] unsigned int iSwapChain) IDirect3DDevice9Ex::WaitForVBlank

Checks an array of resources to determine if it is likely that they will cause a large stall at Draw time because the system must make the resources GPU-accessible.

An array of references that indicate the resources to check.

A value indicating the number of resources passed into the pResourceArray parameter up to a maximum of 65535.

If all the resources are in GPU-accessible memory, the method will return . The system may need to perform a remapping operation to promote the resources, but will not have to copy data.

If no allocation that comprises the resources is on disk, but at least one allocation is not in GPU-accessible memory, the method will return . The system may need to perform a copy to promote the resource.

If at least one allocation that comprises the resources is on disk, this method will return S_NOT_RESIDENT. The system may need to perform a copy to promote the resource.

This API is no more than a reasonable guess at residency, since resources may have been demoted by the time the application uses them.

The expected usage pattern is as follows. If the application determines that a set of resources are not resident, then the application will substitute a lower-LOD version of the resource and continue with rendering. The video memory manager API, offers a feature to allow the application to express that it would like these lower-LOD resources to be made more likely to stay resident in GPU-accessible memory. It is the app's responsibility to create, fill and destroy these lower-LOD versions, if it so chooses.

The application also needs to begin promotion of the higher-LOD versions when the residency check indicates that the resource is not resident in GPU-accessible memory. Since a per-process lock exists in kernel mode, a performant implementation will spawn a separate process whose sole job is to promote resources. The application communicates resource identity between the two process by means of the Sharing Resources shared surfaces API and promotes them by means of the SetPriority.

bb174339 HRESULT IDirect3DDevice9Ex::CheckResourceResidency([In, Buffer] IDirect3DResource9** pResourceArray,[In] unsigned int NumResources) IDirect3DDevice9Ex::CheckResourceResidency

Checks an array of resources to determine if it is likely that they will cause a large stall at Draw time because the system must make the resources GPU-accessible.

An array of references that indicate the resources to check.

A value indicating the number of resources passed into the pResourceArray parameter up to a maximum of 65535.

If all the resources are in GPU-accessible memory, the method will return . The system may need to perform a remapping operation to promote the resources, but will not have to copy data.

If no allocation that comprises the resources is on disk, but at least one allocation is not in GPU-accessible memory, the method will return . The system may need to perform a copy to promote the resource.

If at least one allocation that comprises the resources is on disk, this method will return S_NOT_RESIDENT. The system may need to perform a copy to promote the resource.

This API is no more than a reasonable guess at residency, since resources may have been demoted by the time the application uses them.

The expected usage pattern is as follows. If the application determines that a set of resources are not resident, then the application will substitute a lower-LOD version of the resource and continue with rendering. The video memory manager API, offers a feature to allow the application to express that it would like these lower-LOD resources to be made more likely to stay resident in GPU-accessible memory. It is the app's responsibility to create, fill and destroy these lower-LOD versions, if it so chooses.

The application also needs to begin promotion of the higher-LOD versions when the residency check indicates that the resource is not resident in GPU-accessible memory. Since a per-process lock exists in kernel mode, a performant implementation will spawn a separate process whose sole job is to promote resources. The application communicates resource identity between the two process by means of the Sharing Resources shared surfaces API and promotes them by means of the SetPriority.

bb174339 HRESULT IDirect3DDevice9Ex::CheckResourceResidency([In, Buffer] IDirect3DResource9** pResourceArray,[In] unsigned int NumResources) IDirect3DDevice9Ex::CheckResourceResidency

Checks an array of resources to determine if it is likely that they will cause a large stall at Draw time because the system must make the resources GPU-accessible.

An array of references that indicate the resources to check.

A value indicating the number of resources passed into the pResourceArray parameter up to a maximum of 65535.

If all the resources are in GPU-accessible memory, the method will return . The system may need to perform a remapping operation to promote the resources, but will not have to copy data.

If no allocation that comprises the resources is on disk, but at least one allocation is not in GPU-accessible memory, the method will return . The system may need to perform a copy to promote the resource.

If at least one allocation that comprises the resources is on disk, this method will return S_NOT_RESIDENT. The system may need to perform a copy to promote the resource.

This API is no more than a reasonable guess at residency, since resources may have been demoted by the time the application uses them.

The expected usage pattern is as follows. If the application determines that a set of resources are not resident, then the application will substitute a lower-LOD version of the resource and continue with rendering. The video memory manager API, offers a feature to allow the application to express that it would like these lower-LOD resources to be made more likely to stay resident in GPU-accessible memory. It is the app's responsibility to create, fill and destroy these lower-LOD versions, if it so chooses.

The application also needs to begin promotion of the higher-LOD versions when the residency check indicates that the resource is not resident in GPU-accessible memory. Since a per-process lock exists in kernel mode, a performant implementation will spawn a separate process whose sole job is to promote resources. The application communicates resource identity between the two process by means of the Sharing Resources shared surfaces API and promotes them by means of the SetPriority.

bb174339 HRESULT IDirect3DDevice9Ex::CheckResourceResidency([In, Buffer] IDirect3DResource9** pResourceArray,[In] unsigned int NumResources) IDirect3DDevice9Ex::CheckResourceResidency

Set the number of frames that the system is allowed to queue for rendering.

The maximum number of back buffer frames that a driver can queue. The value is typically 3, but can range from 1 to 20. A value of 0 will reset latency to the default. For multi-head devices, MaxLatency is specified per-head.

Possible return values include: or (see D3DERR).

Frame latency is the number of frames that are allowed to be stored in a queue, before submission for rendering. Latency is often used to control how the CPU chooses between responding to user input and frames that are in the render queue.

It is often beneficial for applications that have no user input (for example, video playback) to queue more than 3 frames of data.

bb174347 HRESULT IDirect3DDevice9Ex::SetMaximumFrameLatency([In] unsigned int MaxLatency) IDirect3DDevice9Ex::SetMaximumFrameLatency

Retrieves the number of frames of data that the system is allowed to queue.

Returns the number of frames that can be queued for render. The value is typically 3, but can range from 1 to 20.

Possible return values include: , , , , , or (see D3DERR).

Frame latency is the number of frames that are allowed to be stored in a queue, before submission for rendering. Latency is often used to control how the CPU chooses between responding to user input and frames that are in the render queue.

It is often beneficial for applications that have no user input (for example, video playback) to queue more than 3 frames of data.

bb174342 HRESULT IDirect3DDevice9Ex::GetMaximumFrameLatency([Out] unsigned int* pMaxLatency) IDirect3DDevice9Ex::GetMaximumFrameLatency

Reports the current cooperative-level status of the Direct3D device for a windowed or full-screen application.

The destination window handle to check for occlusion. When this parameter is null, is returned when another device has fullscreen ownership. When the window handle is not null, window's client area is checked for occlusion. A window is occluded if any part of it is obscured by another application.

Possible return values include: , , , , or (see D3DERR), or , or (see S_PRESENT).

This method replaces , which always returns in Direct3D 9Ex applications.

We recommend not to call CheckDeviceState every frame. Instead, call CheckDeviceState only if the method returns a failure code.

See Lost Device Behavior Changes for more information about lost, hung, and removed devices.

bb174338 HRESULT IDirect3DDevice9Ex::CheckDeviceState([In] HWND hDestinationWindow) IDirect3DDevice9Ex::CheckDeviceState

Creates a render-target surface.

Width of the render-target surface, in pixels.

Height of the render-target surface, in pixels.

Member of the enumerated type, describing the format of the render target.

Member of the enumerated type, which describes the multisampling buffer type. This parameter specifies the antialiasing type for this render target. When this surface is passed to , its multisample type must be the same as that of the depth-stencil set by .

Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by . Passing a larger value returns the error, . The MultisampleQuality values of paired render targets, depth stencil surfaces, and the multisample type must all match.

Render targets are not lockable unless the application specifies TRUE for Lockable.

Note that lockable render targets reduce performance on some graphics hardware. The readback performance (moving data from video memory to system memory) depends on the type of hardware used (AGP vs. PCI Express) and is usually far lower than upload performance (moving data from system to video memory). If you need read access to render targets, use GetRenderTargetData instead of lockable render targets.

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

Combination of one or more constants which can be OR'd together. Value of 0 indicates no usage.

Address of a reference to an interface.

Render-target surfaces are placed in the memory class.

The creation of lockable, multisampled render targets is not supported.

bb509713 HRESULT IDirect3DDevice9Ex::CreateRenderTargetEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Lockable,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) IDirect3DDevice9Ex::CreateRenderTargetEx

Create an off-screen surface.

Width of the surface.

Height of the surface.

Format of the surface. See .

Surface pool type. See .

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

Combination of one or more constants which can be OR'd together. Value of 0 indicates no usage.

Pointer to the interface created.

will return a surface that has identical characteristics to a surface created by the DirectX 8.x method CreateImageSurface.

is the appropriate pool for use with the and .

is not allowed when creating an offscreen plain surface. For more information about memory pools, see .

Off-screen plain surfaces are always lockable, regardless of their pool types.

bb509712 HRESULT IDirect3DDevice9Ex::CreateOffscreenPlainSurfaceEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) IDirect3DDevice9Ex::CreateOffscreenPlainSurfaceEx

Creates a depth-stencil surface.

Width of the depth-stencil surface, in pixels.

Height of the depth-stencil surface, in pixels.

Member of the enumerated type, describing the format of the depth-stencil surface. This value must be one of the enumerated depth-stencil formats for this device.

Member of the enumerated type, describing the multisampling buffer type. This value must be one of the allowed multisample types. When this surface is passed to , its multisample type must be the same as that of the render target set by .

Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by . Passing a larger value returns the error . The MultisampleQuality values of paired render targets, depth stencil surfaces, and the MultiSample type must all match.

Set this flag to TRUE to enable z-buffer discarding, and otherwise. If this flag is set, the contents of the depth stencil buffer will be invalid after calling either or with a different depth surface.

This flag has the same behavior as the constant, , in .

Reserved. Set this parameter to null. This parameter can be used in Direct3D 9 for Windows Vista to share resources.

Combination of one or more constants which can be OR'd together. Value of 0 indicates no usage.

Address of a reference to an interface, representing the created depth-stencil surface resource.

The memory class of the depth-stencil buffer is always .

bb509711 HRESULT IDirect3DDevice9Ex::CreateDepthStencilSurfaceEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Discard,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) IDirect3DDevice9Ex::CreateDepthStencilSurfaceEx

Resets the type, size, and format of the swap chain with all other surfaces persistent.

Pointer to a structure, describing the new presentation parameters. This value cannot be null.

When switching to full-screen mode, Direct3D will try to find a desktop format that matches the back buffer format, so that back buffer and front buffer formats will be identical (to eliminate the need for color conversion).

When this method returns:

  • BackBufferCount, BackBufferWidth, and BackBufferHeight are set to zero.
  • BackBufferFormat is set to for windowed mode only; a full-screen mode must specify a format.

Pointer to a structure that describes the properties of the desired display mode. This value must be provided for fullscreen applications, but can be null for windowed applications.

The method can return: , or (see D3DERR).

If this method returns or then the application can only call , or release the interface reference; any other API call will cause an exception.

If a call to fails, the device will be placed in the lost state (as indicated by a return value of from a call to ). Refer to and Lost Device Behavior Changes for further information concerning the use of in the context of lost devices.

Unlike previous versions of DirectX, calling does not cause surfaces, textures or state information to be lost.

Pixel shaders and vertex shaders survive calls for Direct3D 9. They do not need to be re-created explicitly by the application.

There are two different types of swap chains: full-screen or windowed. If the new swap chain is full-screen, the adapter will be placed in the display mode that matches the new size.

Applications can expect messages to be sent to them during this call (for example, before this call is returned); applications should take precautions not to call into Direct3D at this time.

A call to will fail if called on a different thread than that used to create the device being reset.

can be specified for the windowed mode back buffer format when calling , , and . This means the application does not have to query the current desktop format before calling for windowed mode. For full-screen mode, the back buffer format must be specified. Setting BackBufferCount equal to zero (BackBufferCount = 0) results in one back buffer.

When trying to reset more than one display adapter in a group, set pPresentationParameters to point to an array of structures, one for each display in the adapter group.

If a multihead device was created with , requires an array of structures wherein each structure must specify a full-screen display. To switch back to windowed mode, the application must destroy the device and re-create a non-multihead device in windowed mode.

bb174344 HRESULT IDirect3DDevice9Ex::ResetEx([In] D3DPRESENT_PARAMETERS* pPresentationParameters,[In] void* pFullscreenDisplayMode) IDirect3DDevice9Ex::ResetEx

Retrieves the display mode's spatial resolution, color resolution, refresh frequency, and rotation settings.

An unsigned integer specifying the swap chain.

Pointer to a indicating the type of screen rotation the application will do. The value returned through this reference is important when the flag is used; otherwise, it can be set to null.

Pointer to a structure containing data about the display mode of the adapter. As opposed to the display mode of the device, which may not be active if the device does not own full-screen mode. Can be set to null.

bb509714 HRESULT IDirect3DDevice9Ex::GetDisplayModeEx([In] unsigned int iSwapChain,[Out] D3DDISPLAYMODEEX* pMode,[In] void* pRotation) IDirect3DDevice9Ex::GetDisplayModeEx

Applications use the methods of the interface to create Microsoft Direct3D objects and set up the environment. This interface includes methods for enumerating and retrieving capabilities of the device.

The interface is obtained by calling the Direct3DCreate9 function.

The LPDIRECT3D9 and PDIRECT3D9 types are defined as references to the interface.

typedef struct  *LPDIRECT3D9, *PDIRECT3D9;
bb174300 IDirect3D9 IDirect3D9
Create an IDirect3D9 object and return an interface to it. The Direct3D object is the first Direct3D COM object that your graphical application needs to create and the last object that your application needs to release. Functions for enumerating and retrieving capabilities of a device are accessible through the Direct3D object. This enables applications to select devices without creating them. Create an IDirect3D9 object as shown here: LPDIRECT3D9 g_pD3D = NULL; if( NULL == (g_pD3D = Direct3DCreate9(D3D_SDK_VERSION))) return E_FAIL; The IDirect3D9 interface supports enumeration of active display adapters and allows the creation of objects. If the user dynamically adds adapters (either by adding devices to the desktop, or by hot-docking a laptop), those devices will not be included in the enumeration. Creating a new IDirect3D9 interface will expose the new devices. D3D_SDK_VERSION is passed to this function to ensure that the header files against which an application is compiled match the version of the runtime DLL's that are installed on the machine. D3D_SDK_VERSION is only changed in the runtime when a header change (or other code change) would require an application to be rebuilt. If this function fails, it indicates that the header file version does not match the runtime DLL version. For an example, see {{Creating a Device (Direct3D 9)}}. Checks the version of D3DX runtime against the version of this library.. Gets the adapters. Determines whether a depth-stencil format is compatible with a render-target format in a particular display mode. The adapter. Type of the device. The adapter format. The render target format. The depth stencil format. If the depth-stencil format is compatible with the render-target format in the display mode, this method returns true HRESULT IDirect3D9::CheckDepthStencilMatch([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT AdapterFormat,[In] D3DFORMAT RenderTargetFormat,[In] D3DFORMAT DepthStencilFormat) Determines whether a depth-stencil format is compatible with a render-target format in a particular display mode. The adapter. Type of the device. The adapter format. The render target format. The depth stencil format. The result. If the depth-stencil format is compatible with the render-target format in the display mode, this method returns true HRESULT IDirect3D9::CheckDepthStencilMatch([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT AdapterFormat,[In] D3DFORMAT RenderTargetFormat,[In] D3DFORMAT DepthStencilFormat) Determines whether a surface format is available as a specified resource type and can be used as a texture, depth-stencil buffer, or render target, or any combination of the three, on a device representing this adapter. The adapter. Type of the device. The adapter format. The usage. Type of the resource. The check format. If the format is compatible with the specified device for the requested usage, this method returns true HRESULT IDirect3D9::CheckDeviceFormat([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT AdapterFormat,[In] unsigned int Usage,[In] D3DRESOURCETYPE RType,[In] D3DFORMAT CheckFormat) Determines whether a surface format is available as a specified resource type and can be used as a texture, depth-stencil buffer, or render target, or any combination of the three, on a device representing this adapter. The adapter. Type of the device. The adapter format. The usage. Type of the resource. The check format. The result. If the format is compatible with the specified device for the requested usage, this method returns true HRESULT IDirect3D9::CheckDeviceFormat([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT AdapterFormat,[In] unsigned int Usage,[In] D3DRESOURCETYPE RType,[In] D3DFORMAT CheckFormat) Tests the device to see if it supports conversion from one display format to another. The adapter. Type of the device. The source format. The target format. True if the method succeeds. HRESULT IDirect3D9::CheckDeviceFormatConversion([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT SourceFormat,[In] D3DFORMAT TargetFormat) Tests the device to see if it supports conversion from one display format to another. The adapter. Type of the device. The source format. The target format. The result. True if the method succeeds. HRESULT IDirect3D9::CheckDeviceFormatConversion([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT SourceFormat,[In] D3DFORMAT TargetFormat) Determines if a multisampling technique is available on this device. The adapter. Type of the device. The surface format. if set to true [windowed]. Type of the multisample. f the device can perform the specified multisampling method, this method returns true HRESULT IDirect3D9::CheckDeviceMultiSampleType([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT SurfaceFormat,[In] BOOL Windowed,[In] D3DMULTISAMPLE_TYPE MultiSampleType,[Out] unsigned int* pQualityLevels) Determines if a multisampling technique is available on this device. The adapter. Type of the device. The surface format. if set to true [windowed]. Type of the multisample. The quality levels. f the device can perform the specified multisampling method, this method returns true HRESULT IDirect3D9::CheckDeviceMultiSampleType([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT SurfaceFormat,[In] BOOL Windowed,[In] D3DMULTISAMPLE_TYPE MultiSampleType,[Out] unsigned int* pQualityLevels) Determines if a multisampling technique is available on this device. The adapter. Type of the device. The surface format. if set to true [windowed]. Type of the multisample. The quality levels. The result. f the device can perform the specified multisampling method, this method returns true HRESULT IDirect3D9::CheckDeviceMultiSampleType([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT SurfaceFormat,[In] BOOL Windowed,[In] D3DMULTISAMPLE_TYPE MultiSampleType,[Out] unsigned int* pQualityLevels) Verifies whether a hardware accelerated device type can be used on this adapter. The adapter. Type of the device. The adapter format. The back buffer format. if set to true [windowed]. true if the device can be used on this adapter HRESULT IDirect3D9::CheckDeviceType([In] unsigned int Adapter,[In] D3DDEVTYPE DevType,[In] D3DFORMAT AdapterFormat,[In] D3DFORMAT BackBufferFormat,[In] BOOL bWindowed) Verifies whether a hardware accelerated device type can be used on this adapter. The adapter. Type of the device. The adapter format. The back buffer format. if set to true [windowed]. The result. true if the device can be used on this adapter HRESULT IDirect3D9::CheckDeviceType([In] unsigned int Adapter,[In] D3DDEVTYPE DevType,[In] D3DFORMAT AdapterFormat,[In] D3DFORMAT BackBufferFormat,[In] BOOL bWindowed) Get the physical display adapters present in the system when this was instantiated. The adapter. The physical display adapters HRESULT IDirect3D9::GetAdapterIdentifier([In] unsigned int Adapter,[In] unsigned int Flags,[Out] D3DADAPTER_IDENTIFIER9* pIdentifier) Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Returns the number of adapters on the system.

bb174315 GetAdapterCount GetAdapterCount unsigned int IDirect3D9::GetAdapterCount()

Registers a pluggable software device. Software devices provide software rasterization enabling applications to access a variety of software rasterizers.

Pointer to the initialization function for the software device to be registered.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: . The method call is invalid. For example, a method's parameter may have an invalid value: .

If the user's computer provides no special hardware acceleration for 3D operations, your application might emulate 3D hardware in software. Software rasterization devices emulate the functions of color 3D hardware in software. A software device runs more slowly than a hal. However, software devices take advantage of any special instructions supported by the CPU to increase performance. Instruction sets include the AMD 3DNow! instruction set on some AMD processors and the MMX instruction set supported by many Intel processors. Direct3D uses the 3D-Now! instruction set to accelerate transformation and lighting operations and the MMX instruction set to accelerate rasterization.

Software devices communicate with Direct3D through an interface similar to the hardware device driver interface (DDI).

Software devices are loaded by the application and registered with the object. Direct3D uses the software device for rendering.

The Direct3D Driver Development Kit (DDK) provides the documentation and headers for developing pluggable software devices.

bb174321 HRESULT IDirect3D9::RegisterSoftwareDevice([In] void* pInitializeFunction) IDirect3D9::RegisterSoftwareDevice

Returns the number of adapters on the system.

A UINT value that denotes the number of adapters on the system at the time this interface was instantiated.

bb174315 unsigned int IDirect3D9::GetAdapterCount() IDirect3D9::GetAdapterCount

Describes the physical display adapters present in the system when the interface was instantiated.

No documentation. No documentation. No documentation. bb174317 HRESULT IDirect3D9::GetAdapterIdentifier([In] unsigned int Adapter,[In] unsigned int Flags,[Out] D3DADAPTER_IDENTIFIER9* pIdentifier) IDirect3D9::GetAdapterIdentifier

Returns the number of display modes available on this adapter.

Ordinal number that denotes the display adapter. D3DADAPTER_DEFAULT is always the primary display adapter.

Identifies the format of the surface type using . Use EnumAdapterModes to see the valid formats.

This method returns the number of display modes on this adapter or zero if Adapter is greater than or equal to the number of adapters on the system.

bb174318 unsigned int IDirect3D9::GetAdapterModeCount([In] unsigned int Adapter,[In] D3DFORMAT Format) IDirect3D9::GetAdapterModeCount

Queries the device to determine whether the specified adapter supports the requested format and display mode. This method could be used in a loop to enumerate all the available adapter modes.

Ordinal number denoting the display adapter to enumerate. D3DADAPTER_DEFAULT is always the primary display adapter. This method returns when this value equals or exceeds the number of display adapters in the system.

Allowable pixel formats. See Remarks.

Represents the display-mode index which is an unsigned integer between zero and the value returned by GetAdapterModeCount minus one.

A reference to the available display mode of type . See Remarks.

An application supplies a display mode and a format to EnumAdapterModes which returns a display mode. This method could be used in a loop to enumerate all available display modes.

The application specifies a format and the enumeration is restricted to those display modes that exactly match the format (alpha is ignored). Allowed formats (which are members of ) are as follows:

In addition, EnumAdapterModes treats pixel formats 565 and 555 as equivalent, and returns the correct version. The difference comes into play only when the application locks the back buffer and there is an explicit flag that the application must set in order to accomplish this.

bb174314 HRESULT IDirect3D9::EnumAdapterModes([In] unsigned int Adapter,[In] D3DFORMAT Format,[In] unsigned int Mode,[Out] D3DDISPLAYMODE* pMode) IDirect3D9::EnumAdapterModes

Retrieves the current display mode of the adapter.

Ordinal number that denotes the display adapter to query. D3DADAPTER_DEFAULT is always the primary display adapter.

Pointer to a structure, to be filled with information describing the current adapter's mode.

GetAdapterDisplayMode will not return the correct format when the display is in an extended format, such as 2:10:10:10. Instead, it returns the format X8R8G8B8.

bb174316 HRESULT IDirect3D9::GetAdapterDisplayMode([In] unsigned int Adapter,[Out] D3DDISPLAYMODE* pMode) IDirect3D9::GetAdapterDisplayMode

Verifies whether a hardware accelerated device type can be used on this adapter.

Ordinal number denoting the display adapter to enumerate. D3DADAPTER_DEFAULT is always the primary display adapter. This method returns when this value equals or exceeds the number of display adapters in the system.

Member of the enumerated type, indicating the device type to check.

Member of the enumerated type, indicating the format of the adapter display mode for which the device type is to be checked. For example, some devices will operate only in 16-bits-per-pixel modes.

Back buffer format. For more information about formats, see . This value must be one of the render-target formats. You can use GetAdapterDisplayMode to obtain the current format. For windowed applications, the back buffer format does not need to match the display mode format if the hardware supports color conversion. The set of possible back buffer formats is constrained, but the runtime will allow any valid back buffer format to be presented to any desktop format. There is the additional requirement that the device be operable in the desktop because devices typically do not operate in 8 bits per pixel modes. Full-screen applications cannot do color conversion. is allowed for windowed mode.

Value indicating whether the device type will be used in full-screen or windowed mode. If set to TRUE, the query is performed for windowed applications; otherwise, this value should be set .

If the device can be used on this adapter, is returned. is returned if Adapter equals or exceeds the number of display adapters in the system. is also returned if CheckDeviceType specified a device that does not exist. is returned if the requested back buffer format is not supported, or if hardware acceleration is not available for the specified formats.

A hal device type requires hardware acceleration. Applications can use CheckDeviceType to determine if the needed hardware and drivers are present to support a hal device.

Full-screen applications should not specify a DisplayFormat that contains an alpha channel. This will result in a failed call. Note that an alpha channel can be present in the back buffer but the two display formats must be identical in all other respects. For example, if DisplayFormat = , valid values for BackBufferFormat include and but exclude .

The following code fragment shows how you could use CheckDeviceType to test whether a certain device type can be used on this adapter.

 if(SUCCEEDED(pD3Device->CheckDeviceType(D3DADAPTER_DEFAULT,  ,  DisplayFormat,  BackBufferFormat,  bIsWindowed))) return ;	
            // There is no HAL on this adapter using this render-target format. 	
            // Try again, using another format.	
            

This code returns if the device can be used on the default adapter with the specified surface format.

Using CheckDeviceType to test for compatibility between a back buffer that differs from the display format will return appropriate values. This means that the call will reflect device capabilities. If the device cannot render to the requested back-buffer format, the call will still return . If the device can render to the format, but cannot perform the color-converting presentation, the return value will also be . Applications can discover hardware support for the presentation itself by calling CheckDeviceFormatConversion. No software emulation for the color-converting presentation itself will be offered.

bb174312 HRESULT IDirect3D9::CheckDeviceType([In] unsigned int Adapter,[In] D3DDEVTYPE DevType,[In] D3DFORMAT AdapterFormat,[In] D3DFORMAT BackBufferFormat,[In] BOOL bWindowed) IDirect3D9::CheckDeviceType

Determines whether a surface format is available as a specified resource type and can be used as a texture, depth-stencil buffer, or render target, or any combination of the three, on a device representing this adapter.

Ordinal number denoting the display adapter to query. D3DADAPTER_DEFAULT is always the primary display adapter. This method returns when this value equals or exceeds the number of display adapters in the system.

Member of the enumerated type, identifying the device type.

Member of the enumerated type, identifying the format of the display mode into which the adapter will be placed.

Requested usage options for the surface. Usage options are any combination of and D3DUSAGE_QUERY constants (only a subset of the constants are valid for CheckDeviceFormat; see the table on the page).

Resource type requested for use with the queried format. Member of .

Format of the surfaces which may be used, as defined by Usage. Member of .

If the format is compatible with the specified device for the requested usage, this method returns .

is returned if Adapter equals or exceeds the number of display adapters in the system, or if DeviceType is unsupported.

is returned if the format is not acceptable to the device for this usage.

Here are some examples using CheckDeviceFormat to check for hardware support of:

  • An off-screen plain surface format - Specify Usage = 0 and RType = .
  • A depth-stencil format - The following snippet tests for the passed in depth-stencil format:
      IsDepthFormatExisting(  DepthFormat,  AdapterFormat ) 	
                {  hr = pD3D->CheckDeviceFormat( D3DADAPTER_DEFAULT, , AdapterFormat, , , DepthFormat); return SUCCEEDED( hr );	
                }

    See Selecting a Device (Direct3D 9) for more detail on the enumeration process.

  • Can this texture be rendered in a particular format - Given the current display mode, this example shows how to verify that the texture format is compatible with the specific back-buffer format:
      IsTextureFormatOk(  TextureFormat,  AdapterFormat ) 	
                {  hr = pD3D->CheckDeviceFormat( D3DADAPTER_DEFAULT, , AdapterFormat, 0, , TextureFormat); return SUCCEEDED( hr );	
                }
  • Alpha blending in a pixel shader - Set Usage to . Expect this to fail for all floating-point render targets.
  • Autogeneration of mipmaps - Set Usage to . If the mipmap automatic generation fails, the application will get a non-mipmapped texture. Calling this method is considered a hint, so this method can return (a valid success code) if the only thing that fails is the mipmap generation. For more information about mipmap generation, see Automatic Generation of Mipmaps (Direct3D 9).

When migrating code from Direct3D 9 to Direct3D 10, the Direct3D 10 equivalent to CheckDeviceFormat is CheckFormatSupport.

bb174309 HRESULT IDirect3D9::CheckDeviceFormat([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT AdapterFormat,[In] unsigned int Usage,[In] D3DRESOURCETYPE RType,[In] D3DFORMAT CheckFormat) IDirect3D9::CheckDeviceFormat

Determines if a multisampling technique is available on this device.

Ordinal number denoting the display adapter to query. D3DADAPTER_DEFAULT is always the primary display adapter. This method returns when this value equals or exceeds the number of display adapters in the system. See Remarks.

Member of the enumerated type, identifying the device type.

Member of the enumerated type that specifies the format of the surface to be multisampled. For more information, see Remarks.

bool value. Specify TRUE to inquire about windowed multisampling, and specify to inquire about full-screen multisampling.

Member of the enumerated type, identifying the multisampling technique to test.

pQualityLevels returns the number of device-specific sampling variations available with the given sample type. For example, if the returned value is 3, then quality levels 0, 1 and 2 can be used when creating resources with the given sample count. The meanings of these quality levels are defined by the device manufacturer and cannot be queried through D3D. For example, for a particular device different quality levels at a fixed sample count might refer to different spatial layouts of the sample locations or different methods of resolving. This can be null if it is not necessary to return the quality levels.

If the device can perform the specified multisampling method, this method returns . is returned if the Adapter or MultiSampleType parameters are invalid. This method returns if the queried multisampling technique is not supported by this device. is returned if DeviceType does not apply to this adapter.

This method is intended for use with both render-target and depth-stencil surfaces because you must create both surfaces multisampled if you want to use them together.

The following code fragment shows how you could use CheckDeviceMultiSampleType to test for devices that support a specific multisampling method.

 if( SUCCEEDED(pD3D->CheckDeviceMultiSampleType( pCaps->AdapterOrdinal,  pCaps->DeviceType, BackBufferFormat,  , , null ) ) && SUCCEEDED(pD3D->CheckDeviceMultiSampleType( pCaps->AdapterOrdinal,  pCaps->DeviceType, DepthBufferFormat,  , , null ) ) ) return ;	
            

The preceding code will return if the device supports the full-screen multisampling method with the surface format.

See the remarks in for additional information on working with and setting multisample types and quality levels.

bb174311 HRESULT IDirect3D9::CheckDeviceMultiSampleType([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT SurfaceFormat,[In] BOOL Windowed,[In] D3DMULTISAMPLE_TYPE MultiSampleType,[Out] unsigned int* pQualityLevels) IDirect3D9::CheckDeviceMultiSampleType

Determines whether a depth-stencil format is compatible with a render-target format in a particular display mode.

Ordinal number denoting the display adapter to query. D3DADAPTER_DEFAULT is always the primary display adapter.

Member of the enumerated type, identifying the device type.

Member of the enumerated type, identifying the format of the display mode into which the adapter will be placed.

Member of the enumerated type, identifying the format of the render-target surface to be tested.

Member of the enumerated type, identifying the format of the depth-stencil surface to be tested.

If the depth-stencil format is compatible with the render-target format in the display mode, this method returns . can be returned if one or more of the parameters is invalid. If a depth-stencil format is not compatible with the render target in the display mode, then this method returns .

This method is provided to enable applications to work with hardware requiring that certain depth formats can only work with certain render-target formats.

The behavior of this method has been changed for DirectX 8.1. This method now pays attention to the D24x8 and D32 depth-stencil formats. The previous version assumed that these formats would always be usable with 32- or 16-bit render targets. This method will now return for these formats only if the device is capable of mixed-depth operations.

The following code fragment shows how you could use CheckDeviceFormat to validate a depth stencil format.

  IsDepthFormatOk( DepthFormat,   AdapterFormat,   BackBufferFormat)	
            { // Verify that the depth format exists  hr = pD3D->CheckDeviceFormat(D3DADAPTER_DEFAULT, , AdapterFormat, , , DepthFormat); if(FAILED(hr)) return ; // Verify that the depth format is compatible hr = pD3D->CheckDepthStencilMatch(D3DADAPTER_DEFAULT, , AdapterFormat, BackBufferFormat, DepthFormat); return SUCCEEDED(hr); }	
            

The preceding call will return if DepthFormat cannot be used in conjunction with AdapterFormat and BackBufferFormat.

bb174308 HRESULT IDirect3D9::CheckDepthStencilMatch([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT AdapterFormat,[In] D3DFORMAT RenderTargetFormat,[In] D3DFORMAT DepthStencilFormat) IDirect3D9::CheckDepthStencilMatch

Tests the device to see if it supports conversion from one display format to another.

Display adapter ordinal number. D3DADAPTER_DEFAULT is always the primary display adapter. This method returns when this value equals or exceeds the number of display adapters in the system.

Device type. Member of the enumerated type.

Source adapter format. Member of the enumerated type.

Target adapter format. Member of the enumerated type.

If the method succeeds, the return value is . If the method fails, the return value is . The method will return when the hardware does not support conversion between the two formats.

Using CheckDeviceType to test for compatibility between a back buffer that differs from the display format will return appropriate values. This means that the call will reflect device capabilities. If the device cannot render to the requested back buffer format, the call will still return . If the device can render to the format, but cannot perform the color-converting presentation, the return value will also be . Applications can discover hardware support for the presentation itself by calling CheckDeviceFormatConversion. No software emulation for the color-converting presentation itself will be offered.

CheckDeviceFormatConversion can also be used to determine which combinations of source surface formats and destination surface formats are permissible in calls to StretchRect.

Color conversion is restricted to the following source and target formats.

  • The source format must be a FOURCC format or a valid back buffer format. For a list of these, see FourCC Formats and BackBuffer or Display Formats.
  • The target format must be one of these unsigned formats:

    ?

bb174310 HRESULT IDirect3D9::CheckDeviceFormatConversion([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] D3DFORMAT SourceFormat,[In] D3DFORMAT TargetFormat) IDirect3D9::CheckDeviceFormatConversion

Retrieves device-specific information about a device.

Ordinal number that denotes the display adapter. D3DADAPTER_DEFAULT is always the primary display adapter.

Member of the enumerated type. Denotes the device type.

Pointer to a structure to be filled with information describing the capabilities of the device.

The application should not assume the persistence of vertex processing capabilities across Direct3D device objects. The particular capabilities that a physical device exposes may depend on parameters supplied to CreateDevice. For example, the capabilities may yield different vertex processing capabilities before and after creating a Direct3D Device Object with hardware vertex processing enabled. For more information see the description of .

bb174320 HRESULT IDirect3D9::GetDeviceCaps([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[Out] D3DCAPS9* pCaps) IDirect3D9::GetDeviceCaps

Returns the handle of the monitor associated with the Direct3D object.

Ordinal number that denotes the display adapter. D3DADAPTER_DEFAULT is always the primary display adapter.

Handle of the monitor associated with the Direct3D object.

As shown in the following code fragment, which illustrates how to obtain a handle to the monitor associated with a given device, use GetDirect3D to return the Direct3D enumerator from the device and use GetCreationParameters to retrieve the value for Adapter.

 if( FAILED( pDevice->GetCreationParameters(  &Parameters ) ) ) return ; if( FAILED( pDevice->GetDirect3D(&pD3D) ) ) return ; hMonitor = pD3D->GetAdapterMonitor(Parameters.AdapterOrdinal); pD3D->Release();	
            
bb174319 HMONITOR IDirect3D9::GetAdapterMonitor([In] unsigned int Adapter) IDirect3D9::GetAdapterMonitor

Creates a device to represent the display adapter.

Ordinal number that denotes the display adapter. D3DADAPTER_DEFAULT is always the primary display adapter.

Member of the enumerated type that denotes the desired device type. If the desired device type is not available, the method will fail.

The focus window alerts Direct3D when an application switches from foreground mode to background mode. See Remarks.

  • For full-screen mode, the window specified must be a top-level window.
  • For windowed mode, this parameter may be null only if the hDeviceWindow member of pPresentationParameters is set to a valid, non-null value.

Combination of one or more options that control device creation. For more information, see .

Pointer to a structure, describing the presentation parameters for the device to be created. If BehaviorFlags specifies , pPresentationParameters is an array. Regardless of the number of heads that exist, only one depth/stencil surface is automatically created.

For Windows 2000 and Windows XP, the full-screen device display refresh rate is set in the following order:

  1. User-specified nonzero ForcedRefreshRate registry key, if supported by the device.
  2. Application-specified nonzero refresh rate value in the presentation parameter.
  3. Refresh rate of the latest desktop, if supported by the device.
  4. 75 hertz if supported by the device.
  5. 60 hertz if supported by the device.
  6. Device default.

An unsupported refresh rate will default to the closest supported refresh rate below it. For example, if the application specifies 63 hertz, 60 hertz will be used. There are no supported refresh rates below 57 hertz.

pPresentationParameters is both an input and an output parameter. Calling this method may change several members including:

  • If BackBufferCount, BackBufferWidth, and BackBufferHeight are 0 before the method is called, they will be changed when the method returns.
  • If BackBufferFormat equals before the method is called, it will be changed when the method returns.

Address of a reference to the returned interface, which represents the created device.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , , .

This method returns a fully working device interface, set to the required display mode (or windowed), and allocated with the appropriate back buffers. To begin rendering, the application needs only to create and set a depth buffer (assuming EnableAutoDepthStencil is in ).

When you create a Direct3D device, you supply two different window parameters: a focus window (hFocusWindow) and a device window (the hDeviceWindow in ). The purpose of each window is:

  • The focus window alerts Direct3D when an application switches from foreground mode to background mode (via Alt-Tab, a mouse click, or some other method). A single focus window is shared by each device created by an application.
  • The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back buffer contents are copied to the front buffer during Present.

This method should not be run during the handling of WM_CREATE. An application should never pass a window handle to Direct3D while handling WM_CREATE. Any call to create, release, or reset the device must be done using the same thread as the window procedure of the focus window.

Note that , , and are mutually exclusive flags, and at least one of these vertex processing flags must be specified when calling this method.

Back buffers created as part of the device are only lockable if is specified in the presentation parameters. (Multisampled back buffers and depth surfaces are never lockable.)

The methods Reset, , and TestCooperativeLevel must be called from the same thread that used this method to create a device.

can be specified for the windowed mode back buffer format when calling CreateDevice, Reset, and CreateAdditionalSwapChain. This means the application does not have to query the current desktop format before calling CreateDevice for windowed mode. For full-screen mode, the back buffer format must be specified.

If you attempt to create a device on a 0x0 sized window, CreateDevice will fail.

bb174313 HRESULT IDirect3D9::CreateDevice([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] HWND hFocusWindow,[In] D3DCREATE BehaviorFlags,[In, Buffer] D3DPRESENT_PARAMETERS* pPresentationParameters,[Out, Fast] IDirect3DDevice9** ppReturnedDeviceInterface) IDirect3D9::CreateDevice

Applications use the methods of the interface (which inherits from ) to create Microsoft Direct3D 9Ex objects and set up the environment. This interface includes methods for enumerating and retrieving capabilities of the device and is available when the underlying device implementation is compliant with Windows Vista.

The interface is obtained by calling the Direct3DCreate9Ex function.

The LPDIRECT3D9EX and PDIRECT3D9EX types are defined as references to the interface:

 typedef struct  *LPDIRECT3D9EX, *PDIRECT3D9EX;	
            
bb174301 IDirect3D9Ex IDirect3D9Ex
Creates an object and returns an interface to it. The object is the first object that the application creates and the last object that the application releases. Functions for enumerating and retrieving capabilities of a device are accessible through the IDirect3D9Ex object. This enables applications to select devices without creating them. The interface supports enumeration of active display adapters and allows the creation of IDirect3D9Ex objects. If the user dynamically adds adapters (either by adding devices to the desktop, or by hot-docking a laptop), these devices are not included in the enumeration. Creating a new IDirect3D9Ex interface will expose the new devices. Pass the D3D_SDK_VERSION flag to this function to ensure that header files used in the compiled application match the version of the installed runtime DLLs. D3D_SDK_VERSION is changed in the runtime only when a header or another code change would require rebuilding the application. If this function fails, it indicates that the versions of the header file and the runtime DLL do not match. Note??Direct3DCreate9Ex is supported only in Windows Vista, Windows Server 2008, and Windows 7. Earlier versions of the D3D9.dll library do not include Direct3D9Ex and Direct3DCreate9Ex. D3DERR_NOTAVAILABLE if Direct3DEx features are not supported (no WDDM driver is installed) or if the SDKVersion does not match the version of the DLL. D3DERR_OUTOFMEMORY if out-of-memory conditions are detected when creating the enumerator object. S_OK if the creation of the enumerator object is successful. HRESULT Direct3DCreate9Ex([None] int SDKVersion,[None] IDirect3D9Ex** arg1) Retrieves the current display mode and rotation settings of the adapter. The adapter. structure containing data about the display mode of the adapter HRESULT IDirect3D9Ex::GetAdapterDisplayModeEx([In] unsigned int Adapter,[Out] D3DDISPLAYMODEEX* pMode,[Out] D3DDISPLAYROTATION* pRotation) Gets a collection of installed extended adapters. Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Returns the number of display modes available.

Ordinal number denoting the display adapter from which to retrieve the display mode count.

Specifies the characteristics of the desired display mode. See .

The number of display modes available. A return of value zero from this method is an indication that no such display mode is supported or simply this monitor is no longer available.

Events such as display mode changes on other heads of the same hardware, monitor change or its connection status change, and desktop extension/unextension could all affect the number of display mode available.

To fullscreen applications, returned from PresentEx or CheckDeviceState is the indication of display mode setting failure due to those events.

To increase the chance of setting a currently available display mode successfully, fullscreen applications should try to requery the available display mode list upon receiving .

bb174306 unsigned int IDirect3D9Ex::GetAdapterModeCountEx([In] unsigned int Adapter,[In] const D3DDISPLAYMODEFILTER* pFilter) IDirect3D9Ex::GetAdapterModeCountEx

This method returns the actual display mode info based on the given mode index.

Ordinal number denoting the display adapter to enumerate. D3DADAPTER_DEFAULT is always the primary display adapter. This method returns when this value equals or exceeds the number of display adapters in the system.

See .

Represents the display-mode index which is an unsigned integer between zero and the value returned by GetAdapterModeCount minus one.

A reference to the available display mode of type .

bb174303 HRESULT IDirect3D9Ex::EnumAdapterModesEx([In] unsigned int Adapter,[In] const D3DDISPLAYMODEFILTER* pFilter,[In] unsigned int Mode,[Out] D3DDISPLAYMODEEX* pMode) IDirect3D9Ex::EnumAdapterModesEx

Retrieves the current display mode and rotation settings of the adapter.

Ordinal number that denotes the display adapter to query. D3DADAPTER_DEFAULT is always the primary display adapter.

Pointer to a structure indicating the type of screen rotation the application will do. The value returned through this reference is important when the flag is used; otherwise, it can be set to null.

Pointer to a structure containing data about the display mode of the adapter. As opposed to the display mode of the device, which may not be active if the device does not own full-screen mode. Can be set to null.

GetAdapterDisplayModeEx does not return the correct format when the display is in an extended format, such as 2:10:10:10. Instead, it returns the format X8R8G8B8.

To windowed applications, a value of returned from PresentEx or CheckDeviceState indicates that the display mode changed and that the current display mode might have a different format. To avoid a color-converting Present blt, windowed applications can optionally get new display mode information by using this method and adjusting its swap chain format accordingly. This method returns if this head is no longer part of the desktop or if the monitor is disconnected.

bb174304 HRESULT IDirect3D9Ex::GetAdapterDisplayModeEx([In] unsigned int Adapter,[Out] D3DDISPLAYMODEEX* pMode,[Out] D3DDISPLAYROTATION* pRotation) IDirect3D9Ex::GetAdapterDisplayModeEx

Creates a device to represent the display adapter.

Ordinal number that denotes the display adapter. D3DADAPTER_DEFAULT is always the primary display adapter.

Specifies the type of device. See . If the desired device type is not available, the method will fail.

The focus window alerts Direct3D when an application switches from foreground mode to background mode. For full-screen mode, the window specified must be a top-level window. For windowed mode, this parameter may be null only if the hDeviceWindow member of pPresentationParameters is set to a valid, non-null value.

Combination of one or more options (see ) that control device creation.

Pointer to a structure, describing the presentation parameters for the device to be created. If BehaviorFlags specifies , this parameter is an array. Regardless of the number of heads that exist, only one depth/stencil surface is automatically created.

This parameter is both an input and an output parameter. Calling this method may change several members including:

  • If BackBufferCount, BackBufferWidth, and BackBufferHeight are 0 before the method is called, they will be changed when the method returns.
  • If BackBufferFormat equals before the method is called, it will be changed when the method returns.

The display mode for when the device is set to fullscreen. See . If BehaviorFlags specifies , this parameter is an array. This parameter must be null for windowed mode.

Address of a reference to the returned , which represents the created device.

This method returns when rendering device along with swapchain buffers are created successfully. is returned when any error other than invalid caller input is encountered.

bb174302 HRESULT IDirect3D9Ex::CreateDeviceEx([In] unsigned int Adapter,[In] D3DDEVTYPE DeviceType,[In] HWND hFocusWindow,[In] unsigned int BehaviorFlags,[In, Buffer] D3DPRESENT_PARAMETERS* pPresentationParameters,[In, Buffer, Optional] D3DDISPLAYMODEEX* pFullscreenDisplayMode,[Out, Fast] IDirect3DDevice9Ex** ppReturnedDeviceInterface) IDirect3D9Ex::CreateDeviceEx

This method returns a unique identifier for the adapter that is specific to the adapter hardware. Applications can use this identifier to define robust mappings across various APIs (Direct3D 9, DXGI).

Ordinal number denoting the display adapter from which to retrieve the .

A unique identifier for the given adapter.

bb174305 HRESULT IDirect3D9Ex::GetAdapterLUID([In] unsigned int Adapter,[Out] LUID* pLUID) IDirect3D9Ex::GetAdapterLUID

Describes the display mode.

bb172548 D3DDISPLAYMODE D3DDISPLAYMODE
Gets the aspect ratio.

Screen width, in pixels.

bb172548 unsigned int Width unsigned int Width

Screen height, in pixels.

bb172548 unsigned int Height unsigned int Height

Refresh rate. The value of 0 indicates an adapter default.

bb172548 unsigned int RefreshRate unsigned int RefreshRate

Member of the enumerated type, describing the surface format of the display mode.

bb172548 D3DFORMAT Format D3DFORMAT Format
A collection of

Information about the properties of a display mode.

This structure is used in various methods to create and manage Direct3D 9Ex devices () and swapchains ().

bb172549 D3DDISPLAYMODEEX D3DDISPLAYMODEEX
Initializes a new instance of the class. Gets the aspect ratio.

The size of this structure. This should always be set to sizeof().

bb172549 unsigned int Size unsigned int Size

Width of the display mode.

bb172549 unsigned int Width unsigned int Width

Height of the display mode.

bb172549 unsigned int Height unsigned int Height

Refresh rate of the display mode.

bb172549 unsigned int RefreshRate unsigned int RefreshRate

Format of the display mode. See .

bb172549 D3DFORMAT Format D3DFORMAT Format

Indicates whether the scanline order is progressive or interlaced. See .

bb172549 D3DSCANLINEORDERING ScanLineOrdering D3DSCANLINEORDERING ScanLineOrdering
A collection of Driver levels support. None Supports for Direct3D7. Supports for Direct3D8. Supports for Direct3D9.

Used to set and query effects, and to choose techniques. An effect object can contain multiple techniques to render the same effect.

The interface is obtained by calling , , or .

The LPD3DXEFFECT type is defined as a reference to this interface.

 typedef interface  ;	
            typedef interface  *LPD3DXEFFECT;	
            
bb205788 ID3DXEffect ID3DXEffect
Starts an active technique. The number of passes needed to render the current technique. HRESULT ID3DXEffect::Begin([Out] unsigned int* pPasses,[In] D3DXFX Flags) Gets or sets the current technique. The technique. D3DXHANDLE ID3DXEffect::GetCurrentTechnique() HRESULT ID3DXEffect::SetTechnique([In] D3DXHANDLE hTechnique) Compiles an effect from a file. The device. Name of the file. The flags. An HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) Compiles an effect from a file. The device. Name of the file. The preprocessor defines. The include file. The skip constants. The flags. An HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) Compiles an effect from a file. The device. Name of the file. The preprocessor defines. The include file. The skip constants. The flags. The pool. An HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) Compiles an effect from a memory buffer. The device. The buffer. The flags. An HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) Compiles an effect from a memory buffer. The device. The buffer. The preprocessor defines. The include file. The skip constants. The flags. An HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) Compiles an effect from a memory buffer. The device. The buffer. The preprocessor defines. The include file. The skip constants. The flags. The pool. An HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) Compiles an effect from a stream. The device. The stream. The flags. An HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) Compiles an effect from a stream. The device. The stream. The preprocessor defines. The include file. The skip constants. The flags. An HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) Compiles an effect from a stream. The device. The stream. The preprocessor defines. The include file. The skip constants. The flags. The pool. An HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) Compiles an effect from a string. The device. The source data. The flags. An HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) Compiles an effect from a string. The device. The source data. The preprocessor defines. The include file. The skip constants. The flags. An HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) Compiles an effect from a string. The device. The source data. The preprocessor defines. The include file. The skip constants. The flags. The pool. An HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) Set a contiguous range of shader constants with a memory copy. The handle. The data. A object describing the result of the operation. HRESULT ID3DXEffect::SetRawValue([In] D3DXHANDLE hParameter,[In] const void* pData,[In] unsigned int ByteOffset,[In] unsigned int Bytes) Set a contiguous range of shader constants with a memory copy. The handle. The data. A object describing the result of the operation. HRESULT ID3DXEffect::SetRawValue([In] D3DXHANDLE hParameter,[In] const void* pData,[In] unsigned int ByteOffset,[In] unsigned int Bytes) Set a contiguous range of shader constants with a memory copy. The handle. The data. The offset. The count in bytes. A object describing the result of the operation. HRESULT ID3DXEffect::SetRawValue([In] D3DXHANDLE hParameter,[In] const void* pData,[In] unsigned int ByteOffset,[In] unsigned int Bytes) Set a contiguous range of shader constants with a memory copy. The handle. The data. The start index. The count. A object describing the result of the operation. HRESULT ID3DXEffect::SetRawValue([In] D3DXHANDLE hParameter,[In] const void* pData,[In] unsigned int ByteOffset,[In] unsigned int Bytes) Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets a reference to the pool of shared parameters.

Pools contain shared parameters between effects. See Cloning and Sharing (Direct3D 9).

bb205827 GetPool GetPool HRESULT ID3DXEffect::GetPool([Out] ID3DXEffectPool** ppPool)

Retrieves the device associated with the effect.

Calling this method will increase the internal reference count for the interface. Be sure to call IUnknown::Release when you are done using the interface or you will have a memory leak.

bb205826 GetDevice GetDevice HRESULT ID3DXEffect::GetDevice([Out] IDirect3DDevice9** ppDevice)

Get or sets the effect state manager.

The is a user-implemented interface that furnishes callbacks into an application for setting device state from an effect.

bb205828 GetStateManager / SetStateManager GetStateManager HRESULT ID3DXEffect::GetStateManager([Out] ID3DXEffectStateManager** ppManager)

Gets a reference to the pool of shared parameters.

Pointer to a object.

This method always returns the value .

Pools contain shared parameters between effects. See Cloning and Sharing (Direct3D 9).

bb205827 HRESULT ID3DXEffect::GetPool([Out] ID3DXEffectPool** ppPool) ID3DXEffect::GetPool

Sets the active technique.

Unique handle to the technique. See Handles (Direct3D 9).

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205834 HRESULT ID3DXEffect::SetTechnique([In] D3DXHANDLE hTechnique) ID3DXEffect::SetTechnique

Gets the current technique.

A unique identifier to the current technique. See Handles (Direct3D 9).

bb205825 D3DXHANDLE ID3DXEffect::GetCurrentTechnique() ID3DXEffect::GetCurrentTechnique

Validate a technique.

Unique identifier. See Handles (Direct3D 9).

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , , , , , , , , , , , and .

bb205835 HRESULT ID3DXEffect::ValidateTechnique([In] D3DXHANDLE hTechnique) ID3DXEffect::ValidateTechnique

Searches for the next valid technique, starting at the technique after the specified technique.

Unique identifier to a technique. See Handles (Direct3D 9). Specify null for this parameter to find the first valid technique.

Pointer to an identifier for the next technique. null is returned if this is the last technique. See Handles (Direct3D 9).

bb205824 HRESULT ID3DXEffect::FindNextValidTechnique([In] D3DXHANDLE hTechnique,[Out] D3DXHANDLE* pTechnique) ID3DXEffect::FindNextValidTechnique

Determines if a parameter is used by the technique.

Unique identifier for the parameter. See Handles (Direct3D 9).

Unique identifier for the technique. See Handles (Direct3D 9).

Returns TRUE if the parameter is being used and returns if the parameter is not being used.

bb205829 BOOL ID3DXEffect::IsParameterUsed([In] D3DXHANDLE hParameter,[In] D3DXHANDLE hTechnique) ID3DXEffect::IsParameterUsed

Starts an active technique.

DWORD that determines if state modified by an effect is saved and restored. The default value 0 specifies that and will save and restore all state modified by the effect (including pixel and vertex shader constants). Valid flags can be seen at Effect State Save and Restore Flags.

Pointer to a value returned that indicates the number of passes needed to render the current technique.

An application sets one active technique in the effect system by calling . The effect system responds by capturing all the pipeline state that can be changed by the technique in a state block. An application signals the end of a technique by calling , which uses the state block to restore the original state. The effect system, therefore, takes care of saving state when a technique becomes active and restoring state when a technique ends. If you choose to disable this save and restore functionality, see .

Within the and pair, an application uses to set the active pass, if any state changes occurred after the pass was activated, and to end the active pass.

bb205815 HRESULT ID3DXEffect::Begin([Out] unsigned int* pPasses,[In] D3DXFX Flags) ID3DXEffect::Begin

Begins a pass, within the active technique.

A zero-based integer index into the technique.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

An application sets one active pass (within one active technique) in the effect system by calling . An application signals the end of the active pass by calling . and must occur in a matching pair, within a matching pair of and calls.

If the application changes any effect state using any of the Effect::Setx methods inside of a / matching pair, the application must call to set the update the device with the state changes. If no state changes occur within a and matching pair, it is not necessary to call .

bb205817 HRESULT ID3DXEffect::BeginPass([In] unsigned int Pass) ID3DXEffect::BeginPass

Propagate state changes that occur inside of an active pass to the device before rendering.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

If the application changes any effect state using any of the ID3DXEffect::Setx methods inside of an / matching pair, the application must call before any DrawxPrimitive call to propagate state changes to the device before rendering. If no state changes occur within a and matching pair, it is not necessary to call .

This is slightly different for any shared parameters in a cloned effect. When a technique is active on a cloned effect (that is, when has been called but and has not been called), updates parameters that are not shared as expected. To update a shared parameter (only for a cloned effect whose technique is active), call to deactivate the technique and to reactivate the technique before calling .

bb205819 HRESULT ID3DXEffect::CommitChanges() ID3DXEffect::CommitChanges

End an active pass.

This method always returns the value .

An application signals the end of rendering an active pass by calling . Each must be part of a matching pair of and calls.

Each matching pair of and calls must be located within a matching pair of and calls.

If the application changes any effect state using any of the Effect::Setx methods inside of a / matching pair, the application must call before any DrawxPrimitive call to propagate state changes to the device before rendering.

bb205823 HRESULT ID3DXEffect::EndPass() ID3DXEffect::EndPass

Ends an active technique.

This method always returns the value .

All rendering in an effect is done within a matching pair of and calls. After all passes are rendered, must be called to end the active technique. The effect system responds by using the state block created when was called, to automatically restore the pipeline state before .

By default, the effect system takes care of saving state prior to a technique, and restoring state after a technique. If you choose to disable this save and restore functionality, see .

bb205821 HRESULT ID3DXEffect::End() ID3DXEffect::End

Retrieves the device associated with the effect.

Address of a reference to an interface, representing the device associated with the effect.

If the method succeeds, the return value is . If the method fails, the return value can be .

Calling this method will increase the internal reference count for the interface. Be sure to call IUnknown::Release when you are done using the interface or you will have a memory leak.

bb205826 HRESULT ID3DXEffect::GetDevice([Out] IDirect3DDevice9** ppDevice) ID3DXEffect::GetDevice

Use this method to release all references to video memory resources and delete all stateblocks. This method should be called whenever a device is lost, or before resetting a device.

If the method succeeds, the return value is . If the method fails, the return value can be .

This method should be called whenever the device is lost or before the user calls . Even if the device was not actually lost, is responsible for freeing stateblocks and other resources that may need to be released before resetting the device. As a result, the font object cannot be used again before calling and then .

bb205830 HRESULT ID3DXEffect::OnLostDevice() ID3DXEffect::OnLostDevice

Use this method to re-acquire resources and save initial state.

If the method succeeds, the return value is . If the method fails, the return value can be .

should be called each time the device is reset (using ), before any other methods are called. This is a good place to re-acquire video-memory resources and capture state blocks.

bb205831 HRESULT ID3DXEffect::OnResetDevice() ID3DXEffect::OnResetDevice

Set the effect state manager.

A reference to the state manager. See .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

The is a user-implemented interface that furnishes callbacks into an application for setting device state from an effect.

bb205833 HRESULT ID3DXEffect::SetStateManager([In] ID3DXEffectStateManager* pManager) ID3DXEffect::SetStateManager

Get the effect state manager.

Returns a reference to the state manager. See .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

The is a user-implemented interface that furnishes callbacks into an application for setting device state from an effect.

bb205828 HRESULT ID3DXEffect::GetStateManager([Out] ID3DXEffectStateManager** ppManager) ID3DXEffect::GetStateManager

Start capturing state changes in a parameter block.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

Capture effect parameter state changes until EndParameterBlock is called. Effect parameters include any state changes outside of a pass. Delete parameter blocks if they are no longer needed by calling DeleteParameterBlock.

bb205816 HRESULT ID3DXEffect::BeginParameterBlock() ID3DXEffect::BeginParameterBlock

Stop capturing effect parameter state changes.

Returns a handle to the parameter state block.

All effect parameters that change state (after calling BeginParameterBlock and before calling EndParameterBlock) will be saved in an effect parameter state block. Use ApplyParameterBlock to apply this block of state changes to the effect system. Once you are finished with a state block use DeleteParameterBlock to free the memory.

bb205822 D3DXHANDLE ID3DXEffect::EndParameterBlock() ID3DXEffect::EndParameterBlock

Apply the values in a state block to the current effect system state.

A handle to the parameter block. This is the handle returned by .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

Capture effect parameter state changes in a parameter block by calling BeginParameterBlock; stop capturing state changes by calling EndParameterBlock. These state changes include any effect parameter changes that occur inside of a technique (including those outside of a pass). Once you are done with the parameter block, call DeleteParameterBlock to recover memory.

bb205814 HRESULT ID3DXEffect::ApplyParameterBlock([In] D3DXHANDLE hParameterBlock) ID3DXEffect::ApplyParameterBlock

Delete a parameter block.

A handle to the parameter block. This is the handle returned by .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

Parameter blocks are blocks of effect states. Use a parameter block to record state changes so that they can be applied later on with a single API call. When no longer needed, delete the parameter block to reduce memory usage.

bb205820 HRESULT ID3DXEffect::DeleteParameterBlock([In] D3DXHANDLE hParameterBlock) ID3DXEffect::DeleteParameterBlock

Creates a copy of an effect.

Pointer to an interface, representing the device associated with the effect.

Pointer to an interface, containing the cloned effect.

Note??This function will not clone an effect if the user specifies during effect creation.

To update shared and non-shared parameters in an active technique of a cloned effect, see .

bb205818 HRESULT ID3DXEffect::CloneEffect([In] IDirect3DDevice9* pDevice,[Out] ID3DXEffect** ppEffect) ID3DXEffect::CloneEffect

Set a contiguous range of shader constants with a memory copy.

Handle to the value to set, or the name of the value passed in as a string. Passing in a handle is more efficient. See Handles (Direct3D 9).

Pointer to a buffer containing the data to be set. SetRawValue checks for valid memory, but does not do any checking for valid data.

Number of bytes between the beginning of the effect data and the beginning of the effect constants you are going to set.

The size of the buffer to be set, in bytes.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following:E_INVALIDCALL.

SetRawValue is a very fast way to set effect constants since it performs a memory copy without performing validation or any data conversion (like converting a row-major matrix to a column-major matrix). Use SetRawValue to set a series of contiguous effect constants. For instance, you could set an array of twenty matrices with 20 calls to or by using a single SetRawValue.

All values are expected to be either matrix4x4s or float4s and all matrices are expected to be in column-major order. Int or float values are cast into a float4; therefore, it is highly recommended that you use SetRawValue with only float4 or matrix4x4 data.

bb205832 HRESULT ID3DXEffect::SetRawValue([In] D3DXHANDLE hParameter,[In] const void* pData,[In] unsigned int ByteOffset,[In] unsigned int Bytes) ID3DXEffect::SetRawValue

The interface compiles an effect from a function or from a vertex shader.

The interface is obtained by calling , , or .

The LPD3DXEFFECTCOMPILER type is defined as a reference to this interface.

 typedef interface  ;	
            typedef interface  *LPD3DXEFFECTCOMPILER;	
            
bb205789 ID3DXEffectCompiler ID3DXEffectCompiler
Initializes a new instance of the class. The data. The defines. The include file. The flags. HRESULT D3DXCreateEffectCompiler([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) Compile an effect. The flags. If a compilation errors occurs Buffer containing the compiled effect. HRESULT ID3DXEffectCompiler::CompileEffect([In] unsigned int Flags,[In] ID3DXBuffer** ppEffect,[In] ID3DXBuffer** ppErrorMsgs) Compiles a shader from an effect that contains one or more functions. The function handle. The target. The flags. If a compilation errors occurs The bytecode of the effect. HRESULT ID3DXEffectCompiler::CompileShader([In] D3DXHANDLE hFunction,[In] const char* pTarget,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) Compiles a shader from an effect that contains one or more functions. The function handle. The target. The flags. The constant table. If a compilation errors occurs The bytecode of the effect. HRESULT ID3DXEffectCompiler::CompileShader([In] D3DXHANDLE hFunction,[In] const char* pTarget,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) Creates an effect compiler from a file on disk containing an ASCII effect description . Name of the file. The flags. An instance of HRESULT D3DXCreateEffectCompiler([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[Out, Fast] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) Creates an effect compiler from a file on disk containing an ASCII effect description . Name of the file. The defines. The include file. The flags. An instance of HRESULT D3DXCreateEffectCompiler([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[Out, Fast] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) Creates an effect compiler from a memory buffer containing an ASCII effect description . The data. The flags. An instance of HRESULT D3DXCreateEffectCompiler([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[Out, Fast] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) Creates an effect compiler from a memory buffer containing an ASCII effect description . The data. The defines. The include file. The flags. An instance of HRESULT D3DXCreateEffectCompiler([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[Out, Fast] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) Creates an effect compiler from a stream containing an ASCII effect description . The stream. The flags. An instance of HRESULT D3DXCreateEffectCompiler([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[Out, Fast] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) Creates an effect compiler from a stream containing an ASCII effect description . The stream. The defines. The include file. The flags. An instance of HRESULT D3DXCreateEffectCompiler([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[Out, Fast] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Toggles the literal status of a parameter. A literal parameter has a value that doesn't change during the lifetime of an effect.

Unique identifier to a parameter. See Handles (Direct3D 9).

Set to TRUE to make the parameter a literal, and if the parameter can change value during the shader lifetime.

If the method succeeds, the return value is . If the method fails, the return value can be .

This methods only changes whether the parameter is a literal or not. To change the value of a parameter, use a method like or .

This function must be called before the effect is compiled. Here is an example of how one might use this function:

 LPD3DXEFFECTCOMPILER pEffectCompiler; char errors[1000];  hr; hr = ("shader.fx", null, null, 0, &pEffectCompiler,  &errors); //In the fx file, literalInt is declared as an int. //By calling this function, the compiler will treat //it as a literal (i.e. #define) hr = pEffectCompiler->SetLiteral("literalInt", TRUE); //create ten different variations of the same effect LPD3DXBUFFER pEffects[10]; LPD3DXBUFFER pErrors; for(int i = 0; i < 10; ++i) { hr = pEffectCompiler->SetInt("literalInt", i); hr = pEffectCompiler->CompileEffect(0, &pEffects[i], &pErrors); }	
            
bb205793 HRESULT ID3DXEffectCompiler::SetLiteral([In] D3DXHANDLE hParameter,[In] BOOL Literal) ID3DXEffectCompiler::SetLiteral

Gets a literal status of a parameter. A literal parameter has a value that doesn't change during the lifetime of an effect.

Unique identifier to a parameter. See Handles (Direct3D 9).

Returns True if the parameter is a literal, and False otherwise.

This methods only changes whether the parameter is a literal or not. To change the value of a parameter, use a method like or .

bb205792 HRESULT ID3DXEffectCompiler::GetLiteral([In] D3DXHANDLE hParameter,[Out] BOOL* pLiteral) ID3DXEffectCompiler::GetLiteral

Compile an effect.

Compile options identified by various flags. The Direct3D 10 HLSL compiler is now the default. See Flags for details.

Buffer containing the compiled effect. For more information about accessing the buffer, see .

Buffer containing at least the first compile error message that occurred. This includes effect compiler errors and high-level language compile errors. For more information about accessing the buffer, see .

If the method succeeds, the return value is .

If the arguments are invalid, the method will return .

If the method fails, the return value will be E_FAIL.

bb205790 HRESULT ID3DXEffectCompiler::CompileEffect([In] unsigned int Flags,[In] ID3DXBuffer** ppEffect,[In] ID3DXBuffer** ppErrorMsgs) ID3DXEffectCompiler::CompileEffect

Compiles a shader from an effect that contains one or more functions.

Unique identifier to the function to be compiled. This value must not be null. See Handles (Direct3D 9).

Pointer to a shader profile which determines the shader instruction set. See or for a list of the profiles available.

Compile options identified by various flags. The Direct3D 10 HLSL compiler is now the default. See Flags for details.

Buffer containing the compiled shader. The compiler shader is an array of DWORDs. For more information about accessing the buffer, see .

Buffer containing at least the first compile error message that occurred. This includes effect compiler errors and high-level language compile errors. For more information about accessing the buffer, see .

Returns an interface, which can be used to access shader constants. This value can be null. If you compile your application as large address aware (that is, you use the /LARGEADDRESSAWARE linker option to handle addresses larger than 2 GB), you cannot use this parameter and must set it to null. Instead, you must use the function to retrieve the shader-constant table that is embedded inside the shader. In this call, you must pass the D3DXCONSTTABLE_LARGEADDRESSAWARE flag to the Flags parameter to specify to access up to 4 GB of virtual address space.

If the method succeeds, the return value is .

If the arguments are invalid, the method will return .

If the method fails, the return value will be E_FAIL.

Targets can be specified for vertex shaders, pixel shaders, and texture fill functions.

Vertex shader targetsvs_1_1, vs_2_0, vs_2_sw, vs_3_0
Pixel shader targetsps_1_1, ps_1_2, ps_1_3, ps_1_4, ps_2_0, ps_2_sw, ps_3_0
Texture fill targetstx_0, tx_1

?

This method compiles a shader from a function that is written in a C-like language. For more information, see HLSL.

bb205791 HRESULT ID3DXEffectCompiler::CompileShader([In] D3DXHANDLE hFunction,[In] const char* pTarget,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) ID3DXEffectCompiler::CompileShader
No documentation. bb280319 D3DXEFFECTDEFAULT D3DXEFFECTDEFAULT Gets the value. No documentation. bb280319 char* pParamName char pParamName No documentation. bb280319 D3DXEFFECTDEFAULTTYPE Type D3DXEFFECTDEFAULTTYPE Type No documentation. bb280319 unsigned int NumBytes unsigned int NumBytes No documentation. bb280319 void* pValue void pValue EffectHandle used to identify a shader parameter. Defines the behavior for caching strings. True by default. Cache of allocated strings. Pointer to the handle or the allocated string. If the is a custom string not cached that needs to be released by this instance. Initializes a new instance of the class. Initializes a new instance of the class. The pointer. Initializes a new instance of the class. The pointer. Initializes a new instance of the class. The name. Clears the cache. By default, this class is caching all strings that are implicitly used as an effect handle. Use this method in order to deallocate all strings that were previously cached. marshal free. The __from. The @ref. Method to marshal from native to managed struct The __from. The @ref. Method to marshal from managed struct tot native The __from. The @ref. Allocates a string. The name. Pointer to the allocated string Performs an implicit conversion from to . The value. The result of the conversion. Performs an implicit conversion from to . The value. The result of the conversion. Performs an implicit conversion from to raw pointer"/>. The value. The result of the conversion. Performs an implicit conversion from raw pointer to . The value. The result of the conversion. Performs an implicit conversion from to . The name. The result of the conversion.

Data type for managing a set of default effect parameters.

bb172823 D3DXEFFECTINSTANCE D3DXEFFECTINSTANCE

Name of the effect file.

bb172823 char* pEffectFilename char pEffectFilename

Number of default parameters.

bb172823 unsigned int NumDefaults unsigned int NumDefaults

Pointer to an array of elements, each of which contains an effect parameter.

bb172823 D3DXEFFECTDEFAULT* pDefaults D3DXEFFECTDEFAULT pDefaults

Applications use the interface to identify parameters that are going to be shared across effects. See parameter sharing in Cloning and Sharing (Direct3D 9). This interface has no methods.

The interface is obtained by calling .

The LPD3DXEFFECTPOOL type is defined as a reference to this interface.

 typedef interface  ;	
            typedef interface  *LPD3DXEFFECTPOOL;	
            
bb205794 ID3DXEffectPool ID3DXEffectPool
Initializes a new instance of the class. Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. A callback function used to fill 2D texture. Texture coordinate being sampled. Dimensions of the texel. The desired color of the specified texel. typedef VOID (WINAPI *LPD3DXFILL2D)(D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pTexCoord, CONST D3DXVECTOR2 *pTexelSize, LPVOID pData); A callback function used to fill 3D texture. Texture coordinate being sampled. Dimensions of the texel. The desired color of the specified texel. typedef VOID (WINAPI *LPD3DXFILL2D)(D3DXVECTOR4 *pOut, CONST D3DXVECTOR2 *pTexCoord, CONST D3DXVECTOR2 *pTexelSize, LPVOID pData); Fill callback helper class. Pointer to the native callback for 2D function Pointer to the native callback for 3D function

The interface encapsulates the textures and resources needed to render a specific font on a specific device.

The interface is obtained by calling or .

The LPD3DXFONT type is defined as a reference to the interface.

 typedef interface  ;	
            typedef interface  *LPD3DXFONT;	
            
bb173961 ID3DXFont ID3DXFont
Initializes a new instance of the class. The device. The font description. Initializes a new instance of the class. The device. The height. The width. The weight. The mip levels. if set to true [is italic]. The character set. The precision. The quality. The pitch and family. Name of the face. Load formatted text into video memory to improve the efficiency of rendering to the device. This method supports ANSI and Unicode strings. The compiler setting also determines the function version. If Unicode is defined, the function call resolves to PreloadTextW. Otherwise, the function call resolves to PreloadTextA because ANSI strings are being used. This method generates textures that contain glyphs that represent the input text. The glyphs are drawn as a series of triangles. Text will not be rendered to the device; ID3DX10Font::DrawText must still be called to render the text. However, by preloading text into video memory, ID3DX10Font::DrawText will use substantially fewer CPU resources. This method internally converts characters to glyphs using the GDI function {{GetCharacterPlacement}}. Pointer to a string of characters to be loaded into video memory. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR; otherwise, the data type resolves to LPCSTR. See Remarks. If the method succeeds, the return value is S_OK. If the method fails, the return value can be one of the following: D3DERR_INVALIDCALL, D3DXERR_INVALIDDATA. HRESULT ID3DX10Font::PreloadTextW([None] const wchar_t* pString,[None] int Count) Draws formatted text. Pointer to an object that contains the string. Can be null, in which case Direct3D will render the string with its own sprite object. To improve efficiency, a sprite object should be specified if DrawText is to be called more than once in a row. Pointer to a string to draw. If the Count parameter is -1, the string must be null-terminated. Pointer to a structure that contains the rectangle, in logical coordinates, in which the text is to be formatted. The coordinate value of the rectangle's right side must be greater than that of its left side. Likewise, the coordinate value of the bottom must be greater than that of the top. Specifies the method of formatting the text. It can be any combination of the following values: ValueMeaning DT_BOTTOM Justifies the text to the bottom of the rectangle. This value must be combined with DT_SINGLELINE. DT_CALCRECT Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the pRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text. DT_CENTER Centers text horizontally in the rectangle. DT_EXPANDTABS Expands tab characters. The default number of characters per tab is eight. DT_LEFT Aligns text to the left. DT_NOCLIP Draws without clipping. DrawText is somewhat faster when DT_NOCLIP is used. DT_RIGHT Aligns text to the right. DT_RTLREADING Displays text in right-to-left reading order for bidirectional text when a Hebrew or Arabic font is selected. The default reading order for all text is left-to-right. DT_SINGLELINE Displays text on a single line only. Carriage returns and line feeds do not break the line. DT_TOP Top-justifies text. DT_VCENTER Centers text vertically (single line only). DT_WORDBREAK Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the pRect parameter. A carriage return/line feed sequence also breaks the line. ? Color of the text. For more information, see . If the function succeeds, the return value is the height of the text in logical units. If DT_VCENTER or DT_BOTTOM is specified, the return value is the offset from pRect (top to the bottom) of the drawn text. If the function fails, the return value is zero. The parameters of this method are very similar to those of the GDI DrawText function.This method supports both ANSI and Unicode strings.This method must be called inside a BeginScene ... EndScene block. The only exception is when an application calls DrawText with DT_CALCRECT to calculate the size of a given block of text.Unless the DT_NOCLIP format is used, this method clips the text so that it does not appear outside the specified rectangle. All formatting is assumed to have multiple lines unless the DT_SINGLELINE format is specified.If the selected font is too large for the rectangle, this method does not attempt to substitute a smaller font.This method supports only fonts whose escapement and orientation are both zero. int ID3DXFont::DrawTextW([In] ID3DXSprite* pSprite,[In] const wchar_t* pString,[In] int Count,[In] void* pRect,[In] unsigned int Format,[In] D3DCOLOR Color) Draws formatted text. Pointer to an object that contains the string. Can be null, in which case Direct3D will render the string with its own sprite object. To improve efficiency, a sprite object should be specified if DrawText is to be called more than once in a row. Pointer to a string to draw. If the Count parameter is -1, the string must be null-terminated. The x position to draw the text. The y position to draw the text. Color of the text. For more information, see . If the function succeeds, the return value is the height of the text in logical units. If DT_VCENTER or DT_BOTTOM is specified, the return value is the offset from pRect (top to the bottom) of the drawn text. If the function fails, the return value is zero. int ID3DXFont::DrawTextW([In] ID3DXSprite* pSprite,[In] const wchar_t* pString,[In] int Count,[In] void* pRect,[In] unsigned int Format,[In] D3DCOLOR Color) The parameters of this method are very similar to those of the GDI DrawText function.This method supports both ANSI and Unicode strings.This method must be called inside a BeginScene ... EndScene block. The only exception is when an application calls DrawText with DT_CALCRECT to calculate the size of a given block of text.Unless the DT_NOCLIP format is used, this method clips the text so that it does not appear outside the specified rectangle. All formatting is assumed to have multiple lines unless the DT_SINGLELINE format is specified.If the selected font is too large for the rectangle, this method does not attempt to substitute a smaller font.This method supports only fonts whose escapement and orientation are both zero. Measures the specified sprite. Pointer to an object that contains the string. Can be null, in which case Direct3D will render the string with its own sprite object. To improve efficiency, a sprite object should be specified if DrawText is to be called more than once in a row. Pointer to a string to draw. If the Count parameter is -1, the string must be null-terminated. Specifies the method of formatting the text. It can be any combination of the following values: ValueMeaning DT_BOTTOM Justifies the text to the bottom of the rectangle. This value must be combined with DT_SINGLELINE. DT_CALCRECT Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the pRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text. DT_CENTER Centers text horizontally in the rectangle. DT_EXPANDTABS Expands tab characters. The default number of characters per tab is eight. DT_LEFT Aligns text to the left. DT_NOCLIP Draws without clipping. DrawText is somewhat faster when DT_NOCLIP is used. DT_RIGHT Aligns text to the right. DT_RTLREADING Displays text in right-to-left reading order for bidirectional text when a Hebrew or Arabic font is selected. The default reading order for all text is left-to-right. DT_SINGLELINE Displays text on a single line only. Carriage returns and line feeds do not break the line. DT_TOP Top-justifies text. DT_VCENTER Centers text vertically (single line only). DT_WORDBREAK Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the pRect parameter. A carriage return/line feed sequence also breaks the line. ? Determines the width and height of the rectangle. If there are multiple lines of text, this function uses the width of the rectangle pointed to by the rect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, this method modifies the right side of the rectangle so that it bounds the last character in the line. Measures the specified sprite. Pointer to an object that contains the string. Can be null, in which case Direct3D will render the string with its own sprite object. To improve efficiency, a sprite object should be specified if DrawText is to be called more than once in a row. Pointer to a string to draw. If the Count parameter is -1, the string must be null-terminated. Pointer to a structure that contains the rectangle, in logical coordinates, in which the text is to be formatted. The coordinate value of the rectangle's right side must be greater than that of its left side. Likewise, the coordinate value of the bottom must be greater than that of the top. Specifies the method of formatting the text. It can be any combination of the following values: ValueMeaning DT_BOTTOM Justifies the text to the bottom of the rectangle. This value must be combined with DT_SINGLELINE. DT_CALCRECT Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the pRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text. DT_CENTER Centers text horizontally in the rectangle. DT_EXPANDTABS Expands tab characters. The default number of characters per tab is eight. DT_LEFT Aligns text to the left. DT_NOCLIP Draws without clipping. DrawText is somewhat faster when DT_NOCLIP is used. DT_RIGHT Aligns text to the right. DT_RTLREADING Displays text in right-to-left reading order for bidirectional text when a Hebrew or Arabic font is selected. The default reading order for all text is left-to-right. DT_SINGLELINE Displays text on a single line only. Carriage returns and line feeds do not break the line. DT_TOP Top-justifies text. DT_VCENTER Centers text vertically (single line only). DT_WORDBREAK Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the pRect parameter. A carriage return/line feed sequence also breaks the line. ? Determines the width and height of the rectangle. If there are multiple lines of text, this function uses the width of the rectangle pointed to by the rect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, this method modifies the right side of the rectangle so that it bounds the last character in the line. Measures the specified sprite. Pointer to an object that contains the string. Can be null, in which case Direct3D will render the string with its own sprite object. To improve efficiency, a sprite object should be specified if DrawText is to be called more than once in a row. Pointer to a string to draw. If the Count parameter is -1, the string must be null-terminated. Pointer to a structure that contains the rectangle, in logical coordinates, in which the text is to be formatted. The coordinate value of the rectangle's right side must be greater than that of its left side. Likewise, the coordinate value of the bottom must be greater than that of the top. Specifies the method of formatting the text. It can be any combination of the following values: ValueMeaning DT_BOTTOM Justifies the text to the bottom of the rectangle. This value must be combined with DT_SINGLELINE. DT_CALCRECT Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the pRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text. DT_CENTER Centers text horizontally in the rectangle. DT_EXPANDTABS Expands tab characters. The default number of characters per tab is eight. DT_LEFT Aligns text to the left. DT_NOCLIP Draws without clipping. DrawText is somewhat faster when DT_NOCLIP is used. DT_RIGHT Aligns text to the right. DT_RTLREADING Displays text in right-to-left reading order for bidirectional text when a Hebrew or Arabic font is selected. The default reading order for all text is left-to-right. DT_SINGLELINE Displays text on a single line only. Carriage returns and line feeds do not break the line. DT_TOP Top-justifies text. DT_VCENTER Centers text vertically (single line only). DT_WORDBREAK Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the pRect parameter. A carriage return/line feed sequence also breaks the line. ? The height of the formatted text but does not draw the text. Determines the width and height of the rectangle. If there are multiple lines of text, this function uses the width of the rectangle pointed to by the rect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, this method modifies the right side of the rectangle so that it bounds the last character in the line. Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the Direct3D device associated with the font object.

Note??Calling this method will increase the internal reference count on the interface. Be sure to call when you are done using this interface or you will have a memory leak.

bb173965 GetDevice GetDevice HRESULT ID3DXFont::GetDevice([Out] IDirect3DDevice9** ppDevice)

Gets a description of the current font object. GetDescW and GetDescA are identical to this method, except that a reference is returned to a or D3DXFONT_DESCA structure, respectively.

This method describes Unicode font objects if UNICODE is defined. Otherwise GetDescA is called, which returns a reference to the D3DXFONT_DESCA structure.

bb173964 GetDescW GetDescW HRESULT ID3DXFont::GetDescW([Out] D3DXFONT_DESCW* pDesc)

Returns a handle to a display device context (DC) that has the font set.

bb173963 GetDC GetDC HDC ID3DXFont::GetDC()

Retrieves the Direct3D device associated with the font object.

Address of a reference to an interface, representing the Direct3D device object associated with the font object.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

Note??Calling this method will increase the internal reference count on the interface. Be sure to call when you are done using this interface or you will have a memory leak.

bb173965 HRESULT ID3DXFont::GetDevice([Out] IDirect3DDevice9** ppDevice) ID3DXFont::GetDevice

Gets a description of the current font object. GetDescW and GetDescA are identical to this method, except that a reference is returned to a or D3DXFONT_DESCA structure, respectively.

No documentation.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

This method describes Unicode font objects if UNICODE is defined. Otherwise GetDescA is called, which returns a reference to the D3DXFONT_DESCA structure.

bb173964 HRESULT ID3DXFont::GetDescW([Out] D3DXFONT_DESCW* pDesc) ID3DXFont::GetDescW

Retrieves font characteristics that are identified in a structure. This method supports ANSI and Unicode compiler settings.

No documentation.

Nonzero if the function is successful; otherwise 0.

The compiler setting also determines the structure type. If Unicode is defined, the function returns a structure. Otherwise, the function call returns a structure.

bb173967 BOOL ID3DXFont::GetTextMetricsW([Out] TEXTMETRICW* pTextMetrics) ID3DXFont::GetTextMetricsW

Returns a handle to a display device context (DC) that has the font set.

Handle to a display DC.

bb173963 HDC ID3DXFont::GetDC() ID3DXFont::GetDC

Returns information about the placement and orientation of a glyph in a character cell.

Glyph identifier.

Address of a reference to a object that contains the glyph.

Pointer to the smallest rectangle object that completely encloses the glyph.

Pointer to the two-dimensional vector that connects the origin of the current character cell to the origin of the next character cell. See .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

bb173966 HRESULT ID3DXFont::GetGlyphData([In] unsigned int Glyph,[Out] IDirect3DTexture9** ppTexture,[Out] RECT* pBlackBox,[Out] POINT* pCellInc) ID3DXFont::GetGlyphData

Loads a series of characters into video memory to improve the efficiency of rendering to the device.

ID of the first character to be loaded into video memory.

ID of the last character to be loaded into video memory.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

This method generates textures containing glyphs that represent the input characters. The glyphs are drawn as a series of triangles.

Characters will not be rendered to the device; DrawText must still be called to render the characters. However, by pre-loading characters into video memory, DrawText will use substantially fewer CPU resources.

This method internally converts characters to glyphs using the GDI function GetCharacterPlacement.

bb173970 HRESULT ID3DXFont::PreloadCharacters([In] unsigned int First,[In] unsigned int Last) ID3DXFont::PreloadCharacters

Loads a series of glyphs into video memory to improve the efficiency of rendering to the device.

ID of the first glyph to be loaded into video memory.

ID of the last glyph to be loaded into video memory.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

This method generates textures that contain the input glyphs. The glyphs are drawn as a series of triangles.

Glyphs will not be rendered to the device; DrawText must still be called to render the glyphs. However, by pre-loading glyphs into video memory, DrawText will use substantially fewer CPU resources.

bb173971 HRESULT ID3DXFont::PreloadGlyphs([In] unsigned int First,[In] unsigned int Last) ID3DXFont::PreloadGlyphs

Loads formatted text into video memory to improve the efficiency of rendering to the device. This method supports ANSI and Unicode strings.

Pointer to a string of characters to be loaded into video memory. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR; otherwise, the data type resolves to LPCSTR. See Remarks.

Number of characters in the text string.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to PreloadTextW. Otherwise, the function call resolves to PreloadTextA because ANSI strings are being used.

This method generates textures that contain glyphs that represent the input text. The glyphs are drawn as a series of triangles.

Text will not be rendered to the device; DrawText must still be called to render the text. However, by preloading text into video memory, DrawText will use substantially fewer CPU resources.

This method internally converts characters to glyphs using the GDI function GetCharacterPlacement.

bb173972 HRESULT ID3DXFont::PreloadTextW([In] const wchar_t* pString,[In] int Count) ID3DXFont::PreloadTextW

Draws formatted text. This method supports ANSI and Unicode strings.

Pointer to an object that contains the string. Can be null, in which case Direct3D will render the string with its own sprite object. To improve efficiency, a sprite object should be specified if DrawText is to be called more than once in a row.

Pointer to a string to draw. If the Count parameter is -1, the string must be null-terminated.

Specifies the number of characters in the string. If Count is -1, then the pString parameter is assumed to be a reference to a null-terminated string and DrawText computes the character count automatically.

Pointer to a structure that contains the rectangle, in logical coordinates, in which the text is to be formatted. The coordinate value of the rectangle's right side must be greater than that of its left side. Likewise, the coordinate value of the bottom must be greater than that of the top.

Specifies the method of formatting the text. It can be any combination of the following values:

ValueMeaning
DT_BOTTOM

Justifies the text to the bottom of the rectangle. This value must be combined with DT_SINGLELINE.

DT_CALCRECT

Determines the width and height of the rectangle. If there are multiple lines of text, DrawText uses the width of the rectangle pointed to by the pRect parameter and extends the base of the rectangle to bound the last line of text. If there is only one line of text, DrawText modifies the right side of the rectangle so that it bounds the last character in the line. In either case, DrawText returns the height of the formatted text but does not draw the text.

DT_CENTER

Centers text horizontally in the rectangle.

DT_EXPANDTABS

Expands tab characters. The default number of characters per tab is eight.

DT_LEFT

Aligns text to the left.

DT_NOCLIP

Draws without clipping. DrawText is somewhat faster when DT_NOCLIP is used.

DT_RIGHT

Aligns text to the right.

DT_RTLREADING

Displays text in right-to-left reading order for bidirectional text when a Hebrew or Arabic font is selected. The default reading order for all text is left-to-right.

DT_SINGLELINE

Displays text on a single line only. Carriage returns and line feeds do not break the line.

DT_TOP

Top-justifies text.

DT_VCENTER

Centers text vertically (single line only).

DT_WORDBREAK

Breaks words. Lines are automatically broken between words if a word would extend past the edge of the rectangle specified by the pRect parameter. A carriage return/line feed sequence also breaks the line.

?

Color of the text. For more information, see .

If the function succeeds, the return value is the height of the text in logical units. If DT_VCENTER or DT_BOTTOM is specified, the return value is the offset from pRect (top to the bottom) of the drawn text. If the function fails, the return value is zero.

The parameters of this method are very similar to those of the GDI DrawText function.

This method supports both ANSI and Unicode strings.

This method must be called inside a BeginScene ... EndScene block. The only exception is when an application calls DrawText with DT_CALCRECT to calculate the size of a given block of text.

Unless the DT_NOCLIP format is used, this method clips the text so that it does not appear outside the specified rectangle. All formatting is assumed to have multiple lines unless the DT_SINGLELINE format is specified.

If the selected font is too large for the rectangle, this method does not attempt to substitute a smaller font.

This method supports only fonts whose escapement and orientation are both zero.

bb173962 int ID3DXFont::DrawTextW([In] ID3DXSprite* pSprite,[In] const wchar_t* pString,[In] int Count,[In] void* pRect,[In] unsigned int Format,[In] D3DCOLOR Color) ID3DXFont::DrawTextW

Use this method to release all references to video memory resources and delete all stateblocks. This method should be called whenever a device is lost, or before resetting a device.

If the method succeeds, the return value is . If the method fails, the return value can be .

This method should be called whenever the device is lost or before the user calls Reset. Even if the device was not actually lost, OnLostDevice is responsible for freeing stateblocks and other resources that may need to be released before resetting the device. As a result, the font object cannot be used again before calling Reset and then OnResetDevice.

bb173968 HRESULT ID3DXFont::OnLostDevice() ID3DXFont::OnLostDevice

Use this method to re-acquire resources and save initial state.

If the method succeeds, the return value is . If the method fails, the return value can be .

OnResetDevice should be called each time the device is reset (using Reset), before any other methods are called. This is a good place to re-acquire video-memory resources and capture state blocks.

bb173969 HRESULT ID3DXFont::OnResetDevice() ID3DXFont::OnResetDevice
Defines possible character sets for fonts. CHARSET The ANSI character set. The Arabic character set. The Baltic character set. The Chinese character set. The default system character set. The East Europe character set. The GB2312 character set. The Greek character set. The Hangul character set. The Hebrew character set. The Johab character set. The Mac character set. The OEM character set. The Russian character set. The ShiftJIS character set. The symbol character set. The Thai character set. The Turkish character set. The Vietnamese character set. Specifies formatting options for text rendering. DT Align the text to the bottom. Align the text to the center. Expand tab characters. Align the text to the left. Don't clip the text. Align the text to the right. Rendering the text in right-to-left reading order. Force all text to a single line. Align the text to the top. Vertically align the text to the center. Allow word breaks. Defines pitch and family settings for fonts. Use the Decorative family. Default pitch. The font family doesn't matter. Fixed pitch. Use the Modern family. Mono pitch. Use the Roman family. Use the Script family. Use the Swiss family. Variable pitch. Defines precision levels for font rendering. OutPrecision Default String Character Stroke TrueType Device Raster TrueTypeOnly Outline ScreenOutline PostScriptOnly Specifies quality options for font rendering. QUALITY Default Draft Proof Non antialiased Antialiased ClearType ClearTypeNatural Specifies weights for font rendering. FW Use a black weight. Use a bold weight. Use a demi-bold weight. The font weight doesn't matter. Use an extra bold weight. Make the font extra light. Use a heavy weight. Make the font light. Use a medium weight. Use a normal weight. Use a regular weight. Use a semi-bold weight. Make the font thin. Use an ultra bold weight. Make the font ultra light.

Defines constants that describe the type of back buffer.

Direct3D 9 does not support stereo view, so Direct3D does not use the and values of this enumerated type.

bb172506 D3DBACKBUFFER_TYPE D3DBACKBUFFER_TYPE

Specifies a nonstereo swap chain.

bb172506 D3DBACKBUFFER_TYPE_MONO D3DBACKBUFFER_TYPE_MONO

Specifies the left side of a stereo pair in a swap chain.

bb172506 D3DBACKBUFFER_TYPE_LEFT D3DBACKBUFFER_TYPE_LEFT

Specifies the right side of a stereo pair in a swap chain.

bb172506 D3DBACKBUFFER_TYPE_RIGHT D3DBACKBUFFER_TYPE_RIGHT

Defines the basis type of a high-order patch surface.

The members of specify the formulation to be used in evaluating the high-order patch surface primitive during tessellation.

bb172507 D3DBASISTYPE D3DBASISTYPE

Input vertices are treated as a series of B?zier patches. The number of vertices specified must be divisible by 4. Portions of the mesh beyond this criterion will not be rendered. Full continuity is assumed between sub-patches in the interior of the surface rendered by each call. Only the vertices at the corners of each sub-patch are guaranteed to lie on the resulting surface.

bb172507 D3DBASIS_BEZIER D3DBASIS_BEZIER

Input vertices are treated as control points of a B-spline surface. The number of apertures rendered is two fewer than the number of apertures in that direction. In general, the generated surface does not contain the control vertices specified.

bb172507 D3DBASIS_BSPLINE D3DBASIS_BSPLINE

An interpolating basis defines the surface so that the surface goes through all the input vertices specified. In DirectX 8, this was D3DBASIS_INTERPOLATE.

bb172507 D3DBASIS_CATMULL_ROM D3DBASIS_CATMULL_ROM

Defines the supported blend mode.

In the preceding member descriptions, the RGBA values of the source and destination are indicated by the s and d subscripts.

The values in this enumerated type are used by the following render states:

See

bb172508 D3DBLEND D3DBLEND

Blend factor is (0, 0, 0, 0).

bb172508 D3DBLEND_ZERO D3DBLEND_ZERO

Blend factor is (1, 1, 1, 1).

bb172508 D3DBLEND_ONE D3DBLEND_ONE

Blend factor is (Rs, Gs, Bs, As).

bb172508 D3DBLEND_SRCCOLOR D3DBLEND_SRCCOLOR

Blend factor is (1 - Rs, 1 - Gs, 1 - Bs, 1 - As).

bb172508 D3DBLEND_INVSRCCOLOR D3DBLEND_INVSRCCOLOR

Blend factor is (As, As, As, As).

bb172508 D3DBLEND_SRCALPHA D3DBLEND_SRCALPHA

Blend factor is ( 1 - As, 1 - As, 1 - As, 1 - As).

bb172508 D3DBLEND_INVSRCALPHA D3DBLEND_INVSRCALPHA

Blend factor is (Ad Ad Ad Ad).

bb172508 D3DBLEND_DESTALPHA D3DBLEND_DESTALPHA

Blend factor is (1 - Ad 1 - Ad 1 - Ad 1 - Ad).

bb172508 D3DBLEND_INVDESTALPHA D3DBLEND_INVDESTALPHA

Blend factor is (Rd, Gd, Bd, Ad).

bb172508 D3DBLEND_DESTCOLOR D3DBLEND_DESTCOLOR

Blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad).

bb172508 D3DBLEND_INVDESTCOLOR D3DBLEND_INVDESTCOLOR

Blend factor is (f, f, f, 1); where f = min(As, 1 - Ad).

bb172508 D3DBLEND_SRCALPHASAT D3DBLEND_SRCALPHASAT

Obsolete. Starting with DirectX 6, you can achieve the same effect by setting the source and destination blend factors to and in separate calls.

bb172508 D3DBLEND_BOTHSRCALPHA D3DBLEND_BOTHSRCALPHA

Obsolete. Source blend factor is (1 - As, 1 - As, 1 - As, 1 - As), and destination blend factor is (As, As, As, As); the destination blend selection is overridden. This blend mode is supported only for the render state.

bb172508 D3DBLEND_BOTHINVSRCALPHA D3DBLEND_BOTHINVSRCALPHA

Constant color blending factor used by the frame-buffer blender. This blend mode is supported only if is set in the SrcBlendCaps or DestBlendCaps members of .

bb172508 D3DBLEND_BLENDFACTOR D3DBLEND_BLENDFACTOR

Inverted constant color-blending factor used by the frame-buffer blender. This blend mode is supported only if the bit is set in the SrcBlendCaps or DestBlendCaps members of .

bb172508 D3DBLEND_INVBLENDFACTOR D3DBLEND_INVBLENDFACTOR

Blend factor is (PSOutColor[1]r, PSOutColor[1]g, PSOutColor[1]b, not used). See Render.

Differences between Direct3D 9 and Direct3D 9Ex:

This flag is available in Direct3D 9Ex only.

?

bb172508 D3DBLEND_SRCCOLOR2 D3DBLEND_SRCCOLOR2

Blend factor is (1 - PSOutColor[1]r, 1 - PSOutColor[1]g, 1 - PSOutColor[1]b, not used)). See Render.

Differences between Direct3D 9 and Direct3D 9Ex:

This flag is available in Direct3D 9Ex only.

?

bb172508 D3DBLEND_INVSRCCOLOR2 D3DBLEND_INVSRCCOLOR2

Represents the capabilities of the hardware exposed through the Direct3D object.

The MaxTextureBlendStages and MaxSimultaneousTextures members might seem similar, but they contain different information. The MaxTextureBlendStages member contains the total number of texture-blending stages supported by the current device, and the MaxSimultaneousTextures member describes how many of those stages can have textures bound to them by using the SetTexture method.

When the driver fills this structure, it can set values for execute-buffer capabilities, even when the interface being used to retrieve the capabilities (such as ) does not support execute buffers.

In general, performance problems may occur if you use a texture and then modify it during a scene. Ensure that no texture used in the current BeginScene and EndScene block is evicted unless absolutely necessary. In the case of extremely high texture usage within a scene, the results are undefined. This occurs when you modify a texture that you have used in the scene and there is no spare texture memory available. For such systems, the contents of the z-buffer become invalid at EndScene. Applications should not call UpdateSurface to or from the back buffer on this type of hardware inside a BeginScene/EndScene pair. In addition, applications should not try to access the z-buffer if the capability flag is set. Finally, applications should not lock the back buffer or the z-buffer inside a BeginScene/EndScene pair.

The following flags concerning mipmapped textures are not supported in Direct3D 9.

  • D3DPTFILTERCAPS_LINEAR
  • D3DPTFILTERCAPS_LINEARMIPLINEAR
  • D3DPTFILTERCAPS_LINEARMIPNEAREST
  • D3DPTFILTERCAPS_MIPNEAREST
  • D3DPTFILTERCAPS_NEAREST
bb172513 D3DPBLENDCAPS D3DPBLENDCAPS

Member of the enumerated type, which identifies what type of resources are used for processing vertices.

bb172513 D3DPBLENDCAPS_ZERO D3DPBLENDCAPS_ZERO

Adapter on which this Direct3D device was created. This ordinal is valid only to pass to methods of the interface that created this Direct3D device. The interface can always be retrieved by calling GetDirect3D.

bb172513 D3DPBLENDCAPS_ONE D3DPBLENDCAPS_ONE

The following driver-specific capability.

ValueMeaning

Display hardware is capable of returning the current scan line.

The display driver supports an overlay DDI that allows for verification of overlay capabilities. For more information about the overlay DDI, see Overlay DDI.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

?

bb172513 D3DPBLENDCAPS_SRCCOLOR D3DPBLENDCAPS_SRCCOLOR

Driver-specific capabilities identified in .

bb172513 D3DPBLENDCAPS_INVSRCCOLOR D3DPBLENDCAPS_INVSRCCOLOR

Driver-specific capabilities identified in .

bb172513 D3DPBLENDCAPS_SRCALPHA D3DPBLENDCAPS_SRCALPHA

Bit mask of values representing what presentation swap intervals are available.

ValueMeaning

The driver supports an immediate presentation swap interval.

The driver supports a presentation swap interval of every screen refresh.

The driver supports a presentation swap interval of every second screen refresh.

The driver supports a presentation swap interval of every third screen refresh.

The driver supports a presentation swap interval of every fourth screen refresh.

?

bb172513 D3DPBLENDCAPS_INVSRCALPHA D3DPBLENDCAPS_INVSRCALPHA

Bit mask indicating what hardware support is available for cursors. Direct3D 9 does not define alpha-blending cursor capabilities.

ValueMeaning

A full-color cursor is supported in hardware. Specifically, this flag indicates that the driver supports at least a hardware color cursor in high-resolution modes (with scan lines greater than or equal to 400).

A full-color cursor is supported in hardware. Specifically, this flag indicates that the driver supports a hardware color cursor in both high-resolution and low-resolution modes (with scan lines less than 400).

?

bb172513 D3DPBLENDCAPS_DESTALPHA D3DPBLENDCAPS_DESTALPHA

Flags identifying the capabilities of the device.

ValueMeaning

Device supports blits from system-memory textures to nonlocal video-memory textures.

Device can queue rendering commands after a page flip. Applications do not change their behavior if this flag is set; this capability means that the device is relatively fast.

Device can support at least a DirectX 5-compliant driver.

Device can support at least a DirectX 7-compliant driver.

Device exports an -aware hal.

Device can use execute buffers from system memory.

Device can use execute buffers from video memory.

Device has hardware acceleration for scene rasterization.

Device can support transformation and lighting in hardware.

Device supports N patches.

Device can support rasterization, transform, lighting, and shading in hardware.

Device supports quintic B?zier curves and B-splines.

Device supports rectangular and triangular patches.

When this device capability is set, the hardware architecture does not require caching of any information, and uncached patches (handle zero) will be drawn as efficiently as cached ones. Note that setting does not mean that a patch with handle zero can be drawn. A handle-zero patch can always be drawn whether this cap is set or not.

Device is texturing from separate memory pools.

Device can retrieve textures from non-local video memory.

Device can retrieve textures from system memory.

Device can retrieve textures from device memory.

Device can use buffers from system memory for transformed and lit vertices.

Device can use buffers from video memory for transformed and lit vertices.

?

bb172513 D3DPBLENDCAPS_INVDESTALPHA D3DPBLENDCAPS_INVDESTALPHA

Miscellaneous driver primitive capabilities. See .

bb172513 D3DPBLENDCAPS_DESTCOLOR D3DPBLENDCAPS_DESTCOLOR

Information on raster-drawing capabilities. This member can be one or more of the following flags.

ValueMeaning

Device supports anisotropic filtering.

Device iterates colors perspective correctly.

Device can dither to improve color resolution.

Device supports legacy depth bias. For true depth bias, see .

Device supports range-based fog. In range-based fog, the distance of an object from the viewer is used to compute fog effects, not the depth of the object (that is, the z-coordinate) in the scene.

Device calculates the fog value by referring to a lookup table containing fog values that are indexed to the depth of a given pixel.

Device calculates the fog value during the lighting operation and interpolates the fog value during rasterization.

Device supports level-of-detail bias adjustments. These bias adjustments enable an application to make a mipmap appear crisper or less sharp than it normally would. For more information about level-of-detail bias in mipmaps, see .

Device supports toggling multisampling on and off between and (using ).

Device supports scissor test. See Scissor Test (Direct3D 9).

Device performs true slope-scale based depth bias. This is in contrast to the legacy style depth bias.

Device supports depth buffering using w.

Device supports w-based fog. W-based fog is used when a perspective projection matrix is specified, but affine projections still use z-based fog. The system considers a projection matrix that contains a nonzero value in the [3][4] element to be a perspective projection matrix.

Device can perform hidden-surface removal (HSR) without requiring the application to sort polygons and without requiring the allocation of a depth-buffer. This leaves more video memory for textures. The method used to perform HSR is hardware-dependent and is transparent to the application.

Z-bufferless HSR is performed if no depth-buffer surface is associated with the rendering-target surface and the depth-buffer comparison test is enabled (that is, when the state value associated with the enumeration constant is set to TRUE).

Device supports z-based fog.

Device can perform z-test operations. This effectively renders a primitive and indicates whether any z pixels have been rendered.

?

bb172513 D3DPBLENDCAPS_INVDESTCOLOR D3DPBLENDCAPS_INVDESTCOLOR

Z-buffer comparison capabilities. This member can be one or more of the following flags.

ValueMeaning

Always pass the z-test.

Pass the z-test if the new z equals the current z.

Pass the z-test if the new z is greater than the current z.

Pass the z-test if the new z is greater than or equal to the current z.

Pass the z-test if the new z is less than the current z.

Pass the z-test if the new z is less than or equal to the current z.

Always fail the z-test.

Pass the z-test if the new z does not equal the current z.

?

bb172513 D3DPBLENDCAPS_SRCALPHASAT D3DPBLENDCAPS_SRCALPHASAT

Source-blending capabilities. This member can be one or more of the following flags. (The RGBA values of the source and destination are indicated by the subscripts s and d.)

ValueMeaning

The driver supports both and . See .

Source blend factor is (1 - As, 1 - As, 1 - As, 1 - As) and destination blend factor is (As, As, As, As); the destination blend selection is overridden.

The driver supports the blend mode. (This blend mode is obsolete. For more information, see .)

Blend factor is (Ad, Ad, Ad, Ad).

Blend factor is (Rd, Gd, Bd, Ad).

Blend factor is (1 - Ad, 1 - Ad, 1 - Ad, 1 - Ad).

Blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad).

Blend factor is (1 - As, 1 - As, 1 - As, 1 - As).

Blend factor is (1 - Rs, 1 - Gs, 1 - Bs, 1 - As).

Blend factor is (1 - PSOutColor[1]r, 1 - PSOutColor[1]g, 1 - PSOutColor[1]b, not used)). See Render Target Blending.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

Blend factor is (1, 1, 1, 1).

Blend factor is (As, As, As, As).

Blend factor is (f, f, f, 1); f = min(As, 1 - Ad).

Blend factor is (Rs, Gs, Bs, As).

Blend factor is (PSOutColor[1]r, PSOutColor[1]g, PSOutColor[1]b, not used). See Render Target Blending.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

Blend factor is (0, 0, 0, 0).

?

bb172513 D3DPBLENDCAPS_BOTHSRCALPHA D3DPBLENDCAPS_BOTHSRCALPHA

Destination-blending capabilities. This member can be the same capabilities that are defined for the SrcBlendCaps member.

bb172513 D3DPBLENDCAPS_BOTHINVSRCALPHA D3DPBLENDCAPS_BOTHINVSRCALPHA

Alpha-test comparison capabilities. This member can include the same capability flags defined for the ZCmpCaps member. If this member contains only the capability or only the capability, the driver does not support alpha tests. Otherwise, the flags identify the individual comparisons that are supported for alpha testing.

bb172513 D3DPBLENDCAPS_BLENDFACTOR D3DPBLENDCAPS_BLENDFACTOR

Shading operations capabilities. It is assumed, in general, that if a device supports a given command at all, it supports the mode (as specified in the enumerated type). This flag specifies whether the driver can also support Gouraud shading and whether alpha color components are supported. When alpha components are not supported, the alpha value of colors generated is implicitly 255. This is the maximum possible alpha (that is, the alpha component is at full intensity).

The color, specular highlights, fog, and alpha interpolants of a triangle each have capability flags that an application can use to find out how they are implemented by the device driver.

This member can be one or more of the following flags.

ValueMeaning

Device can support an alpha component for Gouraud-blended transparency (the state for the enumerated type). In this mode, the alpha color component of a primitive is provided at vertices and interpolated across a face along with the other color components.

Device can support colored Gouraud shading. In this mode, the per-vertex color components (red, green, and blue) are interpolated across a triangle face.

Device can support fog in the Gouraud shading mode.

Device supports Gouraud shading of specular highlights.

?

bb172513 D3DPBLENDCAPS_SRCCOLOR2 D3DPBLENDCAPS_SRCCOLOR2

Miscellaneous texture-mapping capabilities. This member can be one or more of the following flags.

ValueMeaning

Alpha in texture pixels is supported.

Device can draw alpha from texture palettes.

Supports cube textures.

Device requires that cube texture maps have dimensions specified as powers of two.

Device supports mipmapped cube textures.

Device supports mipmapped textures.

Device supports mipmapped volume textures.

is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. A device that exposes this capability can use such a texture if all of the following requirements are met.

  • The texture addressing mode for the texture stage is set to .
  • Texture wrapping for the texture stage is disabled (D3DRS_WRAP n set to 0).
  • Mipmapping is not in use (use magnification filter only).
  • Texture formats must not be through .

If this flag is not set, and is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.

A texture that is not a power of two cannot be set at a stage that will be read based on a shader computation (such as the bem - ps and texm3x3 - ps instructions in pixel shaders versions 1_0 to 1_3). For example, these textures can be used to store bumps that will be fed into texture reads, but not the environment maps that are used in texbem - ps, texbeml - ps, and texm3x3spec - ps. This means that a texture with dimensions that are not powers of two cannot be addressed or sampled using texture coordinates computed within the shader. This type of operation is known as a dependent read and cannot be performed on these types of textures.

Device does not support a projected bump-environment loopkup operation in programmable and fixed function shaders.

Perspective correction texturing is supported.

If is not set, all textures must have widths and heights specified as powers of two. This requirement does not apply to either cube textures or volume textures.

If is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. See description.

If this flag is not set, and is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.

Supports the texture transformation flag. When applied, the device divides transformed texture coordinates by the last texture coordinate. If this capability is present, then the projective divide occurs per pixel. If this capability is not present, but the projective divide needs to occur anyway, then it is performed on a per-vertex basis by the Direct3D runtime.

All textures must be square.

Texture indices are not scaled by the texture size prior to interpolation.

Device supports volume textures.

Device requires that volume texture maps have dimensions specified as powers of two.

?

bb172513 D3DPBLENDCAPS_INVSRCCOLOR2 D3DPBLENDCAPS_INVSRCCOLOR2

Defines the supported blend operations. See Remarks for definitions of terms.

Source, Destination, and Result are defined as:

TermTypeDescription
SourceInputColor of the source pixel before the operation.
DestinationInputColor of the pixel in the destination buffer before the operation.
ResultOutputReturned value that is the blended color resulting from the operation.

?

This enumerated type defines values used by the following render states:

bb172509 D3DBLENDOP D3DBLENDOP

The result is the destination added to the source. Result = Source + Destination

bb172509 D3DBLENDOP_ADD D3DBLENDOP_ADD

The result is the destination subtracted from to the source. Result = Source - Destination

bb172509 D3DBLENDOP_SUBTRACT D3DBLENDOP_SUBTRACT

The result is the source subtracted from the destination. Result = Destination - Source

bb172509 D3DBLENDOP_REVSUBTRACT D3DBLENDOP_REVSUBTRACT

The result is the minimum of the source and destination. Result = MIN(Source, Destination)

bb172509 D3DBLENDOP_MIN D3DBLENDOP_MIN

The result is the maximum of the source and destination. Result = MAX(Source, Destination)

bb172509 D3DBLENDOP_MAX D3DBLENDOP_MAX

Flags used to obtain callback information.

bb172714 D3DXCALLBACK_SEARCH_FLAGS D3DXCALLBACK_SEARCH_FLAGS

Exclude callbacks located at the initial position from the search.

bb172714 D3DXCALLBACK_SEARCH_EXCLUDING_INITIAL_POSITION D3DXCALLBACK_SEARCH_EXCLUDING_INITIAL_POSITION

Reverse the callback search direction.

bb172714 D3DXCALLBACK_SEARCH_BEHIND_INITIAL_POSITION D3DXCALLBACK_SEARCH_BEHIND_INITIAL_POSITION

Obsolete in DirectX 8.0 and later versions; see Remarks.

The D3DLIGHTINGCAPS structure describes the lighting capabilities of a device.

This structure has been replaced by D3DCAPS8 (see the DirectX 8.0 SDK documentation) for DirectX 8.0 and later runtimes, but is required for DirectX 7.0 and earlier runtime compatibility. See Reporting DirectX 8.0 Style Direct3D Capabilities for details.

This structure is a member of the D3DDEVICEDESC_V1 structure.

ff548471 D3DCAPS D3DCAPS

Specifies the size, in bytes, of the D3DLIGHTINGCAPS structure.

ff548471 D3DCAPS_OVERLAY D3DCAPS_OVERLAY

Specifies flags describing the capabilities of the lighting module. The following flags are defined:

ValueMeaning
D3DLIGHTCAPS_DIRECTIONALDirectional lights are supported.
D3DLIGHTCAPS_GLSPOTOpenGL-style spotlights are supported.
D3DLIGHTCAPS_PARALLELPOINTParallel-point lights are supported.
D3DLIGHTCAPS_POINTPoint lights are supported.
D3DLIGHTCAPS_SPOTSpotlights are supported.

?

ff548471 D3DCAPS_READ_SCANLINE D3DCAPS_READ_SCANLINE
None. None None

Driver capability flags.

bb172511 D3DCAPS2 D3DCAPS2
No documentation. bb172511 D3DCAPS2_FULLSCREENGAMMA D3DCAPS2_FULLSCREENGAMMA No documentation. bb172511 D3DCAPS2_CANCALIBRATEGAMMA D3DCAPS2_CANCALIBRATEGAMMA No documentation. bb172511 D3DCAPS2_CANMANAGERESOURCE D3DCAPS2_CANMANAGERESOURCE No documentation. bb172511 D3DCAPS2_DYNAMICTEXTURES D3DCAPS2_DYNAMICTEXTURES No documentation. bb172511 D3DCAPS2_CANAUTOGENMIPMAP D3DCAPS2_CANAUTOGENMIPMAP No documentation. bb172511 D3DCAPS2_CANSHARERESOURCE D3DCAPS2_CANSHARERESOURCE None. None None

Driver capability flags.

bb172512 D3DCAPS3 D3DCAPS3
No documentation. bb172512 D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD D3DCAPS3_ALPHA_FULLSCREEN_FLIP_OR_DISCARD No documentation. bb172512 D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION D3DCAPS3_LINEAR_TO_SRGB_PRESENTATION No documentation. bb172512 D3DCAPS3_COPY_TO_VIDMEM D3DCAPS3_COPY_TO_VIDMEM No documentation. bb172512 D3DCAPS3_COPY_TO_SYSTEMMEM D3DCAPS3_COPY_TO_SYSTEMMEM No documentation. bb172512 D3DCAPS3_DXVAHD D3DCAPS3_DXVAHD None. None None

The following flags are used to specify which channels in a texture to operate on.

bb205563 D3DX_CHANNEL D3DX_CHANNEL
No documentation. bb205563 D3DX_CHANNEL_RED D3DX_CHANNEL_RED No documentation. bb205563 D3DX_CHANNEL_BLUE D3DX_CHANNEL_BLUE No documentation. bb205563 D3DX_CHANNEL_GREEN D3DX_CHANNEL_GREEN No documentation. bb205563 D3DX_CHANNEL_ALPHA D3DX_CHANNEL_ALPHA No documentation. bb205563 D3DX_CHANNEL_LUMINANCE D3DX_CHANNEL_LUMINANCE

Defines operations to perform on vertices in preparation for mesh cleaning.

bb172720 D3DXCLEANTYPE D3DXCLEANTYPE

Merge triangles that share the same vertex indices but have face normals pointing in opposite directions (back-facing triangles). Unless the triangles are not split by adding a replicated vertex, mesh adjacency data from the two triangles may conflict.

bb172720 D3DXCLEAN_BACKFACING D3DXCLEAN_BACKFACING

If a vertex is the apex of two triangle fans (a bowtie) and mesh operations will affect one of the fans, then split the shared vertex into two new vertices. Bowties can cause problems for operations such as mesh simplification that remove vertices, because removing one vertex affects two distinct sets of triangles.

bb172720 D3DXCLEAN_BOWTIES D3DXCLEAN_BOWTIES

Use this flag to prevent infinite loops during skinning setup mesh operations.

bb172720 D3DXCLEAN_SKINNING D3DXCLEAN_SKINNING

Use this flag to prevent infinite loops during mesh optimization operations.

bb172720 D3DXCLEAN_OPTIMIZATION D3DXCLEAN_OPTIMIZATION

Use this flag to prevent infinite loops during mesh simplification operations.

bb172720 D3DXCLEAN_SIMPLIFICATION D3DXCLEAN_SIMPLIFICATION

These flags identify a surface to reset when calling Clear.

bb172514 D3DCLEAR D3DCLEAR
No documentation. bb172514 D3DCLEAR_TARGET D3DCLEAR_TARGET No documentation. bb172514 D3DCLEAR_ZBUFFER D3DCLEAR_ZBUFFER No documentation. bb172514 D3DCLEAR_STENCIL D3DCLEAR_STENCIL No documentation. bb172514 D3DCLEAR_ALL D3DCLEAR_ALL None. None None

Describes the current clip status.

When clipping is enabled during vertex processing (by ProcessVertices, DrawPrimitive, or other drawing functions), Direct3D computes a clip code for every vertex. The clip code is a combination of D3DCS_* bits. When a vertex is outside a particular clipping plane, the corresponding bit is set in the clipping code. Direct3D maintains the clip status using , which has ClipUnion and ClipIntersection members. ClipUnion is a bitwise OR of all vertex clip codes and ClipIntersection is a bitwise AND of all vertex clip codes. Initial values are zero for ClipUnion and 0xFFFFFFFF for ClipIntersection. When is set to , ClipUnion and ClipIntersection are set to zero. Direct3D updates the clip status during drawing calls. To compute clip status for a particular object, set ClipUnion and ClipIntersection to their initial value and continue drawing.

Clip status is not updated by DrawRectPatch and DrawTriPatch because there is no software emulation for them.

bb172516 D3DCS D3DCS

Clip union flags that describe the current clip status. This member can be one or more of the following flags:

ValueMeaning

Combination of all clip flags.

All vertices are clipped by the left plane of the viewing frustum.

All vertices are clipped by the right plane of the viewing frustum.

All vertices are clipped by the top plane of the viewing frustum.

All vertices are clipped by the bottom plane of the viewing frustum.

All vertices are clipped by the front plane of the viewing frustum.

All vertices are clipped by the back plane of the viewing frustum.

Application-defined clipping planes.

Application-defined clipping planes.

Application-defined clipping planes.

Application-defined clipping planes.

Application-defined clipping planes.

Application-defined clipping planes.

?

bb172516 D3DCS_LEFT D3DCS_LEFT

Clip intersection flags that describe the current clip status. This member can take the same flags as ClipUnion.

bb172516 D3DCS_RIGHT D3DCS_RIGHT
No documentation. bb172516 D3DCS_TOP D3DCS_TOP No documentation. bb172516 D3DCS_BOTTOM D3DCS_BOTTOM No documentation. bb172516 D3DCS_FRONT D3DCS_FRONT No documentation. bb172516 D3DCS_BACK D3DCS_BACK No documentation. bb172516 D3DCS_PLANE0 D3DCS_PLANE0 No documentation. bb172516 D3DCS_PLANE1 D3DCS_PLANE1 No documentation. bb172516 D3DCS_PLANE2 D3DCS_PLANE2 No documentation. bb172516 D3DCS_PLANE3 D3DCS_PLANE3 No documentation. bb172516 D3DCS_PLANE4 D3DCS_PLANE4 No documentation. bb172516 D3DCS_PLANE5 D3DCS_PLANE5 No documentation. bb172516 D3DCS_ALL D3DCS_ALL No documentation. D3DMATERIALCOLORSOURCE D3DMATERIALCOLORSOURCE No documentation. D3DMCS_MATERIAL D3DMCS_MATERIAL No documentation. D3DMCS_COLOR1 D3DMCS_COLOR1 No documentation. D3DMCS_COLOR2 D3DMCS_COLOR2

Render states define set-up states for all kinds of vertex and pixel processing. Some render states set up vertex processing, and some set up pixel processing (see Render States (Direct3D 9)). Render states can be saved and restored using stateblocks (see State Blocks Save and Restore State (Direct3D 9)).

Render States
ps_1_1 to ps_1_34 texture samplers

?

Direct3D defines the D3DRENDERSTATE_WRAPBIAS constant as a convenience for applications to enable or disable texture wrapping, based on the zero-based integer of a texture coordinate set (rather than explicitly using one of the D3DRS_WRAP n state values). Add the D3DRENDERSTATE_WRAPBIAS value to the zero-based index of a texture coordinate set to calculate the D3DRS_WRAP n value that corresponds to that index, as shown in the following example.

 // Enable U/V wrapping for textures that use the texture 	
            // coordinate set at the index within the dwIndex variable  hr = pd3dDevice->SetRenderState(	
            dwIndex + D3DRENDERSTATE_WRAPBIAS,  	
             | ); // If dwIndex is 3, the value that results from 	
            // the addition equals  (131)	
            
bb172599 D3DCOLORWRITEENABLE D3DCOLORWRITEENABLE
No documentation. bb172599 D3DCOLORWRITEENABLE_RED D3DCOLORWRITEENABLE_RED No documentation. bb172599 D3DCOLORWRITEENABLE_GREEN D3DCOLORWRITEENABLE_GREEN No documentation. bb172599 D3DCOLORWRITEENABLE_BLUE D3DCOLORWRITEENABLE_BLUE No documentation. bb172599 D3DCOLORWRITEENABLE_ALPHA D3DCOLORWRITEENABLE_ALPHA

Defines the supported compare functions.

The values in this enumerated type define the supported compare functions for the , , and render states.

bb172517 D3DCMPFUNC D3DCMPFUNC

Always fail the test.

bb172517 D3DCMP_NEVER D3DCMP_NEVER

Accept the new pixel if its value is less than the value of the current pixel.

bb172517 D3DCMP_LESS D3DCMP_LESS

Accept the new pixel if its value equals the value of the current pixel.

bb172517 D3DCMP_EQUAL D3DCMP_EQUAL

Accept the new pixel if its value is less than or equal to the value of the current pixel.

bb172517 D3DCMP_LESSEQUAL D3DCMP_LESSEQUAL

Accept the new pixel if its value is greater than the value of the current pixel.

bb172517 D3DCMP_GREATER D3DCMP_GREATER

Accept the new pixel if its value does not equal the value of the current pixel.

bb172517 D3DCMP_NOTEQUAL D3DCMP_NOTEQUAL

Accept the new pixel if its value is greater than or equal to the value of the current pixel.

bb172517 D3DCMP_GREATEREQUAL D3DCMP_GREATEREQUAL

Always pass the test.

bb172517 D3DCMP_ALWAYS D3DCMP_ALWAYS

C++ applications can use alpha testing to control when pixels are written to the render-target surface. By using the render state, your application sets the current Direct3D device so that it tests each pixel according to an alpha test function. If the test succeeds, the pixel is written to the surface. If it does not, Direct3D ignores the pixel. Select the alpha test function with the render state. Your application can set a reference alpha value for all pixels to compare against by using the render state.

The most common use for alpha testing is to improve performance when rasterizing objects that are nearly transparent. If the color data being rasterized is more opaque than the color at a given pixel (), then the pixel is written. Otherwise, the rasterizer ignores the pixel altogether, saving the processing required to blend the two colors. The following code example checks if a given comparison function is supported and, if so, it sets the comparison function parameters required to improve performance during rendering.

 // This code example assumes that pCaps is a	
            //  structure that was filled with a 	
            // previous call to . if (pCaps.AlphaCmpCaps & )	
            { dev->SetRenderState(, (DWORD)0x00000001); dev->SetRenderState(, TRUE);  dev->SetRenderState(, );	
            } // If the comparison is not supported, render anyway. 	
            // The only drawback is no performance gain.	
            

Not all hardware supports all alpha-testing features. You can check the device capabilities by calling the method. After retrieving the device capabilities, check the associated structure's AlphaCmpCaps member for the desired comparison function. If the AlphaCmpCaps member contains only the capability or only the capability, the driver does not support alpha tests.

?

?

bb172254 D3DPCMPCAPS D3DPCMPCAPS
No documentation. bb172254 D3DPCMPCAPS_NEVER D3DPCMPCAPS_NEVER No documentation. bb172254 D3DPCMPCAPS_LESS D3DPCMPCAPS_LESS No documentation. bb172254 D3DPCMPCAPS_EQUAL D3DPCMPCAPS_EQUAL No documentation. bb172254 D3DPCMPCAPS_LESSEQUAL D3DPCMPCAPS_LESSEQUAL No documentation. bb172254 D3DPCMPCAPS_GREATER D3DPCMPCAPS_GREATER No documentation. bb172254 D3DPCMPCAPS_NOTEQUAL D3DPCMPCAPS_NOTEQUAL No documentation. bb172254 D3DPCMPCAPS_GREATEREQUAL D3DPCMPCAPS_GREATEREQUAL No documentation. bb172254 D3DPCMPCAPS_ALWAYS D3DPCMPCAPS_ALWAYS

Specifies how to combine the glyph data from the source and destination surfaces in a call to ComposeRects.

bb509546 D3DCOMPOSERECTSOP D3DCOMPOSERECTSOP
No documentation. bb509546 D3DCOMPOSERECTS_COPY D3DCOMPOSERECTS_COPY No documentation. bb509546 D3DCOMPOSERECTS_OR D3DCOMPOSERECTS_OR No documentation. bb509546 D3DCOMPOSERECTS_AND D3DCOMPOSERECTS_AND No documentation. bb509546 D3DCOMPOSERECTS_NEG D3DCOMPOSERECTS_NEG

Defines the compression mode used for storing compressed animation set data.

bb172734 D3DXCOMPRESSION_FLAGS D3DXCOMPRESSION_FLAGS

Implements fast compression.

bb172734 D3DXCOMPRESS_DEFAULT D3DXCOMPRESS_DEFAULT

A combination of one or more flags that control the device create behavior.

bb172527 D3DCREATE D3DCREATE
No documentation. bb172527 D3DCREATE_FPU_PRESERVE D3DCREATE_FPU_PRESERVE No documentation. bb172527 D3DCREATE_MULTITHREADED D3DCREATE_MULTITHREADED No documentation. bb172527 D3DCREATE_PUREDEVICE D3DCREATE_PUREDEVICE No documentation. bb172527 D3DCREATE_SOFTWARE_VERTEXPROCESSING D3DCREATE_SOFTWARE_VERTEXPROCESSING No documentation. bb172527 D3DCREATE_HARDWARE_VERTEXPROCESSING D3DCREATE_HARDWARE_VERTEXPROCESSING No documentation. bb172527 D3DCREATE_MIXED_VERTEXPROCESSING D3DCREATE_MIXED_VERTEXPROCESSING No documentation. bb172527 D3DCREATE_DISABLE_DRIVER_MANAGEMENT D3DCREATE_DISABLE_DRIVER_MANAGEMENT No documentation. bb172527 D3DCREATE_ADAPTERGROUP_DEVICE D3DCREATE_ADAPTERGROUP_DEVICE No documentation. bb172527 D3DCREATE_DISABLE_DRIVER_MANAGEMENT_EX D3DCREATE_DISABLE_DRIVER_MANAGEMENT_EX No documentation. bb172527 D3DCREATE_NOWINDOWCHANGES D3DCREATE_NOWINDOWCHANGES No documentation. bb172527 D3DCREATE_DISABLE_PSGP_THREADING D3DCREATE_DISABLE_PSGP_THREADING No documentation. bb172527 D3DCREATE_ENABLE_PRESENTSTATS D3DCREATE_ENABLE_PRESENTSTATS No documentation. bb172527 D3DCREATE_DISABLE_PRINTSCREEN D3DCREATE_DISABLE_PRINTSCREEN No documentation. bb172527 D3DCREATE_SCREENSAVER D3DCREATE_SCREENSAVER None. None None

Defines the faces of a cubemap.

bb172528 D3DCUBEMAP_FACES D3DCUBEMAP_FACES

Positive x-face of the cubemap.

bb172528 D3DCUBEMAP_FACE_POSITIVE_X D3DCUBEMAP_FACE_POSITIVE_X

Negative x-face of the cubemap.

bb172528 D3DCUBEMAP_FACE_NEGATIVE_X D3DCUBEMAP_FACE_NEGATIVE_X

Positive y-face of the cubemap.

bb172528 D3DCUBEMAP_FACE_POSITIVE_Y D3DCUBEMAP_FACE_POSITIVE_Y

Negative y-face of the cubemap.

bb172528 D3DCUBEMAP_FACE_NEGATIVE_Y D3DCUBEMAP_FACE_NEGATIVE_Y

Positive z-face of the cubemap.

bb172528 D3DCUBEMAP_FACE_POSITIVE_Z D3DCUBEMAP_FACE_POSITIVE_Z

Negative z-face of the cubemap.

bb172528 D3DCUBEMAP_FACE_NEGATIVE_Z D3DCUBEMAP_FACE_NEGATIVE_Z

Defines the supported culling modes.

The values in this enumerated type are used by the render state. The culling modes define how back faces are culled when rendering a geometry.

bb172529 D3DCULL D3DCULL

Do not cull back faces.

bb172529 D3DCULL_NONE D3DCULL_NONE

Cull back faces with clockwise vertices.

bb172529 D3DCULL_CW D3DCULL_CW

Cull back faces with counterclockwise vertices.

bb172529 D3DCULL_CCW D3DCULL_CCW

Driver cursor capability flags.

bb172530 D3DCURSORCAPS D3DCURSORCAPS
No documentation. bb172530 D3DCURSORCAPS_COLOR D3DCURSORCAPS_COLOR No documentation. bb172530 D3DCURSORCAPS_LOWRES D3DCURSORCAPS_LOWRES No documentation. D3DDEBUGMONITORTOKENS D3DDEBUGMONITORTOKENS No documentation. D3DDMT_ENABLE D3DDMT_ENABLE No documentation. D3DDMT_DISABLE D3DDMT_DISABLE

Defines the vertex declaration method which is a predefined operation performed by the tessellator (or any procedural geometry routine on the vertex data during tessellation).

The tessellator looks at the method to determine what data to calculate from the vertex data during tessellation. Mesh data should use the default value. Patches can use any of the other implemented types.

Vertex data is declared with an array of structures. Each element in the array contains a vertex declaration method.

In addition to using , a normal mesh can use and methods when N-patches are enabled.

bb172532 D3DDECLMETHOD D3DDECLMETHOD

Default value. The tessellator copies the vertex data (spline data for patches) as is, with no additional calculations. When the tessellator is used, this element is interpolated. Otherwise vertex data is copied into the input register. The input and output type can be any value, but are always the same type.

bb172532 D3DDECLMETHOD_DEFAULT D3DDECLMETHOD_DEFAULT

Computes the tangent at a point on the rectangle or triangle patch in the U direction. The input type can be one of the following:

The output type is always .

bb172532 D3DDECLMETHOD_PARTIALU D3DDECLMETHOD_PARTIALU

Computes the tangent at a point on the rectangle or triangle patch in the V direction. The input type can be one of the following:

The output type is always .

bb172532 D3DDECLMETHOD_PARTIALV D3DDECLMETHOD_PARTIALV

Computes the normal at a point on the rectangle or triangle patch by taking the cross product of two tangents. The input type can be one of the following:

The output type is always .

bb172532 D3DDECLMETHOD_CROSSUV D3DDECLMETHOD_CROSSUV

Copy out the U, V values at a point on the rectangle or triangle patch. This results in a 2D float. The input type must be set to . The output data type is always . The input stream and offset are also unused (but must be set to 0).

bb172532 D3DDECLMETHOD_UV D3DDECLMETHOD_UV

Look up a displacement map. The input type can be one of the following:

Only the .x and .y components are used for the texture map lookup. The output type is always . The device must support displacement mapping. For more information about displacement mapping, see Displacement Mapping (Direct3D 9). This constant is supported only by the programmable pipeline on N-patch data, if N-patches are enabled.

bb172532 D3DDECLMETHOD_LOOKUP D3DDECLMETHOD_LOOKUP

Look up a presampled displacement map. The input type must be set to ; the stream index and the stream offset must be set to 0. The output type for this operation is always . The device must support displacement mapping. For more information about displacement mapping, see Displacement Mapping (Direct3D 9). This constant is supported only by the programmable pipeline on N-patch data, if N-patches are enabled. This method can be used only with .

bb172532 D3DDECLMETHOD_LOOKUPPRESAMPLED D3DDECLMETHOD_LOOKUPPRESAMPLED

Defines a vertex declaration data type.

Vertex data is declared with an array of structures. Each element in the array contains a vertex declaration data type.

Use the DirectX Caps Viewer Tool tool to see which types are supported on your device.

bb172533 D3DDECLTYPE D3DDECLTYPE

One-component float expanded to (float, 0, 0, 1).

bb172533 D3DDECLTYPE_FLOAT1 D3DDECLTYPE_FLOAT1

Two-component float expanded to (float, float, 0, 1).

bb172533 D3DDECLTYPE_FLOAT2 D3DDECLTYPE_FLOAT2

Three-component float expanded to (float, float, float, 1).

bb172533 D3DDECLTYPE_FLOAT3 D3DDECLTYPE_FLOAT3

Four-component float expanded to (float, float, float, float).

bb172533 D3DDECLTYPE_FLOAT4 D3DDECLTYPE_FLOAT4

Four-component, packed, unsigned bytes mapped to 0 to 1 range. Input is a and is expanded to RGBA order.

bb172533 D3DDECLTYPE_D3DCOLOR D3DDECLTYPE_D3DCOLOR

Four-component, unsigned byte.

bb172533 D3DDECLTYPE_UBYTE4 D3DDECLTYPE_UBYTE4

Two-component, signed short expanded to (value, value, 0, 1).

bb172533 D3DDECLTYPE_SHORT2 D3DDECLTYPE_SHORT2

Four-component, signed short expanded to (value, value, value, value).

bb172533 D3DDECLTYPE_SHORT4 D3DDECLTYPE_SHORT4

Four-component byte with each byte normalized by dividing with 255.0f.

bb172533 D3DDECLTYPE_UBYTE4N D3DDECLTYPE_UBYTE4N

Normalized, two-component, signed short, expanded to (first short/32767.0, second short/32767.0, 0, 1).

bb172533 D3DDECLTYPE_SHORT2N D3DDECLTYPE_SHORT2N

Normalized, four-component, signed short, expanded to (first short/32767.0, second short/32767.0, third short/32767.0, fourth short/32767.0).

bb172533 D3DDECLTYPE_SHORT4N D3DDECLTYPE_SHORT4N

Normalized, two-component, unsigned short, expanded to (first short/65535.0, short short/65535.0, 0, 1).

bb172533 D3DDECLTYPE_USHORT2N D3DDECLTYPE_USHORT2N

Normalized, four-component, unsigned short, expanded to (first short/65535.0, second short/65535.0, third short/65535.0, fourth short/65535.0).

bb172533 D3DDECLTYPE_USHORT4N D3DDECLTYPE_USHORT4N

Three-component, unsigned, 10 10 10 format expanded to (value, value, value, 1).

bb172533 D3DDECLTYPE_UDEC3 D3DDECLTYPE_UDEC3

Three-component, signed, 10 10 10 format normalized and expanded to (v[0]/511.0, v[1]/511.0, v[2]/511.0, 1).

bb172533 D3DDECLTYPE_DEC3N D3DDECLTYPE_DEC3N

Two-component, 16-bit, floating point expanded to (value, value, 0, 1).

bb172533 D3DDECLTYPE_FLOAT16_2 D3DDECLTYPE_FLOAT16_2

Four-component, 16-bit, floating point expanded to (value, value, value, value).

bb172533 D3DDECLTYPE_FLOAT16_4 D3DDECLTYPE_FLOAT16_4

Type field in the declaration is unused. This is designed for use with and .

bb172533 D3DDECLTYPE_UNUSED D3DDECLTYPE_UNUSED

Constants describing the vertex data types supported by a device.

bb172552 D3DDTCAPS D3DDTCAPS
No documentation. bb172552 D3DDTCAPS_UBYTE4 D3DDTCAPS_UBYTE4 No documentation. bb172552 D3DDTCAPS_UBYTE4N D3DDTCAPS_UBYTE4N No documentation. bb172552 D3DDTCAPS_SHORT2N D3DDTCAPS_SHORT2N No documentation. bb172552 D3DDTCAPS_SHORT4N D3DDTCAPS_SHORT4N No documentation. bb172552 D3DDTCAPS_USHORT2N D3DDTCAPS_USHORT2N No documentation. bb172552 D3DDTCAPS_USHORT4N D3DDTCAPS_USHORT4N No documentation. bb172552 D3DDTCAPS_UDEC3 D3DDTCAPS_UDEC3 No documentation. bb172552 D3DDTCAPS_DEC3N D3DDTCAPS_DEC3N No documentation. bb172552 D3DDTCAPS_FLOAT16_2 D3DDTCAPS_FLOAT16_2 No documentation. bb172552 D3DDTCAPS_FLOAT16_4 D3DDTCAPS_FLOAT16_4

Identifies the intended use of vertex data.

Vertex data is declared with an array of structures. Each element in the array contains a usage type.

For more information about vertex declarations, see Vertex Declaration (Direct3D 9).

bb172534 D3DDECLUSAGE D3DDECLUSAGE

Position data ranging from (-1,-1) to (1,1). Use with a usage index of 0 to specify untransformed position for fixed function vertex processing and the n-patch tessellator. Use with a usage index of 1 to specify untransformed position in the fixed function vertex shader for vertex tweening.

bb172534 D3DDECLUSAGE_POSITION D3DDECLUSAGE_POSITION

Blending weight data. Use with a usage index of 0 to specify the blend weights used in indexed and nonindexed vertex blending.

bb172534 D3DDECLUSAGE_BLENDWEIGHT D3DDECLUSAGE_BLENDWEIGHT

Blending indices data. Use with a usage index of 0 to specify matrix indices for indexed paletted skinning.

bb172534 D3DDECLUSAGE_BLENDINDICES D3DDECLUSAGE_BLENDINDICES

Vertex normal data. Use with a usage index of 0 to specify vertex normals for fixed function vertex processing and the n-patch tessellator. Use with a usage index of 1 to specify vertex normals for fixed function vertex processing for vertex tweening.

bb172534 D3DDECLUSAGE_NORMAL D3DDECLUSAGE_NORMAL

Point size data. Use with a usage index of 0 to specify the point-size attribute used by the setup engine of the rasterizer to expand a point into a quad for the point-sprite functionality.

bb172534 D3DDECLUSAGE_PSIZE D3DDECLUSAGE_PSIZE

Texture coordinate data. Use , n to specify texture coordinates in fixed function vertex processing and in pixel shaders prior to ps_3_0. These can be used to pass user defined data.

bb172534 D3DDECLUSAGE_TEXCOORD D3DDECLUSAGE_TEXCOORD

Vertex tangent data.

bb172534 D3DDECLUSAGE_TANGENT D3DDECLUSAGE_TANGENT

Vertex binormal data.

bb172534 D3DDECLUSAGE_BINORMAL D3DDECLUSAGE_BINORMAL

Single positive floating point value. Use with a usage index of 0 to specify a tessellation factor used in the tessellation unit to control the rate of tessellation. For more information about the data type, see .

bb172534 D3DDECLUSAGE_TESSFACTOR D3DDECLUSAGE_TESSFACTOR

Vertex data contains transformed position data ranging from (0,0) to (viewport width, viewport height). Use with a usage index of 0 to specify transformed position. When a declaration containing this is set, the pipeline does not perform vertex processing.

bb172534 D3DDECLUSAGE_POSITIONT D3DDECLUSAGE_POSITIONT

Vertex data contains diffuse or specular color. Use with a usage index of 0 to specify the diffuse color in the fixed function vertex shader and pixel shaders prior to ps_3_0. Use with a usage index of 1 to specify the specular color in the fixed function vertex shader and pixel shaders prior to ps_3_0.

bb172534 D3DDECLUSAGE_COLOR D3DDECLUSAGE_COLOR

Vertex data contains fog data. Use with a usage index of 0 to specify a fog blend value used after pixel shading finishes. This applies to pixel shaders prior to version ps_3_0.

bb172534 D3DDECLUSAGE_FOG D3DDECLUSAGE_FOG

Vertex data contains depth data.

bb172534 D3DDECLUSAGE_DEPTH D3DDECLUSAGE_DEPTH

Vertex data contains sampler data. Use with a usage index of 0 to specify the displacement value to look up. It can be used only with D3DDECLUSAGE_LOOKUPPRESAMPLED or D3DDECLUSAGE_LOOKUP.

bb172534 D3DDECLUSAGE_SAMPLE D3DDECLUSAGE_SAMPLE

Defines the degree of the variables in the equation that describes a curve.

The values in this enumeration are used to describe the curves used by rectangle and triangle patches. For more information, see .

bb172536 D3DDEGREETYPE D3DDEGREETYPE

Curve is described by variables of first order.

bb172536 D3DDEGREE_LINEAR D3DDEGREE_LINEAR

Curve is described by variables of second order.

bb172536 D3DDEGREE_QUADRATIC D3DDEGREE_QUADRATIC

Curve is described by variables of third order.

bb172536 D3DDEGREE_CUBIC D3DDEGREE_CUBIC

Curve is described by variables of fourth order.

bb172536 D3DDEGREE_QUINTIC D3DDEGREE_QUINTIC

Represents the capabilities of the hardware exposed through the Direct3D object.

The MaxTextureBlendStages and MaxSimultaneousTextures members might seem similar, but they contain different information. The MaxTextureBlendStages member contains the total number of texture-blending stages supported by the current device, and the MaxSimultaneousTextures member describes how many of those stages can have textures bound to them by using the SetTexture method.

When the driver fills this structure, it can set values for execute-buffer capabilities, even when the interface being used to retrieve the capabilities (such as ) does not support execute buffers.

In general, performance problems may occur if you use a texture and then modify it during a scene. Ensure that no texture used in the current BeginScene and EndScene block is evicted unless absolutely necessary. In the case of extremely high texture usage within a scene, the results are undefined. This occurs when you modify a texture that you have used in the scene and there is no spare texture memory available. For such systems, the contents of the z-buffer become invalid at EndScene. Applications should not call UpdateSurface to or from the back buffer on this type of hardware inside a BeginScene/EndScene pair. In addition, applications should not try to access the z-buffer if the capability flag is set. Finally, applications should not lock the back buffer or the z-buffer inside a BeginScene/EndScene pair.

The following flags concerning mipmapped textures are not supported in Direct3D 9.

  • D3DPTFILTERCAPS_LINEAR
  • D3DPTFILTERCAPS_LINEARMIPLINEAR
  • D3DPTFILTERCAPS_LINEARMIPNEAREST
  • D3DPTFILTERCAPS_MIPNEAREST
  • D3DPTFILTERCAPS_NEAREST
bb172513 D3DDEVCAPS D3DDEVCAPS

Member of the enumerated type, which identifies what type of resources are used for processing vertices.

bb172513 D3DDEVCAPS_EXECUTESYSTEMMEMORY D3DDEVCAPS_EXECUTESYSTEMMEMORY

Adapter on which this Direct3D device was created. This ordinal is valid only to pass to methods of the interface that created this Direct3D device. The interface can always be retrieved by calling GetDirect3D.

bb172513 D3DDEVCAPS_EXECUTEVIDEOMEMORY D3DDEVCAPS_EXECUTEVIDEOMEMORY

The following driver-specific capability.

ValueMeaning

Display hardware is capable of returning the current scan line.

The display driver supports an overlay DDI that allows for verification of overlay capabilities. For more information about the overlay DDI, see Overlay DDI.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

?

bb172513 D3DDEVCAPS_TLVERTEXSYSTEMMEMORY D3DDEVCAPS_TLVERTEXSYSTEMMEMORY

Driver-specific capabilities identified in .

bb172513 D3DDEVCAPS_TLVERTEXVIDEOMEMORY D3DDEVCAPS_TLVERTEXVIDEOMEMORY

Driver-specific capabilities identified in .

bb172513 D3DDEVCAPS_TEXTURESYSTEMMEMORY D3DDEVCAPS_TEXTURESYSTEMMEMORY

Bit mask of values representing what presentation swap intervals are available.

ValueMeaning

The driver supports an immediate presentation swap interval.

The driver supports a presentation swap interval of every screen refresh.

The driver supports a presentation swap interval of every second screen refresh.

The driver supports a presentation swap interval of every third screen refresh.

The driver supports a presentation swap interval of every fourth screen refresh.

?

bb172513 D3DDEVCAPS_TEXTUREVIDEOMEMORY D3DDEVCAPS_TEXTUREVIDEOMEMORY

Bit mask indicating what hardware support is available for cursors. Direct3D 9 does not define alpha-blending cursor capabilities.

ValueMeaning

A full-color cursor is supported in hardware. Specifically, this flag indicates that the driver supports at least a hardware color cursor in high-resolution modes (with scan lines greater than or equal to 400).

A full-color cursor is supported in hardware. Specifically, this flag indicates that the driver supports a hardware color cursor in both high-resolution and low-resolution modes (with scan lines less than 400).

?

bb172513 D3DDEVCAPS_DRAWPRIMTLVERTEX D3DDEVCAPS_DRAWPRIMTLVERTEX

Flags identifying the capabilities of the device.

ValueMeaning

Device supports blits from system-memory textures to nonlocal video-memory textures.

Device can queue rendering commands after a page flip. Applications do not change their behavior if this flag is set; this capability means that the device is relatively fast.

Device can support at least a DirectX 5-compliant driver.

Device can support at least a DirectX 7-compliant driver.

Device exports an -aware hal.

Device can use execute buffers from system memory.

Device can use execute buffers from video memory.

Device has hardware acceleration for scene rasterization.

Device can support transformation and lighting in hardware.

Device supports N patches.

Device can support rasterization, transform, lighting, and shading in hardware.

Device supports quintic B?zier curves and B-splines.

Device supports rectangular and triangular patches.

When this device capability is set, the hardware architecture does not require caching of any information, and uncached patches (handle zero) will be drawn as efficiently as cached ones. Note that setting does not mean that a patch with handle zero can be drawn. A handle-zero patch can always be drawn whether this cap is set or not.

Device is texturing from separate memory pools.

Device can retrieve textures from non-local video memory.

Device can retrieve textures from system memory.

Device can retrieve textures from device memory.

Device can use buffers from system memory for transformed and lit vertices.

Device can use buffers from video memory for transformed and lit vertices.

?

bb172513 D3DDEVCAPS_CANRENDERAFTERFLIP D3DDEVCAPS_CANRENDERAFTERFLIP

Miscellaneous driver primitive capabilities. See .

bb172513 D3DDEVCAPS_TEXTURENONLOCALVIDMEM D3DDEVCAPS_TEXTURENONLOCALVIDMEM

Information on raster-drawing capabilities. This member can be one or more of the following flags.

ValueMeaning

Device supports anisotropic filtering.

Device iterates colors perspective correctly.

Device can dither to improve color resolution.

Device supports legacy depth bias. For true depth bias, see .

Device supports range-based fog. In range-based fog, the distance of an object from the viewer is used to compute fog effects, not the depth of the object (that is, the z-coordinate) in the scene.

Device calculates the fog value by referring to a lookup table containing fog values that are indexed to the depth of a given pixel.

Device calculates the fog value during the lighting operation and interpolates the fog value during rasterization.

Device supports level-of-detail bias adjustments. These bias adjustments enable an application to make a mipmap appear crisper or less sharp than it normally would. For more information about level-of-detail bias in mipmaps, see .

Device supports toggling multisampling on and off between and (using ).

Device supports scissor test. See Scissor Test (Direct3D 9).

Device performs true slope-scale based depth bias. This is in contrast to the legacy style depth bias.

Device supports depth buffering using w.

Device supports w-based fog. W-based fog is used when a perspective projection matrix is specified, but affine projections still use z-based fog. The system considers a projection matrix that contains a nonzero value in the [3][4] element to be a perspective projection matrix.

Device can perform hidden-surface removal (HSR) without requiring the application to sort polygons and without requiring the allocation of a depth-buffer. This leaves more video memory for textures. The method used to perform HSR is hardware-dependent and is transparent to the application.

Z-bufferless HSR is performed if no depth-buffer surface is associated with the rendering-target surface and the depth-buffer comparison test is enabled (that is, when the state value associated with the enumeration constant is set to TRUE).

Device supports z-based fog.

Device can perform z-test operations. This effectively renders a primitive and indicates whether any z pixels have been rendered.

?

bb172513 D3DDEVCAPS_DRAWPRIMITIVES2 D3DDEVCAPS_DRAWPRIMITIVES2

Z-buffer comparison capabilities. This member can be one or more of the following flags.

ValueMeaning

Always pass the z-test.

Pass the z-test if the new z equals the current z.

Pass the z-test if the new z is greater than the current z.

Pass the z-test if the new z is greater than or equal to the current z.

Pass the z-test if the new z is less than the current z.

Pass the z-test if the new z is less than or equal to the current z.

Always fail the z-test.

Pass the z-test if the new z does not equal the current z.

?

bb172513 D3DDEVCAPS_SEPARATETEXTUREMEMORIES D3DDEVCAPS_SEPARATETEXTUREMEMORIES

Source-blending capabilities. This member can be one or more of the following flags. (The RGBA values of the source and destination are indicated by the subscripts s and d.)

ValueMeaning

The driver supports both and . See .

Source blend factor is (1 - As, 1 - As, 1 - As, 1 - As) and destination blend factor is (As, As, As, As); the destination blend selection is overridden.

The driver supports the blend mode. (This blend mode is obsolete. For more information, see .)

Blend factor is (Ad, Ad, Ad, Ad).

Blend factor is (Rd, Gd, Bd, Ad).

Blend factor is (1 - Ad, 1 - Ad, 1 - Ad, 1 - Ad).

Blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad).

Blend factor is (1 - As, 1 - As, 1 - As, 1 - As).

Blend factor is (1 - Rs, 1 - Gs, 1 - Bs, 1 - As).

Blend factor is (1 - PSOutColor[1]r, 1 - PSOutColor[1]g, 1 - PSOutColor[1]b, not used)). See Render Target Blending.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

Blend factor is (1, 1, 1, 1).

Blend factor is (As, As, As, As).

Blend factor is (f, f, f, 1); f = min(As, 1 - Ad).

Blend factor is (Rs, Gs, Bs, As).

Blend factor is (PSOutColor[1]r, PSOutColor[1]g, PSOutColor[1]b, not used). See Render Target Blending.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

Blend factor is (0, 0, 0, 0).

?

bb172513 D3DDEVCAPS_DRAWPRIMITIVES2EX D3DDEVCAPS_DRAWPRIMITIVES2EX

Destination-blending capabilities. This member can be the same capabilities that are defined for the SrcBlendCaps member.

bb172513 D3DDEVCAPS_HWTRANSFORMANDLIGHT D3DDEVCAPS_HWTRANSFORMANDLIGHT

Alpha-test comparison capabilities. This member can include the same capability flags defined for the ZCmpCaps member. If this member contains only the capability or only the capability, the driver does not support alpha tests. Otherwise, the flags identify the individual comparisons that are supported for alpha testing.

bb172513 D3DDEVCAPS_CANBLTSYSTONONLOCAL D3DDEVCAPS_CANBLTSYSTONONLOCAL

Shading operations capabilities. It is assumed, in general, that if a device supports a given command at all, it supports the mode (as specified in the enumerated type). This flag specifies whether the driver can also support Gouraud shading and whether alpha color components are supported. When alpha components are not supported, the alpha value of colors generated is implicitly 255. This is the maximum possible alpha (that is, the alpha component is at full intensity).

The color, specular highlights, fog, and alpha interpolants of a triangle each have capability flags that an application can use to find out how they are implemented by the device driver.

This member can be one or more of the following flags.

ValueMeaning

Device can support an alpha component for Gouraud-blended transparency (the state for the enumerated type). In this mode, the alpha color component of a primitive is provided at vertices and interpolated across a face along with the other color components.

Device can support colored Gouraud shading. In this mode, the per-vertex color components (red, green, and blue) are interpolated across a triangle face.

Device can support fog in the Gouraud shading mode.

Device supports Gouraud shading of specular highlights.

?

bb172513 D3DDEVCAPS_HWRASTERIZATION D3DDEVCAPS_HWRASTERIZATION

Miscellaneous texture-mapping capabilities. This member can be one or more of the following flags.

ValueMeaning

Alpha in texture pixels is supported.

Device can draw alpha from texture palettes.

Supports cube textures.

Device requires that cube texture maps have dimensions specified as powers of two.

Device supports mipmapped cube textures.

Device supports mipmapped textures.

Device supports mipmapped volume textures.

is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. A device that exposes this capability can use such a texture if all of the following requirements are met.

  • The texture addressing mode for the texture stage is set to .
  • Texture wrapping for the texture stage is disabled (D3DRS_WRAP n set to 0).
  • Mipmapping is not in use (use magnification filter only).
  • Texture formats must not be through .

If this flag is not set, and is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.

A texture that is not a power of two cannot be set at a stage that will be read based on a shader computation (such as the bem - ps and texm3x3 - ps instructions in pixel shaders versions 1_0 to 1_3). For example, these textures can be used to store bumps that will be fed into texture reads, but not the environment maps that are used in texbem - ps, texbeml - ps, and texm3x3spec - ps. This means that a texture with dimensions that are not powers of two cannot be addressed or sampled using texture coordinates computed within the shader. This type of operation is known as a dependent read and cannot be performed on these types of textures.

Device does not support a projected bump-environment loopkup operation in programmable and fixed function shaders.

Perspective correction texturing is supported.

If is not set, all textures must have widths and heights specified as powers of two. This requirement does not apply to either cube textures or volume textures.

If is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. See description.

If this flag is not set, and is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.

Supports the texture transformation flag. When applied, the device divides transformed texture coordinates by the last texture coordinate. If this capability is present, then the projective divide occurs per pixel. If this capability is not present, but the projective divide needs to occur anyway, then it is performed on a per-vertex basis by the Direct3D runtime.

All textures must be square.

Texture indices are not scaled by the texture size prior to interpolation.

Device supports volume textures.

Device requires that volume texture maps have dimensions specified as powers of two.

?

bb172513 D3DDEVCAPS_PUREDEVICE D3DDEVCAPS_PUREDEVICE

Texture-filtering capabilities for a texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

bb172513 D3DDEVCAPS_QUINTICRTPATCHES D3DDEVCAPS_QUINTICRTPATCHES

Texture-filtering capabilities for a cube texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

bb172513 D3DDEVCAPS_RTPATCHES D3DDEVCAPS_RTPATCHES

Texture-filtering capabilities for a volume texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

bb172513 D3DDEVCAPS_RTPATCHHANDLEZERO D3DDEVCAPS_RTPATCHHANDLEZERO

Texture-addressing capabilities for texture objects. This member can be one or more of the following flags.

ValueMeaning

Device supports setting coordinates outside the range [0.0, 1.0] to the border color, as specified by the texture-stage state.

Device can clamp textures to addresses.

Device can separate the texture-addressing modes of the u and v coordinates of the texture. This ability corresponds to the and render-state values.

Device can mirror textures to addresses.

Device can take the absolute value of the texture coordinate (thus, mirroring around 0) and then clamp to the maximum value.

Device can wrap textures to addresses.

?

bb172513 D3DDEVCAPS_NPATCHES D3DDEVCAPS_NPATCHES

driver capability flags.

bb172537 D3DDEVCAPS2 D3DDEVCAPS2
No documentation. bb172537 D3DDEVCAPS2_STREAMOFFSET D3DDEVCAPS2_STREAMOFFSET No documentation. bb172537 D3DDEVCAPS2_DMAPNPATCH D3DDEVCAPS2_DMAPNPATCH No documentation. bb172537 D3DDEVCAPS2_ADAPTIVETESSRTPATCH D3DDEVCAPS2_ADAPTIVETESSRTPATCH No documentation. bb172537 D3DDEVCAPS2_ADAPTIVETESSNPATCH D3DDEVCAPS2_ADAPTIVETESSNPATCH No documentation. bb172537 D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES D3DDEVCAPS2_CAN_STRETCHRECT_FROM_TEXTURES No documentation. bb172537 D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH D3DDEVCAPS2_PRESAMPLEDDMAPNPATCH No documentation. bb172537 D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET D3DDEVCAPS2_VERTEXELEMENTSCANSHARESTREAMOFFSET

Defines device types.

All methods of the interface that take a device type will fail if is specified. To use these methods, substitute in the method call.

A device should be created in memory, unless vertex and index buffers are required. To support vertex and index buffers, create the device in memory.

If D3dref9.dll is installed, Direct3D will use the reference rasterizer to create a device type, even if is specified. If D3dref9.dll is not available and is specified, Direct3D will neither render nor present the scene.

bb172547 D3DDEVTYPE D3DDEVTYPE

Hardware rasterization. Shading is done with software, hardware, or mixed transform and lighting.

bb172547 D3DDEVTYPE_HAL D3DDEVTYPE_HAL

Direct3D features are implemented in software; however, the reference rasterizer does make use of special CPU instructions whenever it can.

The reference device is installed by the Windows SDK 8.0 or later and is intended as an aid in debugging for development only.

bb172547 D3DDEVTYPE_REF D3DDEVTYPE_REF

A pluggable software device that has been registered with .

bb172547 D3DDEVTYPE_SW D3DDEVTYPE_SW

Initialize Direct3D on a computer that has neither hardware nor reference rasterization available, and enable resources for 3D content creation. See Remarks.

bb172547 D3DDEVTYPE_NULLREF D3DDEVTYPE_NULLREF

Specifies how the monitor being used to display a full-screen application is rotated.

This enumeration is used in , , and .

Applications may choose to handle monitor rotation themselves by using the , in which case, the application will need to know how the monitor is rotated so that it may adjust its rendering accordingly.

bb172551 D3DDISPLAYROTATION D3DDISPLAYROTATION

Display is not rotated.

bb172551 D3DDISPLAYROTATION_IDENTITY D3DDISPLAYROTATION_IDENTITY

Display is rotated 90 degrees.

bb172551 D3DDISPLAYROTATION_90 D3DDISPLAYROTATION_90

Display is rotated 180 degrees.

bb172551 D3DDISPLAYROTATION_180 D3DDISPLAYROTATION_180

Display is rotated 270 degrees.

bb172551 D3DDISPLAYROTATION_270 D3DDISPLAYROTATION_270

Effect data types. The data is contained in the pValue member of .

bb172822 D3DXEFFECTDEFAULTTYPE D3DXEFFECTDEFAULTTYPE
No documentation. bb172822 D3DXEDT_STRING D3DXEDT_STRING No documentation. bb172822 D3DXEDT_FLOATS D3DXEDT_FLOATS No documentation. bb172822 D3DXEDT_DWORD D3DXEDT_DWORD No documentation. bb172822 D3DXEDT_FORCEDWORD D3DXEDT_FORCEDWORD

Describes the type of events that can be keyed by the animation controller.

bb172827 D3DXEVENT_TYPE D3DXEVENT_TYPE

Track speed.

bb172827 D3DXEVENT_TRACKSPEED D3DXEVENT_TRACKSPEED

Track weight.

bb172827 D3DXEVENT_TRACKWEIGHT D3DXEVENT_TRACKWEIGHT

Track position.

bb172827 D3DXEVENT_TRACKPOSITION D3DXEVENT_TRACKPOSITION

Enable flag.

bb172827 D3DXEVENT_TRACKENABLE D3DXEVENT_TRACKENABLE

Priority blend value.

bb172827 D3DXEVENT_PRIORITYBLEND D3DXEVENT_PRIORITYBLEND

Defines constants describing the fill mode.

The values in this enumerated type are used by the render state.

bb172556 D3DFILLMODE D3DFILLMODE

Fill points.

bb172556 D3DFILL_POINT D3DFILL_POINT

Fill wireframes.

bb172556 D3DFILL_WIREFRAME D3DFILL_WIREFRAME

Fill solids.

bb172556 D3DFILL_SOLID D3DFILL_SOLID

The following flags are used to specify which channels in a texture to operate on.

bb205565 D3DX_FILTER D3DX_FILTER
No documentation. bb205565 D3DX_FILTER_NONE D3DX_FILTER_NONE No documentation. bb205565 D3DX_FILTER_POINT D3DX_FILTER_POINT No documentation. bb205565 D3DX_FILTER_LINEAR D3DX_FILTER_LINEAR No documentation. bb205565 D3DX_FILTER_TRIANGLE D3DX_FILTER_TRIANGLE No documentation. bb205565 D3DX_FILTER_BOX D3DX_FILTER_BOX No documentation. bb205565 D3DX_FILTER_MIRROR_U D3DX_FILTER_MIRROR_U No documentation. bb205565 D3DX_FILTER_MIRROR_V D3DX_FILTER_MIRROR_V No documentation. bb205565 D3DX_FILTER_MIRROR_W D3DX_FILTER_MIRROR_W No documentation. bb205565 D3DX_FILTER_MIRROR D3DX_FILTER_MIRROR No documentation. bb205565 D3DX_FILTER_DITHER D3DX_FILTER_DITHER No documentation. bb205565 D3DX_FILTER_DITHER_DIFFUSION D3DX_FILTER_DITHER_DIFFUSION No documentation. bb205565 D3DX_FILTER_SRGB_IN D3DX_FILTER_SRGB_IN No documentation. bb205565 D3DX_FILTER_SRGB_OUT D3DX_FILTER_SRGB_OUT No documentation. bb205565 D3DX_FILTER_SRGB D3DX_FILTER_SRGB No documentation. bb205565 D3DX_FILTER_DEFAULT D3DX_FILTER_DEFAULT

Texture filtering constants.

bb172593 D3DPTFILTERCAPS D3DPTFILTERCAPS
No documentation. bb172593 D3DPTFILTERCAPS_MINFPOINT D3DPTFILTERCAPS_MINFPOINT No documentation. bb172593 D3DPTFILTERCAPS_MINFLINEAR D3DPTFILTERCAPS_MINFLINEAR No documentation. bb172593 D3DPTFILTERCAPS_MINFANISOTROPIC D3DPTFILTERCAPS_MINFANISOTROPIC No documentation. bb172593 D3DPTFILTERCAPS_MINFPYRAMIDALQUAD D3DPTFILTERCAPS_MINFPYRAMIDALQUAD No documentation. bb172593 D3DPTFILTERCAPS_MINFGAUSSIANQUAD D3DPTFILTERCAPS_MINFGAUSSIANQUAD No documentation. bb172593 D3DPTFILTERCAPS_MIPFPOINT D3DPTFILTERCAPS_MIPFPOINT No documentation. bb172593 D3DPTFILTERCAPS_MIPFLINEAR D3DPTFILTERCAPS_MIPFLINEAR No documentation. bb172593 D3DPTFILTERCAPS_CONVOLUTIONMONO D3DPTFILTERCAPS_CONVOLUTIONMONO No documentation. bb172593 D3DPTFILTERCAPS_MAGFPOINT D3DPTFILTERCAPS_MAGFPOINT No documentation. bb172593 D3DPTFILTERCAPS_MAGFLINEAR D3DPTFILTERCAPS_MAGFLINEAR No documentation. bb172593 D3DPTFILTERCAPS_MAGFANISOTROPIC D3DPTFILTERCAPS_MAGFANISOTROPIC No documentation. bb172593 D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD D3DPTFILTERCAPS_MAGFPYRAMIDALQUAD No documentation. bb172593 D3DPTFILTERCAPS_MAGFGAUSSIANQUAD D3DPTFILTERCAPS_MAGFGAUSSIANQUAD

Defines constants that describe the fog mode.

The values in this enumerated type are used by the and render states.

Fog can be considered a measure of visibility: the lower the fog value produced by a fog equation, the less visible an object is.

bb172557 D3DFOGMODE D3DFOGMODE

No fog effect.

bb172557 D3DFOG_NONE D3DFOG_NONE

Fog effect intensifies exponentially, according to the following formula.

bb172557 D3DFOG_EXP D3DFOG_EXP

Fog effect intensifies exponentially with the square of the distance, according to the following formula.

bb172557 D3DFOG_EXP2 D3DFOG_EXP2

Fog effect intensifies linearly between the start and end points, according to the following formula.

This is the only fog mode currently supported.

bb172557 D3DFOG_LINEAR D3DFOG_LINEAR

Defines the various types of surface formats.

typedef enum _D3DFORMAT { = 0, = 20, = 21, = 22, = 23, = 24, = 25, = 26, = 27, = 28, = 29, = 30, = 31, = 32, = 33, = 34, = 35, = 36, = 40, = 41, = 50, = 51, = 52, = 60, = 61, = 62, = 63, = 64, = 67, = MAKEFOURCC('U', 'Y', 'V', 'Y'), = MAKEFOURCC('R', 'G', 'B', 'G'), = MAKEFOURCC('Y', 'U', 'Y', '2'), = MAKEFOURCC('G', 'R', 'G', 'B'), = MAKEFOURCC('D', 'X', 'T', '1'), = MAKEFOURCC('D', 'X', 'T', '2'), = MAKEFOURCC('D', 'X', 'T', '3'), = MAKEFOURCC('D', 'X', 'T', '4'), = MAKEFOURCC('D', 'X', 'T', '5'), = 70, = 71, = 73, = 75, = 77, = 79, = 80, = 82, = 83, #if !defined(D3D_DISABLE_9EX) = 84, = 85, #endif // !D3D_DISABLE_9EX = 81, =100, =101, =102, =110, = MAKEFOURCC('M','E','T','1'), = 111, = 112, = 113, = 114, = 115, = 116, = 117, #if !defined(D3D_DISABLE_9EX) = 118, = 119, = 199, #endif // !D3D_DISABLE_9EX D3DFMT_FORCE_DWORD =0x7fffffff } ;

There are several types of formats:

  • BackBuffer
  • Buffer
  • DXTn
  • Floating-Point
  • FOURCC
  • IEEE
  • Mixed
  • Signed
  • Unsigned
  • Other

All formats are listed from left to right, most-significant bit to least-significant bit. For example, D3DFORMAT_ARGB is ordered from the most-significant bit channel A (alpha), to the least-significant bit channel B (blue). When traversing surface data, the data is stored in memory from least-significant bit to most-significant bit, which means that the channel order in memory is from least-significant bit (blue) to most-significant bit (alpha).

The default value for formats that contain undefined channels (G16R16, A8, and so on) is 1. The only exception is the A8 format, which is initialized to 000 for the three color channels.

The order of the bits is from the most significant byte first, so indicates that the high byte of this 2-byte format is alpha. indicates a 16-bit integer value and an application-lockable surface.

Pixel formats have been chosen to enable the expression of hardware-vendor-defined extension formats, as well as to include the well-established FOURCC method. The set of formats understood by the Direct3D runtime is defined by .

Note that formats are supplied by independent hardware vendors (IHVs) and many FOURCC codes are not listed. The formats in this enumeration are unique in that they are sanctioned by the runtime, meaning that the reference rasterizer will operate on all these types. IHV-supplied formats will be supported by the individual IHVs on a card-by-card basis.

bb172558 D3DFORMAT D3DFORMAT
No documentation. bb172558 D3DFMT_UNKNOWN D3DFMT_UNKNOWN No documentation. bb172558 D3DFMT_R8G8B8 D3DFMT_R8G8B8 No documentation. bb172558 D3DFMT_A8R8G8B8 D3DFMT_A8R8G8B8 No documentation. bb172558 D3DFMT_X8R8G8B8 D3DFMT_X8R8G8B8 No documentation. bb172558 D3DFMT_R5G6B5 D3DFMT_R5G6B5 No documentation. bb172558 D3DFMT_X1R5G5B5 D3DFMT_X1R5G5B5 No documentation. bb172558 D3DFMT_A1R5G5B5 D3DFMT_A1R5G5B5 No documentation. bb172558 D3DFMT_A4R4G4B4 D3DFMT_A4R4G4B4 No documentation. bb172558 D3DFMT_R3G3B2 D3DFMT_R3G3B2 No documentation. bb172558 D3DFMT_A8 D3DFMT_A8 No documentation. bb172558 D3DFMT_A8R3G3B2 D3DFMT_A8R3G3B2 No documentation. bb172558 D3DFMT_X4R4G4B4 D3DFMT_X4R4G4B4 No documentation. bb172558 D3DFMT_A2B10G10R10 D3DFMT_A2B10G10R10 No documentation. bb172558 D3DFMT_A8B8G8R8 D3DFMT_A8B8G8R8 No documentation. bb172558 D3DFMT_X8B8G8R8 D3DFMT_X8B8G8R8 No documentation. bb172558 D3DFMT_G16R16 D3DFMT_G16R16 No documentation. bb172558 D3DFMT_A2R10G10B10 D3DFMT_A2R10G10B10 No documentation. bb172558 D3DFMT_A16B16G16R16 D3DFMT_A16B16G16R16 No documentation. bb172558 D3DFMT_A8P8 D3DFMT_A8P8 No documentation. bb172558 D3DFMT_P8 D3DFMT_P8 No documentation. bb172558 D3DFMT_L8 D3DFMT_L8 No documentation. bb172558 D3DFMT_A8L8 D3DFMT_A8L8 No documentation. bb172558 D3DFMT_A4L4 D3DFMT_A4L4 No documentation. bb172558 D3DFMT_V8U8 D3DFMT_V8U8 No documentation. bb172558 D3DFMT_L6V5U5 D3DFMT_L6V5U5 No documentation. bb172558 D3DFMT_X8L8V8U8 D3DFMT_X8L8V8U8 No documentation. bb172558 D3DFMT_Q8W8V8U8 D3DFMT_Q8W8V8U8 No documentation. bb172558 D3DFMT_V16U16 D3DFMT_V16U16 No documentation. bb172558 D3DFMT_A2W10V10U10 D3DFMT_A2W10V10U10 No documentation. bb172558 D3DFMT_UYVY D3DFMT_UYVY No documentation. bb172558 D3DFMT_R8G8_B8G8 D3DFMT_R8G8_B8G8 No documentation. bb172558 D3DFMT_YUY2 D3DFMT_YUY2 No documentation. bb172558 D3DFMT_G8R8_G8B8 D3DFMT_G8R8_G8B8 No documentation. bb172558 D3DFMT_DXT1 D3DFMT_DXT1 No documentation. bb172558 D3DFMT_DXT2 D3DFMT_DXT2 No documentation. bb172558 D3DFMT_DXT3 D3DFMT_DXT3 No documentation. bb172558 D3DFMT_DXT4 D3DFMT_DXT4 No documentation. bb172558 D3DFMT_DXT5 D3DFMT_DXT5 No documentation. bb172558 D3DFMT_D16_LOCKABLE D3DFMT_D16_LOCKABLE No documentation. bb172558 D3DFMT_D32 D3DFMT_D32 No documentation. bb172558 D3DFMT_D15S1 D3DFMT_D15S1 No documentation. bb172558 D3DFMT_D24S8 D3DFMT_D24S8 No documentation. bb172558 D3DFMT_D24X8 D3DFMT_D24X8 No documentation. bb172558 D3DFMT_D24X4S4 D3DFMT_D24X4S4 No documentation. bb172558 D3DFMT_D16 D3DFMT_D16 No documentation. bb172558 D3DFMT_D32F_LOCKABLE D3DFMT_D32F_LOCKABLE No documentation. bb172558 D3DFMT_D24FS8 D3DFMT_D24FS8 No documentation. bb172558 D3DFMT_D32_LOCKABLE D3DFMT_D32_LOCKABLE No documentation. bb172558 D3DFMT_S8_LOCKABLE D3DFMT_S8_LOCKABLE No documentation. bb172558 D3DFMT_L16 D3DFMT_L16 No documentation. bb172558 D3DFMT_VERTEXDATA D3DFMT_VERTEXDATA No documentation. bb172558 D3DFMT_INDEX16 D3DFMT_INDEX16 No documentation. bb172558 D3DFMT_INDEX32 D3DFMT_INDEX32 No documentation. bb172558 D3DFMT_Q16W16V16U16 D3DFMT_Q16W16V16U16 No documentation. bb172558 D3DFMT_MULTI2_ARGB8 D3DFMT_MULTI2_ARGB8 No documentation. bb172558 D3DFMT_R16F D3DFMT_R16F No documentation. bb172558 D3DFMT_G16R16F D3DFMT_G16R16F No documentation. bb172558 D3DFMT_A16B16G16R16F D3DFMT_A16B16G16R16F No documentation. bb172558 D3DFMT_R32F D3DFMT_R32F No documentation. bb172558 D3DFMT_G32R32F D3DFMT_G32R32F No documentation. bb172558 D3DFMT_A32B32G32R32F D3DFMT_A32B32G32R32F No documentation. bb172558 D3DFMT_CxV8U8 D3DFMT_CxV8U8 No documentation. bb172558 D3DFMT_A1 D3DFMT_A1 No documentation. bb172558 D3DFMT_A2B10G10R10_XR_BIAS D3DFMT_A2B10G10R10_XR_BIAS No documentation. bb172558 D3DFMT_BINARYBUFFER D3DFMT_BINARYBUFFER

Options for saving and creating effects.

The constants in the following table are defined in d3dx9effect.h.

bb172855 D3DXFX D3DXFX
No documentation. bb172855 D3DXFX_DONOTSAVESTATE D3DXFX_DONOTSAVESTATE No documentation. bb172855 D3DXFX_DONOTSAVESHADERSTATE D3DXFX_DONOTSAVESHADERSTATE No documentation. bb172855 D3DXFX_DONOTSAVESAMPLERSTATE D3DXFX_DONOTSAVESAMPLERSTATE No documentation. bb172855 D3DXFX_NOT_CLONEABLE D3DXFX_NOT_CLONEABLE No documentation. bb172855 D3DXFX_LARGEADDRESSAWARE D3DXFX_LARGEADDRESSAWARE None. None None

Describes the supported image file formats. See Remarks for descriptions of these formats.

Functions that begin with D3DXLoadxxx support all of the formats listed. Functions that begin with D3DXSavexxx support all of the formats listed except the Truevision (.tga) and portable pixmap (.ppm) formats.

The following table lists the available input and output formats.

File ExtensionDescription
.bmpWindows bitmap format. Contains a header that describes the resolution of the device on which the rectangle of pixels was created, the dimensions of the rectangle, the size of the array of bits, a logical palette, and an array of bits that defines the relationship between pixels in the bitmapped image and entries in the logical palette.
.ddsDirectDraw Surface file format. Stores textures, volume textures, and cubic environment maps, with or without mipmap levels, and with or without pixel compression. See DDS.
.dibWindows DIB. Contains an array of bits combined with structures that specify width and height of the bitmapped image, color format of the device where the image was created, and resolution of the device used to create that image.
.hdrHDR format. Encodes each pixel as an RGBE 32-bit color, with 8 bits of mantissa for red, green, and blue, and a shared 8-bit exponent. Each channel is separately compressed with run-length encoding (RLE).
.jpgJPEG standard. Specifies variable compression of 24-bit RGB color and 8-bit gray-scale Tagged Image File Format (TIFF) image document files.
.pfmPortable float map format. A raw floating point image format, without any compression. The file header specifies image width, height, monochrome or color, and machine word order. Pixel data is stored as 32-bit floating point values, with 3 values per pixel for color, and one value per pixel for monochrome.
.pngPNG format. A non-proprietary bitmap format using lossless compression.
.ppmPortable Pixmap format. A binary or ASCII file format for color images that includes image height and width and the maximum color component value.
.tgaTarga or Truevision Graphics Adapter format. Supports depths of 8, 15, 16, 24, and 32 bits, including 8-bit gray scale, and contains optional color palette data, image (x, y) origin and size data, and pixel data.

?

See Types of Bitmaps for more information on some of these formats.

bb172878 D3DXIMAGE_FILEFORMAT D3DXIMAGE_FILEFORMAT

Windows bitmap (BMP) file format.

bb172878 D3DXIFF_BMP D3DXIFF_BMP

Joint Photographics Experts Group (JPEG) compressed file format.

bb172878 D3DXIFF_JPG D3DXIFF_JPG

Truevision (Targa, or TGA) image file format.

bb172878 D3DXIFF_TGA D3DXIFF_TGA

Portable Network Graphics (PNG) file format.

bb172878 D3DXIFF_PNG D3DXIFF_PNG

DirectDraw surface (DDS) file format.

bb172878 D3DXIFF_DDS D3DXIFF_DDS

Portable pixmap (PPM) file format.

bb172878 D3DXIFF_PPM D3DXIFF_PPM

Windows device-independent bitmap (DIB) file format.

bb172878 D3DXIFF_DIB D3DXIFF_DIB

High dynamic range (HDR) file format.

bb172878 D3DXIFF_HDR D3DXIFF_HDR

Portable float map file format.

bb172878 D3DXIFF_PFM D3DXIFF_PFM

Describes the location for the include file.

bb172881 D3DXINCLUDE_TYPE D3DXINCLUDE_TYPE

Look in the local project for the include file.

bb172881 D3DXINC_LOCAL D3DXINC_LOCAL

Look in the system path for the include file.

bb172881 D3DXINC_SYSTEM D3DXINC_SYSTEM

This macro creates a value used by Issue to issue a query end.

#define (1 << 0)

This macro changes the query state to nonsignaled.

is valid for the following query types.

  • D3DQUERYTYPE_ResourceManager
bb172565 D3DISSUE D3DISSUE
No documentation. bb172565 D3DISSUE_END D3DISSUE_END No documentation. bb172565 D3DISSUE_BEGIN D3DISSUE_BEGIN

Defines the light type.

Directional lights are slightly faster than point light sources, but point lights look a little better. Spotlights offer interesting visual effects but are computationally time-consuming.

bb172567 D3DLIGHTTYPE D3DLIGHTTYPE

Light is a point source. The light has a position in space and radiates light in all directions.

bb172567 D3DLIGHT_POINT D3DLIGHT_POINT

Light is a spotlight source. This light is like a point light, except that the illumination is limited to a cone. This light type has a direction and several other parameters that determine the shape of the cone it produces. For information about these parameters, see the structure.

bb172567 D3DLIGHT_SPOT D3DLIGHT_SPOT

Light is a directional light source. This is equivalent to using a point light source at an infinite distance.

bb172567 D3DLIGHT_DIRECTIONAL D3DLIGHT_DIRECTIONAL
No documentation. bb206304 D3DLINECAPS D3DLINECAPS No documentation. bb206304 D3DLINECAPS_TEXTURE D3DLINECAPS_TEXTURE No documentation. bb206304 D3DLINECAPS_ZTEST D3DLINECAPS_ZTEST No documentation. bb206304 D3DLINECAPS_BLEND D3DLINECAPS_BLEND No documentation. bb206304 D3DLINECAPS_ALPHACMP D3DLINECAPS_ALPHACMP No documentation. bb206304 D3DLINECAPS_FOG D3DLINECAPS_FOG No documentation. bb206304 D3DLINECAPS_ANTIALIAS D3DLINECAPS_ANTIALIAS

A combination of zero or more locking options that describe the type of lock to perform.

bb172568 D3DLOCK D3DLOCK
No documentation. bb172568 D3DLOCK_READONLY D3DLOCK_READONLY No documentation. bb172568 D3DLOCK_DISCARD D3DLOCK_DISCARD No documentation. bb172568 D3DLOCK_NOOVERWRITE D3DLOCK_NOOVERWRITE No documentation. bb172568 D3DLOCK_NOSYSLOCK D3DLOCK_NOSYSLOCK No documentation. bb172568 D3DLOCK_DONOTWAIT D3DLOCK_DONOTWAIT No documentation. bb172568 D3DLOCK_NO_DIRTY_UPDATE D3DLOCK_NO_DIRTY_UPDATE No documentation. bb172568 D3DLOCK_DONOTCOPYDATA D3DLOCK_DONOTCOPYDATA None. None None

Defines the type of mesh data present in .

bb205373 D3DXMESHDATATYPE D3DXMESHDATATYPE
No documentation. bb205373 D3DXMESHTYPE_MESH D3DXMESHTYPE_MESH No documentation. bb205373 D3DXMESHTYPE_PMESH D3DXMESHTYPE_PMESH No documentation. bb205373 D3DXMESHTYPE_PATCHMESH D3DXMESHTYPE_PATCHMESH

Flags used to specify creation options for a mesh.

A 32-bit mesh () can theoretically support (2^32)-1 faces and vertices. However, allocating memory for a mesh that large on a 32-bit operating system is not practical.

bb205370 _D3DXMESH _D3DXMESH

The mesh has 32-bit indices instead of 16-bit indices. See Remarks.

bb205370 D3DXMESH_32BIT D3DXMESH_32BIT

Use the usage flag for vertex and index buffers.

bb205370 D3DXMESH_DONOTCLIP D3DXMESH_DONOTCLIP

Use the usage flag for vertex and index buffers.

bb205370 D3DXMESH_POINTS D3DXMESH_POINTS

Use the usage flag for vertex and index buffers.

bb205370 D3DXMESH_RTPATCHES D3DXMESH_RTPATCHES

Specifying this flag causes the vertex and index buffer of the mesh to be created with flag. This is required if the mesh object is to be rendered using N-patch enhancement using Direct3D.

bb205370 D3DXMESH_NPATCHES D3DXMESH_NPATCHES

Use the usage flag for vertex buffers.

bb205370 D3DXMESH_VB_SYSTEMMEM D3DXMESH_VB_SYSTEMMEM

Use the usage flag for vertex buffers.

bb205370 D3DXMESH_VB_MANAGED D3DXMESH_VB_MANAGED

Use the usage flag for vertex buffers.

bb205370 D3DXMESH_VB_WRITEONLY D3DXMESH_VB_WRITEONLY

Use the usage flag for vertex buffers.

bb205370 D3DXMESH_VB_DYNAMIC D3DXMESH_VB_DYNAMIC

Use the usage flag for vertex buffers.

bb205370 D3DXMESH_VB_SOFTWAREPROCESSING D3DXMESH_VB_SOFTWAREPROCESSING

Use the usage flag for index buffers.

bb205370 D3DXMESH_IB_SYSTEMMEM D3DXMESH_IB_SYSTEMMEM

Use the usage flag for index buffers.

bb205370 D3DXMESH_IB_MANAGED D3DXMESH_IB_MANAGED

Use the usage flag for index buffers.

bb205370 D3DXMESH_IB_WRITEONLY D3DXMESH_IB_WRITEONLY

Use the usage flag for index buffers.

bb205370 D3DXMESH_IB_DYNAMIC D3DXMESH_IB_DYNAMIC

Use the usage flag for index buffers.

bb205370 D3DXMESH_IB_SOFTWAREPROCESSING D3DXMESH_IB_SOFTWAREPROCESSING

Forces the cloned meshes to share vertex buffers.

bb205370 D3DXMESH_VB_SHARE D3DXMESH_VB_SHARE

Use hardware processing only. For mixed-mode device, this flag will cause the system to use hardware (if supported in hardware) or will default to software processing.

bb205370 D3DXMESH_USEHWONLY D3DXMESH_USEHWONLY

Equivalent to specifying both and .

bb205370 D3DXMESH_SYSTEMMEM D3DXMESH_SYSTEMMEM

Equivalent to specifying both and .

bb205370 D3DXMESH_MANAGED D3DXMESH_MANAGED

Equivalent to specifying both and .

bb205370 D3DXMESH_WRITEONLY D3DXMESH_WRITEONLY

Equivalent to specifying both and .

bb205370 D3DXMESH_DYNAMIC D3DXMESH_DYNAMIC

Equivalent to specifying both and .

bb205370 D3DXMESH_SOFTWAREPROCESSING D3DXMESH_SOFTWAREPROCESSING

Specifies the type of mesh optimization to be performed.

The and optimization flags are mutually exclusive.

The D3DXMESHOPT_SHAREVB flag has been removed from this enumeration. Use instead, in D3DXMESH.

bb205374 _D3DXMESHOPT _D3DXMESHOPT

Reorders faces to remove unused vertices and faces.

bb205374 D3DXMESHOPT_COMPACT D3DXMESHOPT_COMPACT

Reorders faces to optimize for fewer attribute bundle state changes and enhanced performance.

bb205374 D3DXMESHOPT_ATTRSORT D3DXMESHOPT_ATTRSORT

Reorders faces to increase the cache hit rate of vertex caches.

bb205374 D3DXMESHOPT_VERTEXCACHE D3DXMESHOPT_VERTEXCACHE

Reorders faces to maximize length of adjacent triangles.

bb205374 D3DXMESHOPT_STRIPREORDER D3DXMESHOPT_STRIPREORDER

Optimize the faces only; do not optimize the vertices.

bb205374 D3DXMESHOPT_IGNOREVERTS D3DXMESHOPT_IGNOREVERTS

While attribute sorting, do not split vertices that are shared between attribute groups.

bb205374 D3DXMESHOPT_DONOTSPLIT D3DXMESHOPT_DONOTSPLIT

Affects the vertex cache size. Using this flag specifies a default vertex cache size that works well on legacy hardware.

bb205374 D3DXMESHOPT_DEVICEINDEPENDENT D3DXMESHOPT_DEVICEINDEPENDENT

Specifies simplification options for a mesh.

bb205375 _D3DXMESHSIMP _D3DXMESHSIMP

The mesh will be simplified by the number of vertices specified in the MinValue parameter.

bb205375 D3DXMESHSIMP_VERTEX D3DXMESHSIMP_VERTEX

The mesh will be simplified by the number of faces specified in the MinValue parameter.

bb205375 D3DXMESHSIMP_FACE D3DXMESHSIMP_FACE

Defines the levels of full-scene multisampling that the device can apply.

In addition to enabling full-scene multisampling at time, there will be render states that turn various aspects on and off at fine-grained levels.

Multisampling is valid only on a swap chain that is being created or reset with the swap effect.

The multisample antialiasing value can be set with the parameters (or sub-parameters) in the following methods.

MethodParametersSub-parameters
MultiSampleType and pQualityLevels
pPresentationParametersMultiSampleType and pQualityLevels
pPresentationParametersMultiSampleType and pQualityLevels
MultiSampleType and pQualityLevels
MultiSampleType and pQualityLevels
pPresentationParametersMultiSampleType and pQualityLevels

?

It is not good practice to switch from one multisample type to another to raise the quality of the antialiasing.

enables swap effects other than discarding, locking, and so on.

Whether the display device supports maskable multisampling (more than one sample for a multiple-sample render-target format plus antialias support) or just non-maskable multisampling (only antialias support), the driver for the device provides the number of quality levels for the multiple-sample type. Applications that just use multisampling for antialiasing purposes only need to query for the number of non-maskable multiple-sample quality levels that the driver supports.

The quality levels supported by the device can be obtained with the pQualityLevels parameter of . Quality levels used by the application are set with the MultiSampleQuality parameter of and .

See for discussion of maskable multisampling.

bb172574 D3DMULTISAMPLE_TYPE D3DMULTISAMPLE_TYPE

No level of full-scene multisampling is available.

bb172574 D3DMULTISAMPLE_NONE D3DMULTISAMPLE_NONE

Enables the multisample quality value. See Remarks.

bb172574 D3DMULTISAMPLE_NONMASKABLE D3DMULTISAMPLE_NONMASKABLE

Level of full-scene multisampling available.

bb172574 D3DMULTISAMPLE_2_SAMPLES D3DMULTISAMPLE_2_SAMPLES

Level of full-scene multisampling available.

bb172574 D3DMULTISAMPLE_3_SAMPLES D3DMULTISAMPLE_3_SAMPLES

Level of full-scene multisampling available.

bb172574 D3DMULTISAMPLE_4_SAMPLES D3DMULTISAMPLE_4_SAMPLES

Level of full-scene multisampling available.

bb172574 D3DMULTISAMPLE_5_SAMPLES D3DMULTISAMPLE_5_SAMPLES

Level of full-scene multisampling available.

bb172574 D3DMULTISAMPLE_6_SAMPLES D3DMULTISAMPLE_6_SAMPLES

Level of full-scene multisampling available.

bb172574 D3DMULTISAMPLE_7_SAMPLES D3DMULTISAMPLE_7_SAMPLES

Level of full-scene multisampling available.

bb172574 D3DMULTISAMPLE_8_SAMPLES D3DMULTISAMPLE_8_SAMPLES

Level of full-scene multisampling available.

bb172574 D3DMULTISAMPLE_9_SAMPLES D3DMULTISAMPLE_9_SAMPLES

Level of full-scene multisampling available.

bb172574 D3DMULTISAMPLE_10_SAMPLES D3DMULTISAMPLE_10_SAMPLES

Level of full-scene multisampling available.

bb172574 D3DMULTISAMPLE_11_SAMPLES D3DMULTISAMPLE_11_SAMPLES

Level of full-scene multisampling available.

bb172574 D3DMULTISAMPLE_12_SAMPLES D3DMULTISAMPLE_12_SAMPLES

Level of full-scene multisampling available.

bb172574 D3DMULTISAMPLE_13_SAMPLES D3DMULTISAMPLE_13_SAMPLES

Level of full-scene multisampling available.

bb172574 D3DMULTISAMPLE_14_SAMPLES D3DMULTISAMPLE_14_SAMPLES

Level of full-scene multisampling available.

bb172574 D3DMULTISAMPLE_15_SAMPLES D3DMULTISAMPLE_15_SAMPLES

Level of full-scene multisampling available.

bb172574 D3DMULTISAMPLE_16_SAMPLES D3DMULTISAMPLE_16_SAMPLES

Normal maps generation constants.

bb205566 D3DX_NORMALMAP D3DX_NORMALMAP
No documentation. bb205566 D3DX_NORMALMAP_MIRROR_U D3DX_NORMALMAP_MIRROR_U No documentation. bb205566 D3DX_NORMALMAP_MIRROR_V D3DX_NORMALMAP_MIRROR_V No documentation. bb205566 D3DX_NORMALMAP_MIRROR D3DX_NORMALMAP_MIRROR No documentation. bb205566 D3DX_NORMALMAP_INVERTSIGN D3DX_NORMALMAP_INVERTSIGN No documentation. bb205566 D3DX_NORMALMAP_COMPUTE_OCCLUSION D3DX_NORMALMAP_COMPUTE_OCCLUSION

The type of object.

bb205378 D3DXPARAMETER_CLASS D3DXPARAMETER_CLASS

Constant is a scalar.

bb205378 D3DXPC_SCALAR D3DXPC_SCALAR

Constant is a vector.

bb205378 D3DXPC_VECTOR D3DXPC_VECTOR

Constant is a row major matrix.

bb205378 D3DXPC_MATRIX_ROWS D3DXPC_MATRIX_ROWS

Constant is a column major matrix.

bb205378 D3DXPC_MATRIX_COLUMNS D3DXPC_MATRIX_COLUMNS

Constant is either a texture, shader, or a string.

bb205378 D3DXPC_OBJECT D3DXPC_OBJECT

Constant is a structure.

bb205378 D3DXPC_STRUCT D3DXPC_STRUCT

These flags provide additional information about effect parameters.

Effect parameter constants are used by .

bb205567 D3DX_PARAMETER D3DX_PARAMETER
No documentation. bb205567 D3DX_PARAMETER_SHARED D3DX_PARAMETER_SHARED No documentation. bb205567 D3DX_PARAMETER_LITERAL D3DX_PARAMETER_LITERAL No documentation. bb205567 D3DX_PARAMETER_ANNOTATION D3DX_PARAMETER_ANNOTATION None. None None

Describes the data contained by the enumeration.

bb205380 D3DXPARAMETER_TYPE D3DXPARAMETER_TYPE

Parameter is a void reference.

bb205380 D3DXPT_VOID D3DXPT_VOID

Parameter is a Boolean. Any non-zero value passed into , , , , or will be mapped to 1 (TRUE) before being written into the constant table; otherwise, the value will be set to 0 in the constant table.

bb205380 D3DXPT_BOOL D3DXPT_BOOL

Parameter is an integer. Any floating-point values passed into , , or will be rounded off (to zero decimal places) before being written into the constant table.

bb205380 D3DXPT_INT D3DXPT_INT

Parameter is a floating-point number.

bb205380 D3DXPT_FLOAT D3DXPT_FLOAT

Parameter is a string.

bb205380 D3DXPT_STRING D3DXPT_STRING

Parameter is a texture.

bb205380 D3DXPT_TEXTURE D3DXPT_TEXTURE

Parameter is a 1D texture.

bb205380 D3DXPT_TEXTURE1D D3DXPT_TEXTURE1D

Parameter is a 2D texture.

bb205380 D3DXPT_TEXTURE2D D3DXPT_TEXTURE2D

Parameter is a 3D texture.

bb205380 D3DXPT_TEXTURE3D D3DXPT_TEXTURE3D

Parameter is a cube texture.

bb205380 D3DXPT_TEXTURECUBE D3DXPT_TEXTURECUBE

Parameter is a sampler.

bb205380 D3DXPT_SAMPLER D3DXPT_SAMPLER

Parameter is a 1D sampler.

bb205380 D3DXPT_SAMPLER1D D3DXPT_SAMPLER1D

Parameter is a 2D sampler.

bb205380 D3DXPT_SAMPLER2D D3DXPT_SAMPLER2D

Parameter is a 3D sampler.

bb205380 D3DXPT_SAMPLER3D D3DXPT_SAMPLER3D

Parameter is a cube sampler.

bb205380 D3DXPT_SAMPLERCUBE D3DXPT_SAMPLERCUBE

Parameter is a pixel shader.

bb205380 D3DXPT_PIXELSHADER D3DXPT_PIXELSHADER

Parameter is a vertex shader.

bb205380 D3DXPT_VERTEXSHADER D3DXPT_VERTEXSHADER

Parameter is a pixel shader fragment.

bb205380 D3DXPT_PIXELFRAGMENT D3DXPT_PIXELFRAGMENT

Parameter is a vertex shader fragment.

bb205380 D3DXPT_VERTEXFRAGMENT D3DXPT_VERTEXFRAGMENT

Parameter is not supported.

bb205380 D3DXPT_UNSUPPORTED D3DXPT_UNSUPPORTED

Defines whether the current tessellation mode is discrete or continuous.

Note that continuous tessellation produces a completely different tessellation pattern from the discrete one for the same tessellation values (this is more apparent in wireframe mode). Thus, 4.0 continuous is not the same as 4 discrete.

bb172575 D3DPATCHEDGESTYLE D3DPATCHEDGESTYLE

Discrete edge style. In discrete mode, you can specify float tessellation but it will be truncated to integers.

bb172575 D3DPATCHEDGE_DISCRETE D3DPATCHEDGE_DISCRETE

Continuous edge style. In continuous mode, tessellation is specified as float values that can be smoothly varied to reduce "popping" artifacts.

bb172575 D3DPATCHEDGE_CONTINUOUS D3DPATCHEDGE_CONTINUOUS

Mesh patch types.

Triangle patches have three sides and are described in . Rectangle patches are four-sided and are described in .

bb205384 D3DXPATCHMESHTYPE D3DXPATCHMESHTYPE

Rectangle patch mesh type.

bb205384 D3DXPATCHMESH_RECT D3DXPATCHMESH_RECT

Triangle patch mesh type.

bb205384 D3DXPATCHMESH_TRI D3DXPATCHMESH_TRI

N-patch mesh type.

bb205384 D3DXPATCHMESH_NPATCH D3DXPATCHMESH_NPATCH
No documentation. D3DPS20CAPS D3DPS20CAPS No documentation. D3DPS20CAPS_ARBITRARYSWIZZLE D3DPS20CAPS_ARBITRARYSWIZZLE No documentation. D3DPS20CAPS_GRADIENTINSTRUCTIONS D3DPS20CAPS_GRADIENTINSTRUCTIONS No documentation. D3DPS20CAPS_PREDICATION D3DPS20CAPS_PREDICATION No documentation. D3DPS20CAPS_NODEPENDENTREADLIMIT D3DPS20CAPS_NODEPENDENTREADLIMIT No documentation. D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT D3DPS20CAPS_NOTEXINSTRUCTIONLIMIT None. None None

Defines the type of animation set looping modes used for playback.

bb205397 D3DXPLAYBACK_TYPE D3DXPLAYBACK_TYPE

The animation repeats endlessly.

bb205397 D3DXPLAY_LOOP D3DXPLAY_LOOP

The animation plays once, and then it stops on the last frame.

bb205397 D3DXPLAY_ONCE D3DXPLAY_ONCE

The animation alternates endlessly between playing forward and playing backward.

bb205397 D3DXPLAY_PINGPONG D3DXPLAY_PINGPONG

Defines the memory class that holds the buffers for a resource.

All pool types are valid with all resources including: vertex buffers, index buffers, textures, and surfaces.

The following tables indicate restrictions on pool types for render targets, depth stencils, and dynamic and mipmap usages. An x indicates a compatible combination; lack of an x indicates incompatibility.

Pool
xx

?

Pool
xx
x
x

?

For more information about usage types, see .

Pools cannot be mixed for different objects contained within one resource (mip levels in a mipmap) and, when a pool is chosen, it cannot be changed.

Applications should use for most static resources because this saves the application from having to deal with lost devices. (Managed resources are restored by the runtime.) This is especially beneficial for unified memory architecture (UMA) systems. Other dynamic resources are not a good match for . In fact, index buffers and vertex buffers cannot be created using together with .

For dynamic textures, it is sometimes desirable to use a pair of video memory and system memory textures, allocating the video memory using and the system memory using . You can lock and modify the bits of the system memory texture using a locking method. Then you can update the video memory texture using .

bb172584 D3DPOOL D3DPOOL

Resources are placed in the memory pool most appropriate for the set of usages requested for the given resource. This is usually video memory, including both local video memory and AGP memory. The pool is separate from and , and it specifies that the resource is placed in the preferred memory for device access. Note that never indicates that either or should be chosen as the memory pool type for this resource. Textures placed in the pool cannot be locked unless they are dynamic textures or they are private, FOURCC, driver formats. To access unlockable textures, you must use functions such as , , , and . is probably a better choice than for most applications. Note that some textures created in driver-proprietary pixel formats, unknown to the Direct3D runtime, can be locked. Also note that - unlike textures - swap chain back buffers, render targets, vertex buffers, and index buffers can be locked. When a device is lost, resources created using must be released before calling . For more information, see Lost Devices (Direct3D 9).

When creating resources with , if video card memory is already committed, managed resources will be evicted to free enough memory to satisfy the request.

bb172584 D3DPOOL_DEFAULT D3DPOOL_DEFAULT

Resources are copied automatically to device-accessible memory as needed. Managed resources are backed by system memory and do not need to be recreated when a device is lost. See Managing Resources (Direct3D 9) for more information. Managed resources can be locked. Only the system-memory copy is directly modified. Direct3D copies your changes to driver-accessible memory as needed.

Differences between Direct3D 9 and Direct3D 9Ex:

is valid with ; however, it is not valid with .

?

bb172584 D3DPOOL_MANAGED D3DPOOL_MANAGED

Resources are placed in memory that is not typically accessible by the Direct3D device. This memory allocation consumes system RAM but does not reduce pageable RAM. These resources do not need to be recreated when a device is lost. Resources in this pool can be locked and can be used as the source for a or operation to a memory resource created with .

bb172584 D3DPOOL_SYSTEMMEM D3DPOOL_SYSTEMMEM

Resources are placed in system RAM and do not need to be recreated when a device is lost. These resources are not bound by device size or format restrictions. Because of this, these resources cannot be accessed by the Direct3D device nor set as textures or render targets. However, these resources can always be created, locked, and copied.

bb172584 D3DPOOL_SCRATCH D3DPOOL_SCRATCH

Describes the relationship between the adapter refresh rate and the rate at which Present or Present operations are completed. These values also serve as flag values for the PresentationIntervals field of .

Windowed mode supports , , and . and the are nearly equivalent (see the information regarding timer resolution below). They perform similarly to COPY_VSYNC in that there is only one present per frame, and they prevent tearing with beam-following. In contrast, will attempt to provide an unlimited presentation rate.

Full-screen mode supports similar usage as windowed mode by supporting regardless of the refresh rate or swap effect. uses the default system timer resolution whereas the calls timeBeginPeriod to enhance system timer resolution. This improves the quality of vertical sync, but consumes slightly more processing time. Both parameters attempt to synchronize vertically.

bb172585 D3DPRESENT D3DPRESENT
No documentation. bb172585 D3DPRESENT_BACK_BUFFERS_MAX D3DPRESENT_BACK_BUFFERS_MAX No documentation. bb172585 D3DPRESENT_BACK_BUFFERS_MAX_EX D3DPRESENT_BACK_BUFFERS_MAX_EX No documentation. bb172585 D3DPRESENT_DONOTWAIT D3DPRESENT_DONOTWAIT No documentation. bb172585 D3DPRESENT_LINEAR_CONTENT D3DPRESENT_LINEAR_CONTENT No documentation. bb172585 D3DPRESENT_DONOTFLIP D3DPRESENT_DONOTFLIP No documentation. bb172585 D3DPRESENT_FLIPRESTART D3DPRESENT_FLIPRESTART No documentation. bb172585 D3DPRESENT_VIDEO_RESTRICT_TO_MONITOR D3DPRESENT_VIDEO_RESTRICT_TO_MONITOR No documentation. bb172585 D3DPRESENT_UPDATEOVERLAYONLY D3DPRESENT_UPDATEOVERLAYONLY No documentation. bb172585 D3DPRESENT_HIDEOVERLAY D3DPRESENT_HIDEOVERLAY No documentation. bb172585 D3DPRESENT_UPDATECOLORKEY D3DPRESENT_UPDATECOLORKEY No documentation. bb172585 D3DPRESENT_FORCEIMMEDIATE D3DPRESENT_FORCEIMMEDIATE No documentation. bb172585 D3DPRESENT_RATE_DEFAULT D3DPRESENT_RATE_DEFAULT None. None None

Constants used by .

bb172586 D3DPRESENTFLAG D3DPRESENTFLAG
No documentation. bb172586 D3DPRESENTFLAG_LOCKABLE_BACKBUFFER D3DPRESENTFLAG_LOCKABLE_BACKBUFFER No documentation. bb172586 D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL D3DPRESENTFLAG_DISCARD_DEPTHSTENCIL No documentation. bb172586 D3DPRESENTFLAG_DEVICECLIP D3DPRESENTFLAG_DEVICECLIP No documentation. bb172586 D3DPRESENTFLAG_VIDEO D3DPRESENTFLAG_VIDEO No documentation. bb172586 D3DPRESENTFLAG_NOAUTOROTATE D3DPRESENTFLAG_NOAUTOROTATE No documentation. bb172586 D3DPRESENTFLAG_UNPRUNEDMODE D3DPRESENTFLAG_UNPRUNEDMODE No documentation. bb172586 D3DPRESENTFLAG_OVERLAY_LIMITEDRGB D3DPRESENTFLAG_OVERLAY_LIMITEDRGB No documentation. bb172586 D3DPRESENTFLAG_OVERLAY_YCbCr_BT709 D3DPRESENTFLAG_OVERLAY_YCbCr_BT709 No documentation. bb172586 D3DPRESENTFLAG_OVERLAY_YCbCr_xvYCC D3DPRESENTFLAG_OVERLAY_YCbCr_xvYCC No documentation. bb172586 D3DPRESENTFLAG_RESTRICTED_CONTENT D3DPRESENTFLAG_RESTRICTED_CONTENT No documentation. bb172586 D3DPRESENTFLAG_RESTRICT_SHARED_RESOURCE_DRIVER D3DPRESENTFLAG_RESTRICT_SHARED_RESOURCE_DRIVER None. None None

Describes the relationship between the adapter refresh rate and the rate at which Present or Present operations are completed. These values also serve as flag values for the PresentationIntervals field of .

Windowed mode supports , , and . and the are nearly equivalent (see the information regarding timer resolution below). They perform similarly to COPY_VSYNC in that there is only one present per frame, and they prevent tearing with beam-following. In contrast, will attempt to provide an unlimited presentation rate.

Full-screen mode supports similar usage as windowed mode by supporting regardless of the refresh rate or swap effect. uses the default system timer resolution whereas the calls timeBeginPeriod to enhance system timer resolution. This improves the quality of vertical sync, but consumes slightly more processing time. Both parameters attempt to synchronize vertically.

bb172585 D3DPRESENT_INTERVAL D3DPRESENT_INTERVAL
No documentation. bb172585 D3DPRESENT_INTERVAL_DEFAULT D3DPRESENT_INTERVAL_DEFAULT No documentation. bb172585 D3DPRESENT_INTERVAL_ONE D3DPRESENT_INTERVAL_ONE No documentation. bb172585 D3DPRESENT_INTERVAL_TWO D3DPRESENT_INTERVAL_TWO No documentation. bb172585 D3DPRESENT_INTERVAL_THREE D3DPRESENT_INTERVAL_THREE No documentation. bb172585 D3DPRESENT_INTERVAL_FOUR D3DPRESENT_INTERVAL_FOUR No documentation. bb172585 D3DPRESENT_INTERVAL_IMMEDIATE D3DPRESENT_INTERVAL_IMMEDIATE

Miscellaneous driver primitive capability flags.

bb172583 D3DPMISCCAPS D3DPMISCCAPS
No documentation. bb172583 D3DPMISCCAPS_MASKZ D3DPMISCCAPS_MASKZ No documentation. bb172583 D3DPMISCCAPS_CULLNONE D3DPMISCCAPS_CULLNONE No documentation. bb172583 D3DPMISCCAPS_CULLCW D3DPMISCCAPS_CULLCW No documentation. bb172583 D3DPMISCCAPS_CULLCCW D3DPMISCCAPS_CULLCCW No documentation. bb172583 D3DPMISCCAPS_COLORWRITEENABLE D3DPMISCCAPS_COLORWRITEENABLE No documentation. bb172583 D3DPMISCCAPS_CLIPPLANESCALEDPOINTS D3DPMISCCAPS_CLIPPLANESCALEDPOINTS No documentation. bb172583 D3DPMISCCAPS_CLIPTLVERTS D3DPMISCCAPS_CLIPTLVERTS No documentation. bb172583 D3DPMISCCAPS_TSSARGTEMP D3DPMISCCAPS_TSSARGTEMP No documentation. bb172583 D3DPMISCCAPS_BLENDOP D3DPMISCCAPS_BLENDOP No documentation. bb172583 D3DPMISCCAPS_NULLREFERENCE D3DPMISCCAPS_NULLREFERENCE No documentation. bb172583 D3DPMISCCAPS_INDEPENDENTWRITEMASKS D3DPMISCCAPS_INDEPENDENTWRITEMASKS No documentation. bb172583 D3DPMISCCAPS_PERSTAGECONSTANT D3DPMISCCAPS_PERSTAGECONSTANT No documentation. bb172583 D3DPMISCCAPS_FOGANDSPECULARALPHA D3DPMISCCAPS_FOGANDSPECULARALPHA No documentation. bb172583 D3DPMISCCAPS_SEPARATEALPHABLEND D3DPMISCCAPS_SEPARATEALPHABLEND No documentation. bb172583 D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS D3DPMISCCAPS_MRTINDEPENDENTBITDEPTHS No documentation. bb172583 D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING D3DPMISCCAPS_MRTPOSTPIXELSHADERBLENDING No documentation. bb172583 D3DPMISCCAPS_FOGVERTEXCLAMPED D3DPMISCCAPS_FOGVERTEXCLAMPED No documentation. bb172583 D3DPMISCCAPS_POSTBLENDSRGBCONVERT D3DPMISCCAPS_POSTBLENDSRGBCONVERT

Defines the primitives supported by Direct3D.

Using Triangle Strips or Triangle Fans (Direct3D 9) is often more efficient than using triangle lists because fewer vertices are duplicated.

bb172589 D3DPRIMITIVETYPE D3DPRIMITIVETYPE

Renders the vertices as a collection of isolated points. This value is unsupported for indexed primitives.

bb172589 D3DPT_POINTLIST D3DPT_POINTLIST

Renders the vertices as a list of isolated straight line segments.

bb172589 D3DPT_LINELIST D3DPT_LINELIST

Renders the vertices as a single polyline.

bb172589 D3DPT_LINESTRIP D3DPT_LINESTRIP

Renders the specified vertices as a sequence of isolated triangles. Each group of three vertices defines a separate triangle.

Back-face culling is affected by the current winding-order render state.

bb172589 D3DPT_TRIANGLELIST D3DPT_TRIANGLELIST

Renders the vertices as a triangle strip. The backface-culling flag is automatically flipped on even-numbered triangles.

bb172589 D3DPT_TRIANGLESTRIP D3DPT_TRIANGLESTRIP

Renders the vertices as a triangle fan.

bb172589 D3DPT_TRIANGLEFAN D3DPT_TRIANGLEFAN

Identifies the query type. For information about queries, see Queries (Direct3D 9)

bb172594 D3DQUERYTYPE D3DQUERYTYPE
No documentation. bb172594 D3DQUERYTYPE_VCACHE D3DQUERYTYPE_VCACHE No documentation. bb172594 D3DQUERYTYPE_RESOURCEMANAGER D3DQUERYTYPE_RESOURCEMANAGER No documentation. bb172594 D3DQUERYTYPE_VERTEXSTATS D3DQUERYTYPE_VERTEXSTATS No documentation. bb172594 D3DQUERYTYPE_EVENT D3DQUERYTYPE_EVENT No documentation. bb172594 D3DQUERYTYPE_OCCLUSION D3DQUERYTYPE_OCCLUSION No documentation. bb172594 D3DQUERYTYPE_TIMESTAMP D3DQUERYTYPE_TIMESTAMP No documentation. bb172594 D3DQUERYTYPE_TIMESTAMPDISJOINT D3DQUERYTYPE_TIMESTAMPDISJOINT No documentation. bb172594 D3DQUERYTYPE_TIMESTAMPFREQ D3DQUERYTYPE_TIMESTAMPFREQ No documentation. bb172594 D3DQUERYTYPE_PIPELINETIMINGS D3DQUERYTYPE_PIPELINETIMINGS No documentation. bb172594 D3DQUERYTYPE_INTERFACETIMINGS D3DQUERYTYPE_INTERFACETIMINGS No documentation. bb172594 D3DQUERYTYPE_VERTEXTIMINGS D3DQUERYTYPE_VERTEXTIMINGS No documentation. bb172594 D3DQUERYTYPE_PIXELTIMINGS D3DQUERYTYPE_PIXELTIMINGS No documentation. bb172594 D3DQUERYTYPE_BANDWIDTHTIMINGS D3DQUERYTYPE_BANDWIDTHTIMINGS No documentation. bb172594 D3DQUERYTYPE_CACHEUTILIZATION D3DQUERYTYPE_CACHEUTILIZATION No documentation. bb172594 D3DQUERYTYPE_MEMORYPRESSURE D3DQUERYTYPE_MEMORYPRESSURE

A programmable pixel shader is made up of a set of instructions that operate on pixel data. Registers transfer data in and out of the ALU. Additional control can be applied to modify the instruction, the results, or what data gets written out.

  • ps_3_0 Instructions contains a list of the available instructions.
  • ps_3_0 Registers lists the different types of registers used by the pixel shader ALU.
  • Modifiers Are used to modify the way an instruction works.
  • Destination Register Write Mask determines what components of the destination register get written.
  • Pixel Shader Source Register Modifiers alter the source register data before the instruction runs.
  • Source Register Swizzling gives additional control over which register components are read, copied, or written.
bb219845 D3DPRASTERCAPS D3DPRASTERCAPS
No documentation. bb219845 D3DPRASTERCAPS_DITHER D3DPRASTERCAPS_DITHER No documentation. bb219845 D3DPRASTERCAPS_ZTEST D3DPRASTERCAPS_ZTEST No documentation. bb219845 D3DPRASTERCAPS_FOGVERTEX D3DPRASTERCAPS_FOGVERTEX No documentation. bb219845 D3DPRASTERCAPS_FOGTABLE D3DPRASTERCAPS_FOGTABLE No documentation. bb219845 D3DPRASTERCAPS_MIPMAPLODBIAS D3DPRASTERCAPS_MIPMAPLODBIAS No documentation. bb219845 D3DPRASTERCAPS_ZBUFFERLESSHSR D3DPRASTERCAPS_ZBUFFERLESSHSR No documentation. bb219845 D3DPRASTERCAPS_FOGRANGE D3DPRASTERCAPS_FOGRANGE No documentation. bb219845 D3DPRASTERCAPS_ANISOTROPY D3DPRASTERCAPS_ANISOTROPY No documentation. bb219845 D3DPRASTERCAPS_WBUFFER D3DPRASTERCAPS_WBUFFER No documentation. bb219845 D3DPRASTERCAPS_WFOG D3DPRASTERCAPS_WFOG No documentation. bb219845 D3DPRASTERCAPS_ZFOG D3DPRASTERCAPS_ZFOG No documentation. bb219845 D3DPRASTERCAPS_COLORPERSPECTIVE D3DPRASTERCAPS_COLORPERSPECTIVE No documentation. bb219845 D3DPRASTERCAPS_SCISSORTEST D3DPRASTERCAPS_SCISSORTEST No documentation. bb219845 D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS D3DPRASTERCAPS_SLOPESCALEDEPTHBIAS No documentation. bb219845 D3DPRASTERCAPS_DEPTHBIAS D3DPRASTERCAPS_DEPTHBIAS No documentation. bb219845 D3DPRASTERCAPS_MULTISAMPLE_TOGGLE D3DPRASTERCAPS_MULTISAMPLE_TOGGLE

Data type of the register.

bb205424 D3DXREGISTER_SET D3DXREGISTER_SET

Boolean value.

bb205424 D3DXRS_BOOL D3DXRS_BOOL

4D integer number.

bb205424 D3DXRS_INT4 D3DXRS_INT4

4D floating-point number.

bb205424 D3DXRS_FLOAT4 D3DXRS_FLOAT4

The register contains 4D sampler data.

bb205424 D3DXRS_SAMPLER D3DXRS_SAMPLER

The enumerated type lists a variety of attributes, or render states. The enumerators of that are used exclusively by drivers can specify either rendering information or a texture attribute. The following render states are used by display drivers:

#define D3DRENDERSTATE_EVICTMANAGEDTEXTURES  61	
            #define D3DRENDERSTATE_SCENECAPTURE          62	
            #define D3DRS_DELETERTPATCH                  169	
            #define D3DRS_MAXVERTEXSHADERINST            196	
            #define D3DRS_MAXPIXELSHADERINST             197

Enumerators

D3DRENDERSTATE_EVICTMANAGEDTEXTURES

Determines whether textures are evicted from memory. The driver uses a data type without a default value to detect whether to evict.

This render state determines whether the driver evicts textures that it manages (as opposed to textures managed by the Direct3D runtime) from video memory. If the render state value is TRUE, the driver evicts the textures. Otherwise, the driver does not evict those textures.

D3DRENDERSTATE_SCENECAPTURE

Specifies either begin scene information or end scene information for geometric data captured within a frame. The driver uses a data type with a default value of TRUE to detect scene-capture information.

The driver responds to D3DRENDERSTATE_SCENECAPTURE first with TRUE for begin scene information and next with for end scene information to capture geometric data within a frame. See the permedia2 sample driver that ships with the Windows Driver Development Kit (DDK) for an example implementation. Using the D3DRENDERSTATE_SCENECAPTURE render state in a D3dDrawPrimitives2 call replaces the legacy D3DHALCallbacks->D3dSceneCapture callback routine.

Care must be taken in updating a driver that implements the legacy D3DHALCallbacks->D3dSceneCapture callback routine to one using the D3DRENDERSTATE_SCENECAPTURE render state. The D3dSceneCapture callback routine uses the constants D3DHAL_SCENE_CAPTURE_START and D3DHAL_SCENE_CAPTURE_END to indicate, respectively, the beginning and end of a scene. The values of these constants are, respectively, 0 and 1. If you use these constants in place of TRUE and in this render state, the meaning will be the exact opposite of what you intend.

D3DRS_DELETERTPATCH

DirectX 8.0 and later versions only.

Deletes either a rectangular or triangular patch from memory. The driver uses a DWORD data type without a default value to detect the patch to delete.

This render state notifies the driver that a patch is to be deleted. The value of this render state is the handle to the patch affected. All cached information should be freed and the handle should be removed from the driver's patch handle table. This render state is not visible to applications but is generated internally when an application calls the DeletePatch function. This render state is sent to the driver only when patches are deleted by DeletePatch explicitly. All other patches should be cleaned up when the device is destroyed.

D3DRS_MAXVERTEXSHADERINST

DirectX 9.0 and later versions only.

Determines the maximum number of instructions that the vertex shader assembler can execute.

The driver uses a DWORD data type with a default value of D3DINFINITEINSTRUCTIONS (0xffffffff) to report the maximum number of vertex-shader instructions. This maximum number depends on the version of the vertex shader that the display device supports as shown in the following table.

VersionMaximum number
earlier than 2_00
2_0 and laterFrom 216 (0x0000ffff) to D3DINFINITEINSTRUCTIONS

?

D3DINFINITEINSTRUCTIONS represents a virtually unlimited amount.

Valid values for this render state are numbers that are powers of 2; if the driver sets any other integer, the runtime uses the next nearest power of 2 number.

The runtime sets the MaxVShaderInstructionsExecuted member of the structure to this maximum number.

D3DRS_MAXPIXELSHADERINST

DirectX 9.0 and later versions only.

Determines the maximum number of instructions that the pixel shader assembler can execute.

The driver uses a DWORD data type with a default value of D3DINFINITEINSTRUCTIONS (0xffffffff) to report the maximum number of pixel-shader instructions. This maximum number depends on the version of the pixel shader that the display device supports as shown in the following table.

VersionMaximum number
earlier than 2_00
2_0From 96 to D3DINFINITEINSTRUCTIONS
3_0 and laterFrom 216 (0x0000ffff) to D3DINFINITEINSTRUCTIONS

?

D3DINFINITEINSTRUCTIONS represents a virtually unlimited amount.

Valid values for this render state are numbers that are powers of 2; if the driver sets any other integer, the runtime uses the next nearest power of 2 number.

The runtime sets the MaxVShaderInstructionsExecuted member of the structure to this maximum number.

The driver uses these render states when it performs graphics rendering. Only render states that are specific to drivers are included in the Windows Driver Kit (WDK) documentation. The render states accessible to DirectX applications are included in the DirectX SDK documentation. These application-level render states include such characteristics as whether alpha blending is enabled, whether dithering is enabled, whether Direct3D lighting is used, and the type of shading to be used.

To update a particular render state, Direct3D stores information about the render state, and then calls the driver's D3dDrawPrimitives2 callback routine. The information provided to the driver enables it to:

  • Determine that it should update one or more render states.

  • Identify which render states to update, and what the new render state values should be.

Note that for certain render states to be honored, the driver must have previously set capability flags in the relevant member of the D3DPRIMCAPS structure.

In order to indicate a specific render state update, Direct3D inserts a D3DHAL_DP2COMMAND structure into the command buffer, setting the bCommand member of this structure to D3DDP2OP_RENDERSTATE (see the description for D3DDP2OP_RENDERSTATE in D3DHAL_DP2OPERATION), and setting the wStateCount member of the same structure to the number of render states to be updated.

Immediately following the D3DHAL_DP2COMMAND structure, Direct3D inserts one D3DHAL_DP2RENDERSTATE structure into the command buffer for each render state to be updated. The RenderState member of this structure identifies the render state to be changed; the new value of this render state is specified in either the dwState member (for DWORD values) or the fState member (for D3DVALUE values).

The following figure shows a portion of the command buffer containing a D3DDP2OP_RENDERSTATE command and two D3DHAL_DP2RENDERSTATE structures. The first of the three structures indicates that two render states are to be updated. The second structure indicates that the D3DRENDERSTATE_FILLMODE render state is to be changed to . The third structure indicates that the D3DRENDERSTATE_SHADEMODE render state should be updated to .

Additional Notes

See the , , and D3DTEXTUREFILTER enumerated types in the DirectX SDK documentation for complete listings of all of the enabled render state types.

Some changes have been made to the enumerated type for DirectX 5.0 and beyond. D3DRENDERSTATE_BLENDENABLE has been removed completely although it is defined as D3DRENDERSTATE_ALPHABLENDENABLE in the d3dtypes.h header file. See D3DRENDERSTATE_COLORKEYENABLE for an explanation. The 128 integer values in the interval [128, 255] are reserved for texture coordinate wrap flags. These are constructed with the D3DWRAP_U and D3DWRAP_V macros. Using a flags word preserves forward compatibility with texture coordinates of higher dimension than 2D.

Multitexture macro ops and D3DRENDERSTATE_TEXTUREFACTOR override all of the per-texture stage blending controls (COLOR{OP,ARG1,ARG2} & ALPHA{OP,ARG1,ARG2}).

ff549036 D3DRENDERSTATETYPE D3DRENDERSTATETYPE

Determines whether textures are evicted from memory. The driver uses a data type without a default value to detect whether to evict.

This render state determines whether the driver evicts textures that it manages (as opposed to textures managed by the Direct3D runtime) from video memory. If the render state value is TRUE, the driver evicts the textures. Otherwise, the driver does not evict those textures.

ff549036 D3DRS_ZENABLE D3DRS_ZENABLE

Specifies either begin scene information or end scene information for geometric data captured within a frame. The driver uses a data type with a default value of TRUE to detect scene-capture information.

The driver responds to D3DRENDERSTATE_SCENECAPTURE first with TRUE for begin scene information and next with for end scene information to capture geometric data within a frame. See the permedia2 sample driver that ships with the Windows Driver Development Kit (DDK) for an example implementation. Using the D3DRENDERSTATE_SCENECAPTURE render state in a D3dDrawPrimitives2 call replaces the legacy D3DHALCallbacks->D3dSceneCapture callback routine.

Care must be taken in updating a driver that implements the legacy D3DHALCallbacks->D3dSceneCapture callback routine to one using the D3DRENDERSTATE_SCENECAPTURE render state. The D3dSceneCapture callback routine uses the constants D3DHAL_SCENE_CAPTURE_START and D3DHAL_SCENE_CAPTURE_END to indicate, respectively, the beginning and end of a scene. The values of these constants are, respectively, 0 and 1. If you use these constants in place of TRUE and in this render state, the meaning will be the exact opposite of what you intend.

ff549036 D3DRS_FILLMODE D3DRS_FILLMODE

DirectX 8.0 and later versions only.

Deletes either a rectangular or triangular patch from memory. The driver uses a DWORD data type without a default value to detect the patch to delete.

This render state notifies the driver that a patch is to be deleted. The value of this render state is the handle to the patch affected. All cached information should be freed and the handle should be removed from the driver's patch handle table. This render state is not visible to applications but is generated internally when an application calls the DeletePatch function. This render state is sent to the driver only when patches are deleted by DeletePatch explicitly. All other patches should be cleaned up when the device is destroyed.

ff549036 D3DRS_SHADEMODE D3DRS_SHADEMODE

DirectX 9.0 and later versions only.

Determines the maximum number of instructions that the vertex shader assembler can execute.

The driver uses a DWORD data type with a default value of D3DINFINITEINSTRUCTIONS (0xffffffff) to report the maximum number of vertex-shader instructions. This maximum number depends on the version of the vertex shader that the display device supports as shown in the following table.

VersionMaximum number
earlier than 2_00
2_0 and laterFrom 216 (0x0000ffff) to D3DINFINITEINSTRUCTIONS

?

D3DINFINITEINSTRUCTIONS represents a virtually unlimited amount.

Valid values for this render state are numbers that are powers of 2; if the driver sets any other integer, the runtime uses the next nearest power of 2 number.

The runtime sets the MaxVShaderInstructionsExecuted member of the structure to this maximum number.

ff549036 D3DRS_ZWRITEENABLE D3DRS_ZWRITEENABLE

DirectX 9.0 and later versions only.

Determines the maximum number of instructions that the pixel shader assembler can execute.

The driver uses a DWORD data type with a default value of D3DINFINITEINSTRUCTIONS (0xffffffff) to report the maximum number of pixel-shader instructions. This maximum number depends on the version of the pixel shader that the display device supports as shown in the following table.

VersionMaximum number
earlier than 2_00
2_0From 96 to D3DINFINITEINSTRUCTIONS
3_0 and laterFrom 216 (0x0000ffff) to D3DINFINITEINSTRUCTIONS

?

D3DINFINITEINSTRUCTIONS represents a virtually unlimited amount.

Valid values for this render state are numbers that are powers of 2; if the driver sets any other integer, the runtime uses the next nearest power of 2 number.

The runtime sets the MaxVShaderInstructionsExecuted member of the structure to this maximum number.

ff549036 D3DRS_ALPHATESTENABLE D3DRS_ALPHATESTENABLE
No documentation. ff549036 D3DRS_LASTPIXEL D3DRS_LASTPIXEL No documentation. ff549036 D3DRS_SRCBLEND D3DRS_SRCBLEND No documentation. ff549036 D3DRS_DESTBLEND D3DRS_DESTBLEND No documentation. ff549036 D3DRS_CULLMODE D3DRS_CULLMODE No documentation. ff549036 D3DRS_ZFUNC D3DRS_ZFUNC No documentation. ff549036 D3DRS_ALPHAREF D3DRS_ALPHAREF No documentation. ff549036 D3DRS_ALPHAFUNC D3DRS_ALPHAFUNC No documentation. ff549036 D3DRS_DITHERENABLE D3DRS_DITHERENABLE No documentation. ff549036 D3DRS_ALPHABLENDENABLE D3DRS_ALPHABLENDENABLE No documentation. ff549036 D3DRS_FOGENABLE D3DRS_FOGENABLE No documentation. ff549036 D3DRS_SPECULARENABLE D3DRS_SPECULARENABLE No documentation. ff549036 D3DRS_FOGCOLOR D3DRS_FOGCOLOR No documentation. ff549036 D3DRS_FOGTABLEMODE D3DRS_FOGTABLEMODE No documentation. ff549036 D3DRS_FOGSTART D3DRS_FOGSTART No documentation. ff549036 D3DRS_FOGEND D3DRS_FOGEND No documentation. ff549036 D3DRS_FOGDENSITY D3DRS_FOGDENSITY No documentation. ff549036 D3DRS_RANGEFOGENABLE D3DRS_RANGEFOGENABLE No documentation. ff549036 D3DRS_STENCILENABLE D3DRS_STENCILENABLE No documentation. ff549036 D3DRS_STENCILFAIL D3DRS_STENCILFAIL No documentation. ff549036 D3DRS_STENCILZFAIL D3DRS_STENCILZFAIL No documentation. ff549036 D3DRS_STENCILPASS D3DRS_STENCILPASS No documentation. ff549036 D3DRS_STENCILFUNC D3DRS_STENCILFUNC No documentation. ff549036 D3DRS_STENCILREF D3DRS_STENCILREF No documentation. ff549036 D3DRS_STENCILMASK D3DRS_STENCILMASK No documentation. ff549036 D3DRS_STENCILWRITEMASK D3DRS_STENCILWRITEMASK No documentation. ff549036 D3DRS_TEXTUREFACTOR D3DRS_TEXTUREFACTOR No documentation. ff549036 D3DRS_WRAP0 D3DRS_WRAP0 No documentation. ff549036 D3DRS_WRAP1 D3DRS_WRAP1 No documentation. ff549036 D3DRS_WRAP2 D3DRS_WRAP2 No documentation. ff549036 D3DRS_WRAP3 D3DRS_WRAP3 No documentation. ff549036 D3DRS_WRAP4 D3DRS_WRAP4 No documentation. ff549036 D3DRS_WRAP5 D3DRS_WRAP5 No documentation. ff549036 D3DRS_WRAP6 D3DRS_WRAP6 No documentation. ff549036 D3DRS_WRAP7 D3DRS_WRAP7 No documentation. ff549036 D3DRS_CLIPPING D3DRS_CLIPPING No documentation. ff549036 D3DRS_LIGHTING D3DRS_LIGHTING No documentation. ff549036 D3DRS_AMBIENT D3DRS_AMBIENT No documentation. ff549036 D3DRS_FOGVERTEXMODE D3DRS_FOGVERTEXMODE No documentation. ff549036 D3DRS_COLORVERTEX D3DRS_COLORVERTEX No documentation. ff549036 D3DRS_LOCALVIEWER D3DRS_LOCALVIEWER No documentation. ff549036 D3DRS_NORMALIZENORMALS D3DRS_NORMALIZENORMALS No documentation. ff549036 D3DRS_DIFFUSEMATERIALSOURCE D3DRS_DIFFUSEMATERIALSOURCE No documentation. ff549036 D3DRS_SPECULARMATERIALSOURCE D3DRS_SPECULARMATERIALSOURCE No documentation. ff549036 D3DRS_AMBIENTMATERIALSOURCE D3DRS_AMBIENTMATERIALSOURCE No documentation. ff549036 D3DRS_EMISSIVEMATERIALSOURCE D3DRS_EMISSIVEMATERIALSOURCE No documentation. ff549036 D3DRS_VERTEXBLEND D3DRS_VERTEXBLEND No documentation. ff549036 D3DRS_CLIPPLANEENABLE D3DRS_CLIPPLANEENABLE No documentation. ff549036 D3DRS_POINTSIZE D3DRS_POINTSIZE No documentation. ff549036 D3DRS_POINTSIZE_MIN D3DRS_POINTSIZE_MIN No documentation. ff549036 D3DRS_POINTSPRITEENABLE D3DRS_POINTSPRITEENABLE No documentation. ff549036 D3DRS_POINTSCALEENABLE D3DRS_POINTSCALEENABLE No documentation. ff549036 D3DRS_POINTSCALE_A D3DRS_POINTSCALE_A No documentation. ff549036 D3DRS_POINTSCALE_B D3DRS_POINTSCALE_B No documentation. ff549036 D3DRS_POINTSCALE_C D3DRS_POINTSCALE_C No documentation. ff549036 D3DRS_MULTISAMPLEANTIALIAS D3DRS_MULTISAMPLEANTIALIAS No documentation. ff549036 D3DRS_MULTISAMPLEMASK D3DRS_MULTISAMPLEMASK No documentation. ff549036 D3DRS_PATCHEDGESTYLE D3DRS_PATCHEDGESTYLE No documentation. ff549036 D3DRS_DEBUGMONITORTOKEN D3DRS_DEBUGMONITORTOKEN No documentation. ff549036 D3DRS_POINTSIZE_MAX D3DRS_POINTSIZE_MAX No documentation. ff549036 D3DRS_INDEXEDVERTEXBLENDENABLE D3DRS_INDEXEDVERTEXBLENDENABLE No documentation. ff549036 D3DRS_COLORWRITEENABLE D3DRS_COLORWRITEENABLE No documentation. ff549036 D3DRS_TWEENFACTOR D3DRS_TWEENFACTOR No documentation. ff549036 D3DRS_BLENDOP D3DRS_BLENDOP No documentation. ff549036 D3DRS_POSITIONDEGREE D3DRS_POSITIONDEGREE No documentation. ff549036 D3DRS_NORMALDEGREE D3DRS_NORMALDEGREE No documentation. ff549036 D3DRS_SCISSORTESTENABLE D3DRS_SCISSORTESTENABLE No documentation. ff549036 D3DRS_SLOPESCALEDEPTHBIAS D3DRS_SLOPESCALEDEPTHBIAS No documentation. ff549036 D3DRS_ANTIALIASEDLINEENABLE D3DRS_ANTIALIASEDLINEENABLE No documentation. ff549036 D3DRS_MINTESSELLATIONLEVEL D3DRS_MINTESSELLATIONLEVEL No documentation. ff549036 D3DRS_MAXTESSELLATIONLEVEL D3DRS_MAXTESSELLATIONLEVEL No documentation. ff549036 D3DRS_ADAPTIVETESS_X D3DRS_ADAPTIVETESS_X No documentation. ff549036 D3DRS_ADAPTIVETESS_Y D3DRS_ADAPTIVETESS_Y No documentation. ff549036 D3DRS_ADAPTIVETESS_Z D3DRS_ADAPTIVETESS_Z No documentation. ff549036 D3DRS_ADAPTIVETESS_W D3DRS_ADAPTIVETESS_W No documentation. ff549036 D3DRS_ENABLEADAPTIVETESSELLATION D3DRS_ENABLEADAPTIVETESSELLATION No documentation. ff549036 D3DRS_TWOSIDEDSTENCILMODE D3DRS_TWOSIDEDSTENCILMODE No documentation. ff549036 D3DRS_CCW_STENCILFAIL D3DRS_CCW_STENCILFAIL No documentation. ff549036 D3DRS_CCW_STENCILZFAIL D3DRS_CCW_STENCILZFAIL No documentation. ff549036 D3DRS_CCW_STENCILPASS D3DRS_CCW_STENCILPASS No documentation. ff549036 D3DRS_CCW_STENCILFUNC D3DRS_CCW_STENCILFUNC No documentation. ff549036 D3DRS_COLORWRITEENABLE1 D3DRS_COLORWRITEENABLE1 No documentation. ff549036 D3DRS_COLORWRITEENABLE2 D3DRS_COLORWRITEENABLE2 No documentation. ff549036 D3DRS_COLORWRITEENABLE3 D3DRS_COLORWRITEENABLE3 No documentation. ff549036 D3DRS_BLENDFACTOR D3DRS_BLENDFACTOR No documentation. ff549036 D3DRS_SRGBWRITEENABLE D3DRS_SRGBWRITEENABLE No documentation. ff549036 D3DRS_DEPTHBIAS D3DRS_DEPTHBIAS No documentation. ff549036 D3DRS_WRAP8 D3DRS_WRAP8 No documentation. ff549036 D3DRS_WRAP9 D3DRS_WRAP9 No documentation. ff549036 D3DRS_WRAP10 D3DRS_WRAP10 No documentation. ff549036 D3DRS_WRAP11 D3DRS_WRAP11 No documentation. ff549036 D3DRS_WRAP12 D3DRS_WRAP12 No documentation. ff549036 D3DRS_WRAP13 D3DRS_WRAP13 No documentation. ff549036 D3DRS_WRAP14 D3DRS_WRAP14 No documentation. ff549036 D3DRS_WRAP15 D3DRS_WRAP15 No documentation. ff549036 D3DRS_SEPARATEALPHABLENDENABLE D3DRS_SEPARATEALPHABLENDENABLE No documentation. ff549036 D3DRS_SRCBLENDALPHA D3DRS_SRCBLENDALPHA No documentation. ff549036 D3DRS_DESTBLENDALPHA D3DRS_DESTBLENDALPHA No documentation. ff549036 D3DRS_BLENDOPALPHA D3DRS_BLENDOPALPHA No documentation. D3DX_RESOURCE_RESIDENCY D3DX_RESOURCE_RESIDENCY No documentation. D3DX_RESOURCE_RESIDENCY_RESIDENT D3DX_RESOURCE_RESIDENCY_RESIDENT No documentation. D3DX_RESOURCE_RESIDENCY_RESIDENT_IN_SHARED_MEMORY D3DX_RESOURCE_RESIDENCY_RESIDENT_IN_SHARED_MEMORY No documentation. D3DX_RESOURCE_RESIDENCY_NOT_RESIDENT D3DX_RESOURCE_RESIDENCY_NOT_RESIDENT No documentation. D3DRESOURCETYPE D3DRESOURCETYPE No documentation. D3DRTYPE_SURFACE D3DRTYPE_SURFACE No documentation. D3DRTYPE_VOLUME D3DRTYPE_VOLUME No documentation. D3DRTYPE_TEXTURE D3DRTYPE_TEXTURE No documentation. D3DRTYPE_VOLUMETEXTURE D3DRTYPE_VOLUMETEXTURE No documentation. D3DRTYPE_CUBETEXTURE D3DRTYPE_CUBETEXTURE No documentation. D3DRTYPE_VERTEXBUFFER D3DRTYPE_VERTEXBUFFER No documentation. D3DRTYPE_INDEXBUFFER D3DRTYPE_INDEXBUFFER

Sampler states define texture sampling operations such as texture addressing and texture filtering. Some sampler states set-up vertex processing, and some set-up pixel processing. Sampler states can be saved and restored using stateblocks (see State Blocks Save and Restore State (Direct3D 9)).

bb172602 D3DSAMPLERSTATETYPE D3DSAMPLERSTATETYPE
No documentation. bb172602 D3DSAMP_ADDRESSU D3DSAMP_ADDRESSU No documentation. bb172602 D3DSAMP_ADDRESSV D3DSAMP_ADDRESSV No documentation. bb172602 D3DSAMP_ADDRESSW D3DSAMP_ADDRESSW No documentation. bb172602 D3DSAMP_BORDERCOLOR D3DSAMP_BORDERCOLOR No documentation. bb172602 D3DSAMP_MAGFILTER D3DSAMP_MAGFILTER No documentation. bb172602 D3DSAMP_MINFILTER D3DSAMP_MINFILTER No documentation. bb172602 D3DSAMP_MIPFILTER D3DSAMP_MIPFILTER No documentation. bb172602 D3DSAMP_MIPMAPLODBIAS D3DSAMP_MIPMAPLODBIAS No documentation. bb172602 D3DSAMP_MAXMIPLEVEL D3DSAMP_MAXMIPLEVEL No documentation. bb172602 D3DSAMP_MAXANISOTROPY D3DSAMP_MAXANISOTROPY No documentation. bb172602 D3DSAMP_SRGBTEXTURE D3DSAMP_SRGBTEXTURE No documentation. bb172602 D3DSAMP_ELEMENTINDEX D3DSAMP_ELEMENTINDEX No documentation. bb172602 D3DSAMP_DMAPOFFSET D3DSAMP_DMAPOFFSET

Defines the sampler texture types for vertex shaders.

bb172603 D3DSAMPLER_TEXTURE_TYPE D3DSAMPLER_TEXTURE_TYPE

Uninitialized value. The value of this element is D3DSP_TEXTURETYPE_SHIFT.

bb172603 D3DSTT_UNKNOWN D3DSTT_UNKNOWN

Declaring a 2D texture. The value of this element is D3DSP_TEXTURETYPE_SHIFT * 4.

bb172603 D3DSTT_2D D3DSTT_2D

Declaring a cube texture. The value of this element is D3DSP_TEXTURETYPE_SHIFT * 8.

bb172603 D3DSTT_CUBE D3DSTT_CUBE

Declaring a volume texture. The value of this element is D3DSP_TEXTURETYPE_SHIFT * 16.

bb172603 D3DSTT_VOLUME D3DSTT_VOLUME

Flags indicating the method the rasterizer uses to create an image on a surface.

This enumeration is used as a member in and .

bb172604 D3DSCANLINEORDERING D3DSCANLINEORDERING

The image is created from the first scanline to the last without skipping any.

bb172604 D3DSCANLINEORDERING_UNKNOWN D3DSCANLINEORDERING_UNKNOWN

The image is created using the interlaced method in which odd-numbered lines are drawn on odd-numbered passes and even lines are drawn on even-numbered passes.

bb172604 D3DSCANLINEORDERING_PROGRESSIVE D3DSCANLINEORDERING_PROGRESSIVE

The image is created using the interlaced method in which odd-numbered lines are drawn on odd-numbered passes and even lines are drawn on even-numbered passes.

bb172604 D3DSCANLINEORDERING_INTERLACED D3DSCANLINEORDERING_INTERLACED

The following page provides a basic outline of key differences between Direct3D 9 and Direct3D 10. The outline below provides some insight to assist developers with Direct3D 9 experience to explore and relate to Direct3D 10.

Although the info in this topic compares Direct3D 9 with Direct3D 10, because Direct3D 11 builds on the improvements made in Direct3D 10 and 10.1, you also need this info to migrate from Direct3D 9 to Direct3D 11. For info about moving beyond Direct3D 10 to Direct3D 11, see Migrating to Direct3D 11.

  • Overview
    • Removal
    • Device
  • Engine
    • Direct
  • Tricks
    • Overriding
    • Resolving
    • Simulating
  • Driving
    • Resource
    • Views
    • Static
    • Direct3D
    • HLSL
    • Shader
    • Creation
    • Shader
    • Input
    • Impact
    • Vertex
    • State
  • Porting
    • File
    • Mapping
  • Porting
    • Direct3D
    • Shader
    • HLSL
    • Constant
    • User
  • Additional
    • Integers
    • Mouse
    • Mapping
    • Reference
    • Test
    • StretchRect
  • Additional
  • Related
bb205073 D3DPSHADECAPS D3DPSHADECAPS
No documentation. bb205073 D3DPSHADECAPS_COLORGOURAUDRGB D3DPSHADECAPS_COLORGOURAUDRGB No documentation. bb205073 D3DPSHADECAPS_SPECULARGOURAUDRGB D3DPSHADECAPS_SPECULARGOURAUDRGB No documentation. bb205073 D3DPSHADECAPS_ALPHAGOURAUDBLEND D3DPSHADECAPS_ALPHAGOURAUDBLEND No documentation. bb205073 D3DPSHADECAPS_FOGGOURAUD D3DPSHADECAPS_FOGGOURAUD

Defines constants that describe the supported shading modes.

The first vertex of a triangle for flat shading mode is defined in the following manner.

  • For a triangle list, the first vertex of the triangle i is i * 3.
  • For a triangle strip, the first vertex of the triangle i is vertex i.
  • For a triangle fan, the first vertex of the triangle i is vertex i + 1.

The members of this enumerated type define the vales for the render state.

bb172605 D3DSHADEMODE D3DSHADEMODE

Flat shading mode. The color and specular component of the first vertex in the triangle are used to determine the color and specular component of the face. These colors remain constant across the triangle; that is, they are not interpolated. The specular alpha is interpolated. See Remarks.

bb172605 D3DSHADE_FLAT D3DSHADE_FLAT

Gouraud shading mode. The color and specular components of the face are determined by a linear interpolation between all three of the triangle's vertices.

bb172605 D3DSHADE_GOURAUD D3DSHADE_GOURAUD

Not supported.

bb172605 D3DSHADE_PHONG D3DSHADE_PHONG

The flags are used for parsing, compiling, or assembling shaders.

Parser flags

Parse time flags are only used by the effect system (before effect compilation) when you create an effect compiler. For example, you could create a compiler object with , and then use that compiler object repeatedly with different compiler flags to generate specialized code.

The effect system will use parser flags when called by the following functions:

  • CompileEffect

The effect system will use compiler flags when called by the following functions:

  • (or or )
  • CompileEffect (or CompileShader)

In addition, you can use compiler flags when creating an effect by calling (or or ).

  • If you pass in an uncompiled .fx file, the effect system will use the flag input parameter during compilation.
  • If you pass in a compiled effect, the effect system will ignore the compiler flags since they are not needed to load the effect.

The effect system will use assembler flags when called by the following functions:

Applying compiler flags or assembler flags to the incorrect API will fail shader validation. Check the Direct3D error code return value from the function (with the DirectX Error Lookup Tool) to help track down this error.

bb205441 D3DXSHADER D3DXSHADER
No documentation. bb205441 D3DXSHADER_DEBUG D3DXSHADER_DEBUG No documentation. bb205441 D3DXSHADER_SKIPVALIDATION D3DXSHADER_SKIPVALIDATION No documentation. bb205441 D3DXSHADER_SKIPOPTIMIZATION D3DXSHADER_SKIPOPTIMIZATION No documentation. bb205441 D3DXSHADER_PACKMATRIX_ROWMAJOR D3DXSHADER_PACKMATRIX_ROWMAJOR No documentation. bb205441 D3DXSHADER_PACKMATRIX_COLUMNMAJOR D3DXSHADER_PACKMATRIX_COLUMNMAJOR No documentation. bb205441 D3DXSHADER_PARTIALPRECISION D3DXSHADER_PARTIALPRECISION No documentation. bb205441 D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT D3DXSHADER_FORCE_VS_SOFTWARE_NOOPT No documentation. bb205441 D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT D3DXSHADER_FORCE_PS_SOFTWARE_NOOPT No documentation. bb205441 D3DXSHADER_NO_PRESHADER D3DXSHADER_NO_PRESHADER No documentation. bb205441 D3DXSHADER_AVOID_FLOW_CONTROL D3DXSHADER_AVOID_FLOW_CONTROL No documentation. bb205441 D3DXSHADER_PREFER_FLOW_CONTROL D3DXSHADER_PREFER_FLOW_CONTROL No documentation. bb205441 D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY D3DXSHADER_ENABLE_BACKWARDS_COMPATIBILITY No documentation. bb205441 D3DXSHADER_IEEE_STRICTNESS D3DXSHADER_IEEE_STRICTNESS No documentation. bb205441 D3DXSHADER_USE_LEGACY_D3DX9_31_DLL D3DXSHADER_USE_LEGACY_D3DX9_31_DLL No documentation. bb205441 D3DXSHADER_OPTIMIZATION_LEVEL0 D3DXSHADER_OPTIMIZATION_LEVEL0 No documentation. bb205441 D3DXSHADER_OPTIMIZATION_LEVEL1 D3DXSHADER_OPTIMIZATION_LEVEL1 No documentation. bb205441 D3DXSHADER_OPTIMIZATION_LEVEL2 D3DXSHADER_OPTIMIZATION_LEVEL2 No documentation. bb205441 D3DXSHADER_OPTIMIZATION_LEVEL3 D3DXSHADER_OPTIMIZATION_LEVEL3 None. None None

The following flags are used to specify sprite rendering options to the flags parameter in the Begin method:

bb205466 D3DXSPRITE D3DXSPRITE
No documentation. bb205466 D3DXSPRITE_DONOTSAVESTATE D3DXSPRITE_DONOTSAVESTATE No documentation. bb205466 D3DXSPRITE_DONOTMODIFY_RENDERSTATE D3DXSPRITE_DONOTMODIFY_RENDERSTATE No documentation. bb205466 D3DXSPRITE_OBJECTSPACE D3DXSPRITE_OBJECTSPACE No documentation. bb205466 D3DXSPRITE_BILLBOARD D3DXSPRITE_BILLBOARD No documentation. bb205466 D3DXSPRITE_ALPHABLEND D3DXSPRITE_ALPHABLEND No documentation. bb205466 D3DXSPRITE_SORT_TEXTURE D3DXSPRITE_SORT_TEXTURE No documentation. bb205466 D3DXSPRITE_SORT_DEPTH_FRONTTOBACK D3DXSPRITE_SORT_DEPTH_FRONTTOBACK No documentation. bb205466 D3DXSPRITE_SORT_DEPTH_BACKTOFRONT D3DXSPRITE_SORT_DEPTH_BACKTOFRONT No documentation. bb205466 D3DXSPRITE_DO_NOT_ADDREF_TEXTURE D3DXSPRITE_DO_NOT_ADDREF_TEXTURE None. None None

Predefined sets of pipeline state used by state blocks (see State Blocks Save and Restore State (Direct3D 9)).

As the following diagram shows, vertex and pixel state are both subsets of device state.

There are only a few states that are considered both vertex and pixel state. These states are:

  • Render state:
  • Render state:
  • Render state:
  • Texture state:
  • Texture state:
bb172608 D3DSTATEBLOCKTYPE D3DSTATEBLOCKTYPE
No documentation. bb172608 D3DSBT_ALL D3DSBT_ALL No documentation. bb172608 D3DSBT_PIXELSTATE D3DSBT_PIXELSTATE No documentation. bb172608 D3DSBT_VERTEXSTATE D3DSBT_VERTEXSTATE

Driver stencil capability flags.

bb172609 D3DSTENCILCAPS D3DSTENCILCAPS
No documentation. bb172609 D3DSTENCILCAPS_KEEP D3DSTENCILCAPS_KEEP No documentation. bb172609 D3DSTENCILCAPS_ZERO D3DSTENCILCAPS_ZERO No documentation. bb172609 D3DSTENCILCAPS_REPLACE D3DSTENCILCAPS_REPLACE No documentation. bb172609 D3DSTENCILCAPS_INCRSAT D3DSTENCILCAPS_INCRSAT No documentation. bb172609 D3DSTENCILCAPS_DECRSAT D3DSTENCILCAPS_DECRSAT No documentation. bb172609 D3DSTENCILCAPS_INVERT D3DSTENCILCAPS_INVERT No documentation. bb172609 D3DSTENCILCAPS_INCR D3DSTENCILCAPS_INCR No documentation. bb172609 D3DSTENCILCAPS_DECR D3DSTENCILCAPS_DECR No documentation. bb172609 D3DSTENCILCAPS_TWOSIDED D3DSTENCILCAPS_TWOSIDED

Defines stencil-buffer operations.

Stencil-buffer entries are integer values ranging from 0 through 2n - 1, where n is the bit depth of the stencil buffer.

bb172610 D3DSTENCILOP D3DSTENCILOP

Do not update the entry in the stencil buffer. This is the default value.

bb172610 D3DSTENCILOP_KEEP D3DSTENCILOP_KEEP

Set the stencil-buffer entry to 0.

bb172610 D3DSTENCILOP_ZERO D3DSTENCILOP_ZERO

Replace the stencil-buffer entry with a reference value.

bb172610 D3DSTENCILOP_REPLACE D3DSTENCILOP_REPLACE

Increment the stencil-buffer entry, clamping to the maximum value.

bb172610 D3DSTENCILOP_INCRSAT D3DSTENCILOP_INCRSAT

Decrement the stencil-buffer entry, clamping to zero.

bb172610 D3DSTENCILOP_DECRSAT D3DSTENCILOP_DECRSAT

Invert the bits in the stencil-buffer entry.

bb172610 D3DSTENCILOP_INVERT D3DSTENCILOP_INVERT

Increment the stencil-buffer entry, wrapping to zero if the new value exceeds the maximum value.

bb172610 D3DSTENCILOP_INCR D3DSTENCILOP_INCR

Decrement the stencil-buffer entry, wrapping to the maximum value if the new value is less than zero.

bb172610 D3DSTENCILOP_DECR D3DSTENCILOP_DECR

Given a scene that contains many objects that use the same geometry, you can draw many instances of that geometry at different orientations, sizes, colors, and so on with dramatically better performance by reducing the amount of data you need to supply to the renderer.

This can be accomplished through the use of two techniques: the first for drawing indexed geometry and the second for non-indexed geometry. Both techniques use two vertex buffers: one to supply geometry data and one to supply per-object instance data. The instance data can be a wide variety of information such as a transform, color data, or lighting data - basically anything that you can describe in a vertex declaration. Drawing many instances of geometry with these techniques can dramatically reduce the amount of data sent to the renderer.

  • Drawing
    • Indexed
  • Drawing
    • Non-Indexed
  • Related
bb173349 D3DSTREAMSOURCE D3DSTREAMSOURCE
No documentation. bb173349 D3DSTREAMSOURCE_INDEXEDDATA D3DSTREAMSOURCE_INDEXEDDATA No documentation. bb173349 D3DSTREAMSOURCE_INSTANCEDATA D3DSTREAMSOURCE_INSTANCEDATA

Defines swap effects.

The state of the back buffer after a call to Present is well-defined by each of these swap effects, and whether the Direct3D device was created with a full-screen swap chain or a windowed swap chain has no effect on this state. In particular, the swap effect operates the same whether windowed or full-screen, and the Direct3D runtime guarantees this by creating extra buffers. As a result, it is recommended that applications use whenever possible to avoid any such penalties. This is because this swap effect will always be the most efficient in terms of memory consumption and performance.

Applications that use or should not expect full-screen destination alpha to work. This means that the render state will not work as expected because full-screen swap chains with these swap effects do not have an explicit pixel format from the driver's point of view. The driver infers that they should take on the display format, which does not have an alpha channel. To work around this, take the following steps:

  • Use .
  • Check the flag in the Caps3 member of the structure. This flag indicates whether the driver can do alpha blending when or is used.
  • Applications using flip mode swap effect () should call PresentEx after a window resize or region change to ensure that the display content is updated.

An invisible window cannot receive user-mode events; furthermore, an invisible-fullscreen window will interfere with the presentation of another applications' windowed-mode window. Therefore, each application needs to ensure that a device window is visible when a swapchain is presented in fullscreen mode.

bb172612 D3DSWAPEFFECT D3DSWAPEFFECT

When a swap chain is created with a swap effect of or , the runtime will guarantee that an operation will not affect the content of any of the back buffers. Unfortunately, meeting this guarantee can involve substantial video memory or processing overheads, especially when implementing flip semantics for a windowed swap chain or copy semantics for a full-screen swap chain. An application may use the swap effect to avoid these overheads and to enable the display driver to select the most efficient presentation technique for the swap chain. This is also the only swap effect that may be used when specifying a value other than for the MultiSampleType member of .

Like a swap chain that uses , a swap chain that uses might include more than one back buffer, any of which may be accessed using or . The swap chain is best envisaged as a queue in which 0 always indexes the back buffer that will be displayed by the next Present operation and from which buffers are discarded when they have been displayed.

An application that uses this swap effect cannot make any assumptions about the contents of a discarded back buffer and should therefore update an entire back buffer before invoking a Present operation that would display it. Although this is not enforced, the debug version of the runtime will overwrite the contents of discarded back buffers with random data to enable developers to verify that their applications are updating the entire back buffer surfaces correctly.

bb172612 D3DSWAPEFFECT_DISCARD D3DSWAPEFFECT_DISCARD

The swap chain might include multiple back buffers and is best envisaged as a circular queue that includes the front buffer. Within this queue, the back buffers are always numbered sequentially from 0 to (n - 1), where n is the number of back buffers, so that 0 denotes the least recently presented buffer. When Present is invoked, the queue is "rotated" so that the front buffer becomes back buffer (n - 1), while the back buffer 0 becomes the new front buffer.

bb172612 D3DSWAPEFFECT_FLIP D3DSWAPEFFECT_FLIP

This swap effect may be specified only for a swap chain comprising a single back buffer. Whether the swap chain is windowed or full-screen, the runtime will guarantee the semantics implied by a copy-based Present operation, namely that the operation leaves the content of the back buffer unchanged, instead of replacing it with the content of the front buffer as a flip-based Present operation would.

For a full-screen swap chain, the runtime uses a combination of flip operations and copy operations, supported if necessary by hidden back buffers, to accomplish the Present operation. Accordingly, the presentation is synchronized with the display adapter's vertical retrace and its rate is constrained by the chosen presentation interval. A swap chain specified with the flag is the only exception. (Refer to the description of the PresentationIntervals member of the structure.) In this case, a Present operation copies the back buffer content directly to the front buffer without waiting for the vertical retrace.

bb172612 D3DSWAPEFFECT_COPY D3DSWAPEFFECT_COPY

Use a dedicated area of video memory that can be overlayed on the primary surface. No copy is performed when the overlay is displayed. The overlay operation is performed in hardware, without modifying the data in the primary surface.

Differences between Direct3D 9 and Direct3D 9Ex:

is only available in Direct3D9Ex running on Windows 7 (or more current operating system).

?

bb172612 D3DSWAPEFFECT_OVERLAY D3DSWAPEFFECT_OVERLAY

Designates when an application is adopting flip mode, during which time an application's frame is passed instead of copied to the Desktop Window Manager(DWM) for composition when the application is presenting in windowed mode. Flip mode allows an application to more efficiently use memory bandwidth as well as enabling an application to take advantage of full-screen-present statistics. Flip mode does not affect full-screen behavior. A sample application that uses and is the D3D9ExFlipEx sample on the MSDN Code Gallery.

Note??If you create a swap chain with , you can't override the hDeviceWindow member of the structure when you present a new frame for display. That is, you must pass null to the hDestWindowOverride parameter of to instruct the runtime to use the hDeviceWindow member of for the presentation.

Differences between Direct3D 9 and Direct3D 9Ex:

is only available in Direct3D9Ex running on Windows 7 (or more current operating system).

?

bb172612 D3DSWAPEFFECT_FLIPEX D3DSWAPEFFECT_FLIPEX

Defines settings used for mesh tangent frame computations.

bb205467 D3DXTANGENT D3DXTANGENT

Texture coordinate values in the u direction are between 0 and 1. In this case a texture coordinate set will be chosen that minimizes the perimeter of the triangle. See Texture Wrapping (Direct3D 9).

bb205467 D3DXTANGENT_WRAP_U D3DXTANGENT_WRAP_U

Texture coordinate values in the v direction are between 0 and 1. In this case a texture coordinate set will be chosen that minimizes the perimeter of the triangle. See Texture Wrapping (Direct3D 9).

bb205467 D3DXTANGENT_WRAP_V D3DXTANGENT_WRAP_V

Texture coordinate values in both u and v directions are between 0 and 1. In this case a texture coordinate set will be chosen that minimizes the perimeter of the triangle. See Texture Wrapping (Direct3D 9).

bb205467 D3DXTANGENT_WRAP_UV D3DXTANGENT_WRAP_UV

Do not normalize partial derivatives with respect to texture coordinates. If not normalized, the scale of the partial derivatives is proportional to the scale of the 3D model divided by the scale of the triangle in (u, v) space. This scale value provides a measure of how much the texture is stretched in a given direction. The resulting vector length is a weighted sum of the lengths of the partial derivatives.

bb205467 D3DXTANGENT_DONT_NORMALIZE_PARTIALS D3DXTANGENT_DONT_NORMALIZE_PARTIALS

Do not transform texture coordinates to orthogonal Cartesian coordinates. Mutually exclusive with and .

bb205467 D3DXTANGENT_DONT_ORTHOGONALIZE D3DXTANGENT_DONT_ORTHOGONALIZE

Compute the partial derivative with respect to texture coordinate v independently for each vertex, and then compute the partial derivative with respect to u as the cross product of the partial derivative with respect to v and the normal vector. Mutually exclusive with and .

bb205467 D3DXTANGENT_ORTHOGONALIZE_FROM_V D3DXTANGENT_ORTHOGONALIZE_FROM_V

Compute the partial derivative with respect to texture coordinate u independently for each vertex, and then compute the partial derivative with respect to v as the cross product of the normal vector and the partial derivative with respect to u. Mutually exclusive with and .

bb205467 D3DXTANGENT_ORTHOGONALIZE_FROM_U D3DXTANGENT_ORTHOGONALIZE_FROM_U

Weight the direction of the computed per-vertex normal or partial derivative vector according to the areas of triangles attached to that vertex. Mutually exclusive with .

bb205467 D3DXTANGENT_WEIGHT_BY_AREA D3DXTANGENT_WEIGHT_BY_AREA

Compute a unit-length normal vector for each triangle of the input mesh. Mutually exclusive with .

bb205467 D3DXTANGENT_WEIGHT_EQUAL D3DXTANGENT_WEIGHT_EQUAL

Vertices are ordered in a clockwise direction around each triangle. The computed normal vector direction is therefore inverted 180 degrees from the direction computed using counterclockwise vertex ordering.

bb205467 D3DXTANGENT_WIND_CW D3DXTANGENT_WIND_CW

Compute the per-vertex normal vector for each triangle of the input mesh, and ignore any normal vectors already in the input mesh.

bb205467 D3DXTANGENT_CALCULATE_NORMALS D3DXTANGENT_CALCULATE_NORMALS

The results are stored in the original input mesh, and the output mesh is not used.

bb205467 D3DXTANGENT_GENERATE_IN_PLACE D3DXTANGENT_GENERATE_IN_PLACE
None. None None

Defines constants that describe the supported texture-addressing modes.

bb172614 D3DTEXTUREADDRESS D3DTEXTUREADDRESS

Tile the texture at every integer junction. For example, for u values between 0 and 3, the texture is repeated three times; no mirroring is performed.

bb172614 D3DTADDRESS_WRAP D3DTADDRESS_WRAP

Similar to , except that the texture is flipped at every integer junction. For u values between 0 and 1, for example, the texture is addressed normally; between 1 and 2, the texture is flipped (mirrored); between 2 and 3, the texture is normal again; and so on.

bb172614 D3DTADDRESS_MIRROR D3DTADDRESS_MIRROR

Texture coordinates outside the range [0.0, 1.0] are set to the texture color at 0.0 or 1.0, respectively.

bb172614 D3DTADDRESS_CLAMP D3DTADDRESS_CLAMP

Texture coordinates outside the range [0.0, 1.0] are set to the border color.

bb172614 D3DTADDRESS_BORDER D3DTADDRESS_BORDER

Similar to and . Takes the absolute value of the texture coordinate (thus, mirroring around 0), and then clamps to the maximum value. The most common usage is for volume textures, where support for the full texture-addressing mode is not necessary, but the data is symmetric around the one axis.

bb172614 D3DTADDRESS_MIRRORONCE D3DTADDRESS_MIRRORONCE

A programmable pixel shader is made up of a set of instructions that operate on pixel data. Registers transfer data in and out of the ALU. Additional control can be applied to modify the instruction, the results, or what data gets written out.

  • ps_3_0 Instructions contains a list of the available instructions.
  • ps_3_0 Registers lists the different types of registers used by the pixel shader ALU.
  • Modifiers Are used to modify the way an instruction works.
  • Destination Register Write Mask determines what components of the destination register get written.
  • Pixel Shader Source Register Modifiers alter the source register data before the instruction runs.
  • Source Register Swizzling gives additional control over which register components are read, copied, or written.
bb219845 D3DPTADDRESSCAPS D3DPTADDRESSCAPS
No documentation. bb219845 D3DPTADDRESSCAPS_WRAP D3DPTADDRESSCAPS_WRAP No documentation. bb219845 D3DPTADDRESSCAPS_MIRROR D3DPTADDRESSCAPS_MIRROR No documentation. bb219845 D3DPTADDRESSCAPS_CLAMP D3DPTADDRESSCAPS_CLAMP No documentation. bb219845 D3DPTADDRESSCAPS_BORDER D3DPTADDRESSCAPS_BORDER No documentation. bb219845 D3DPTADDRESSCAPS_INDEPENDENTUV D3DPTADDRESSCAPS_INDEPENDENTUV No documentation. bb219845 D3DPTADDRESSCAPS_MIRRORONCE D3DPTADDRESSCAPS_MIRRORONCE

Texture argument constants are used as values for the following members of the enumerated type:

Set and retrieve texture arguments by calling the SetTextureStageState and GetTextureStageState methods.

Argument flags

You can combine an argument flag with a modifier, but two argument flags cannot be combined.

bb172613 D3DTA D3DTA
No documentation. bb172613 D3DTA_SELECTMASK D3DTA_SELECTMASK No documentation. bb172613 D3DTA_DIFFUSE D3DTA_DIFFUSE No documentation. bb172613 D3DTA_CURRENT D3DTA_CURRENT No documentation. bb172613 D3DTA_TEXTURE D3DTA_TEXTURE No documentation. bb172613 D3DTA_TFACTOR D3DTA_TFACTOR No documentation. bb172613 D3DTA_SPECULAR D3DTA_SPECULAR No documentation. bb172613 D3DTA_TEMP D3DTA_TEMP No documentation. bb172613 D3DTA_CONSTANT D3DTA_CONSTANT No documentation. bb172613 D3DTA_COMPLEMENT D3DTA_COMPLEMENT No documentation. bb172613 D3DTA_ALPHAREPLICATE D3DTA_ALPHAREPLICATE

A programmable pixel shader is made up of a set of instructions that operate on pixel data. Registers transfer data in and out of the ALU. Additional control can be applied to modify the instruction, the results, or what data gets written out.

  • ps_3_0 Instructions contains a list of the available instructions.
  • ps_3_0 Registers lists the different types of registers used by the pixel shader ALU.
  • Modifiers Are used to modify the way an instruction works.
  • Destination Register Write Mask determines what components of the destination register get written.
  • Pixel Shader Source Register Modifiers alter the source register data before the instruction runs.
  • Source Register Swizzling gives additional control over which register components are read, copied, or written.
bb219845 D3DPTEXTURECAPS D3DPTEXTURECAPS
No documentation. bb219845 D3DPTEXTURECAPS_PERSPECTIVE D3DPTEXTURECAPS_PERSPECTIVE No documentation. bb219845 D3DPTEXTURECAPS_POW2 D3DPTEXTURECAPS_POW2 No documentation. bb219845 D3DPTEXTURECAPS_ALPHA D3DPTEXTURECAPS_ALPHA No documentation. bb219845 D3DPTEXTURECAPS_SQUAREONLY D3DPTEXTURECAPS_SQUAREONLY No documentation. bb219845 D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE D3DPTEXTURECAPS_TEXREPEATNOTSCALEDBYSIZE No documentation. bb219845 D3DPTEXTURECAPS_ALPHAPALETTE D3DPTEXTURECAPS_ALPHAPALETTE No documentation. bb219845 D3DPTEXTURECAPS_NONPOW2CONDITIONAL D3DPTEXTURECAPS_NONPOW2CONDITIONAL No documentation. bb219845 D3DPTEXTURECAPS_PROJECTED D3DPTEXTURECAPS_PROJECTED No documentation. bb219845 D3DPTEXTURECAPS_CUBEMAP D3DPTEXTURECAPS_CUBEMAP No documentation. bb219845 D3DPTEXTURECAPS_VOLUMEMAP D3DPTEXTURECAPS_VOLUMEMAP No documentation. bb219845 D3DPTEXTURECAPS_MIPMAP D3DPTEXTURECAPS_MIPMAP No documentation. bb219845 D3DPTEXTURECAPS_MIPVOLUMEMAP D3DPTEXTURECAPS_MIPVOLUMEMAP No documentation. bb219845 D3DPTEXTURECAPS_MIPCUBEMAP D3DPTEXTURECAPS_MIPCUBEMAP No documentation. bb219845 D3DPTEXTURECAPS_CUBEMAP_POW2 D3DPTEXTURECAPS_CUBEMAP_POW2 No documentation. bb219845 D3DPTEXTURECAPS_VOLUMEMAP_POW2 D3DPTEXTURECAPS_VOLUMEMAP_POW2 No documentation. bb219845 D3DPTEXTURECAPS_NOPROJECTEDBUMPENV D3DPTEXTURECAPS_NOPROJECTEDBUMPENV

Driver texture coordinate capability flags.

bb172621 D3DTSS_TCI D3DTSS_TCI
No documentation. bb172621 D3DTSS_TCI_PASSTHRU D3DTSS_TCI_PASSTHRU No documentation. bb172621 D3DTSS_TCI_CAMERASPACENORMAL D3DTSS_TCI_CAMERASPACENORMAL No documentation. bb172621 D3DTSS_TCI_CAMERASPACEPOSITION D3DTSS_TCI_CAMERASPACEPOSITION No documentation. bb172621 D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR D3DTSS_TCI_CAMERASPACEREFLECTIONVECTOR No documentation. bb172621 D3DTSS_TCI_SPHEREMAP D3DTSS_TCI_SPHEREMAP

Defines texture filtering modes for a texture stage.

is used by along with to define texture filtering modes for a texture stage.

To check if a format supports texture filter types other than (which is always supported), call with .

Set a texture stage's magnification filter by calling with the value as the second parameter and one member of this enumeration as the third parameter.

Set a texture stage's minification filter by calling with the value as the second parameter and one member of this enumeration as the third parameter.

Set the texture filter to use between-mipmap levels by calling with the value as the second parameter and one member of this enumeration as the third parameter.

Not all valid filtering modes for a device will apply to volume maps. In general, and magnification filters will be supported for volume maps. If is set, then the mipmap filter and and minification filters will be supported for volume maps. The device may or may not support the mipmap filter for volume maps. Devices that support anisotropic filtering for 2D maps do not necessarily support anisotropic filtering for volume maps. However, applications that enable anisotropic filtering will receive the best available filtering (probably linear) if anisotropic filtering is not supported.

bb172615 D3DTEXTUREFILTERTYPE D3DTEXTUREFILTERTYPE

When used with , disables mipmapping.

bb172615 D3DTEXF_NONE D3DTEXF_NONE

When used with D3DSAMP_ MAGFILTER or , specifies that point filtering is to be used as the texture magnification or minification filter respectively. When used with , enables mipmapping and specifies that the rasterizer chooses the color from the texel of the nearest mip level.

bb172615 D3DTEXF_POINT D3DTEXF_POINT

When used with D3DSAMP_ MAGFILTER or , specifies that linear filtering is to be used as the texture magnification or minification filter respectively. When used with , enables mipmapping and trilinear filtering; it specifies that the rasterizer interpolates between the two nearest mip levels.

bb172615 D3DTEXF_LINEAR D3DTEXF_LINEAR

When used with D3DSAMP_ MAGFILTER or , specifies that anisotropic texture filtering used as a texture magnification or minification filter respectively. Compensates for distortion caused by the difference in angle between the texture polygon and the plane of the screen. Use with is undefined.

bb172615 D3DTEXF_ANISOTROPIC D3DTEXF_ANISOTROPIC

A 4-sample tent filter used as a texture magnification or minification filter. Use with is undefined.

bb172615 D3DTEXF_PYRAMIDALQUAD D3DTEXF_PYRAMIDALQUAD

A 4-sample Gaussian filter used as a texture magnification or minification filter. Use with is undefined.

bb172615 D3DTEXF_GAUSSIANQUAD D3DTEXF_GAUSSIANQUAD

Convolution filter for monochrome textures. See .

Differences between Direct3D 9 and Direct3D 9Ex:

This flag is available in Direct3D 9Ex only.

?

Use with is undefined.

bb172615 D3DTEXF_CONVOLUTIONMONO D3DTEXF_CONVOLUTIONMONO

Defines per-stage texture-blending operations.

The members of this type are used when setting color or alpha operations by using the or values with the method.

In the above formulas, SRGBA is the RGBA color produced by a texture operation, and Arg1, Arg2, and Arg3 represent the complete RGBA color of the texture arguments. Individual components of an argument are shown with subscripts. For example, the alpha component for argument 1 would be shown as Arg1A.

bb172616 D3DTEXTUREOP D3DTEXTUREOP

Disables output from this texture stage and all stages with a higher index. To disable texture mapping, set this as the color operation for the first texture stage (stage 0). Alpha operations cannot be disabled when color operations are enabled. Setting the alpha operation to when color blending is enabled causes undefined behavior.

bb172616 D3DTOP_DISABLE D3DTOP_DISABLE

Use this texture stage's first color or alpha argument, unmodified, as the output. This operation affects the color argument when used with the texture-stage state, and the alpha argument when used with .

bb172616 D3DTOP_SELECTARG1 D3DTOP_SELECTARG1

Use this texture stage's second color or alpha argument, unmodified, as the output. This operation affects the color argument when used with the texture stage state, and the alpha argument when used with .

bb172616 D3DTOP_SELECTARG2 D3DTOP_SELECTARG2

Multiply the components of the arguments.

bb172616 D3DTOP_MODULATE D3DTOP_MODULATE

Multiply the components of the arguments, and shift the products to the left 1 bit (effectively multiplying them by 2) for brightening.

bb172616 D3DTOP_MODULATE2X D3DTOP_MODULATE2X

Multiply the components of the arguments, and shift the products to the left 2 bits (effectively multiplying them by 4) for brightening.

bb172616 D3DTOP_MODULATE4X D3DTOP_MODULATE4X

Add the components of the arguments.

bb172616 D3DTOP_ADD D3DTOP_ADD

Add the components of the arguments with a - 0.5 bias, making the effective range of values from - 0.5 through 0.5.

bb172616 D3DTOP_ADDSIGNED D3DTOP_ADDSIGNED

Add the components of the arguments with a - 0.5 bias, and shift the products to the left 1 bit.

bb172616 D3DTOP_ADDSIGNED2X D3DTOP_ADDSIGNED2X

Subtract the components of the second argument from those of the first argument.

bb172616 D3DTOP_SUBTRACT D3DTOP_SUBTRACT

Add the first and second arguments; then subtract their product from the sum.

bb172616 D3DTOP_ADDSMOOTH D3DTOP_ADDSMOOTH

Linearly blend this texture stage, using the interpolated alpha from each vertex.

bb172616 D3DTOP_BLENDDIFFUSEALPHA D3DTOP_BLENDDIFFUSEALPHA

Linearly blend this texture stage, using the alpha from this stage's texture.

bb172616 D3DTOP_BLENDTEXTUREALPHA D3DTOP_BLENDTEXTUREALPHA

Linearly blend this texture stage, using a scalar alpha set with the render state.

bb172616 D3DTOP_BLENDFACTORALPHA D3DTOP_BLENDFACTORALPHA

Linearly blend a texture stage that uses a premultiplied alpha.

bb172616 D3DTOP_BLENDTEXTUREALPHAPM D3DTOP_BLENDTEXTUREALPHAPM

Linearly blend this texture stage, using the alpha taken from the previous texture stage.

bb172616 D3DTOP_BLENDCURRENTALPHA D3DTOP_BLENDCURRENTALPHA

is set in stage n. The output of stage n is arg1. Additionally, if there is a texture in stage n + 1, any in stage n + 1 is premultiplied by texture in stage n + 1.

bb172616 D3DTOP_PREMODULATE D3DTOP_PREMODULATE

Modulate the color of the second argument, using the alpha of the first argument; then add the result to argument one. This operation is supported only for color operations ().

bb172616 D3DTOP_MODULATEALPHA_ADDCOLOR D3DTOP_MODULATEALPHA_ADDCOLOR

Modulate the arguments; then add the alpha of the first argument. This operation is supported only for color operations ().

bb172616 D3DTOP_MODULATECOLOR_ADDALPHA D3DTOP_MODULATECOLOR_ADDALPHA

Similar to , but use the inverse of the alpha of the first argument. This operation is supported only for color operations ().

bb172616 D3DTOP_MODULATEINVALPHA_ADDCOLOR D3DTOP_MODULATEINVALPHA_ADDCOLOR

Similar to , but use the inverse of the color of the first argument. This operation is supported only for color operations ().

bb172616 D3DTOP_MODULATEINVCOLOR_ADDALPHA D3DTOP_MODULATEINVCOLOR_ADDALPHA

Perform per-pixel bump mapping, using the environment map in the next texture stage, without luminance. This operation is supported only for color operations ().

bb172616 D3DTOP_BUMPENVMAP D3DTOP_BUMPENVMAP

Perform per-pixel bump mapping, using the environment map in the next texture stage, with luminance. This operation is supported only for color operations ().

bb172616 D3DTOP_BUMPENVMAPLUMINANCE D3DTOP_BUMPENVMAPLUMINANCE

Modulate the components of each argument as signed components, add their products; then replicate the sum to all color channels, including alpha. This operation is supported for color and alpha operations.

In DirectX 6 and DirectX 7, multitexture operations the above inputs are all shifted down by half (y = x - 0.5) before use to simulate signed data, and the scalar result is automatically clamped to positive values and replicated to all three output channels. Also, note that as a color operation this does not updated the alpha it just updates the RGB components.

However, in DirectX 8.1 shaders you can specify that the output be routed to the .rgb or the .a components or both (the default). You can also specify a separate scalar operation on the alpha channel.

bb172616 D3DTOP_DOTPRODUCT3 D3DTOP_DOTPRODUCT3

Performs a multiply-accumulate operation. It takes the last two arguments, multiplies them together, and adds them to the remaining input/source argument, and places that into the result.

SRGBA = Arg1 + Arg2 * Arg3

bb172616 D3DTOP_MULTIPLYADD D3DTOP_MULTIPLYADD

Linearly interpolates between the second and third source arguments by a proportion specified in the first source argument.

SRGBA = (Arg1) * Arg2 + (1- Arg1) * Arg3.

bb172616 D3DTOP_LERP D3DTOP_LERP

Represents the capabilities of the hardware exposed through the Direct3D object.

The MaxTextureBlendStages and MaxSimultaneousTextures members might seem similar, but they contain different information. The MaxTextureBlendStages member contains the total number of texture-blending stages supported by the current device, and the MaxSimultaneousTextures member describes how many of those stages can have textures bound to them by using the SetTexture method.

When the driver fills this structure, it can set values for execute-buffer capabilities, even when the interface being used to retrieve the capabilities (such as ) does not support execute buffers.

In general, performance problems may occur if you use a texture and then modify it during a scene. Ensure that no texture used in the current BeginScene and EndScene block is evicted unless absolutely necessary. In the case of extremely high texture usage within a scene, the results are undefined. This occurs when you modify a texture that you have used in the scene and there is no spare texture memory available. For such systems, the contents of the z-buffer become invalid at EndScene. Applications should not call UpdateSurface to or from the back buffer on this type of hardware inside a BeginScene/EndScene pair. In addition, applications should not try to access the z-buffer if the capability flag is set. Finally, applications should not lock the back buffer or the z-buffer inside a BeginScene/EndScene pair.

The following flags concerning mipmapped textures are not supported in Direct3D 9.

  • D3DPTFILTERCAPS_LINEAR
  • D3DPTFILTERCAPS_LINEARMIPLINEAR
  • D3DPTFILTERCAPS_LINEARMIPNEAREST
  • D3DPTFILTERCAPS_MIPNEAREST
  • D3DPTFILTERCAPS_NEAREST
bb172513 D3DTEXOPCAPS D3DTEXOPCAPS

Member of the enumerated type, which identifies what type of resources are used for processing vertices.

bb172513 D3DTEXOPCAPS_DISABLE D3DTEXOPCAPS_DISABLE

Adapter on which this Direct3D device was created. This ordinal is valid only to pass to methods of the interface that created this Direct3D device. The interface can always be retrieved by calling GetDirect3D.

bb172513 D3DTEXOPCAPS_SELECTARG1 D3DTEXOPCAPS_SELECTARG1

The following driver-specific capability.

ValueMeaning

Display hardware is capable of returning the current scan line.

The display driver supports an overlay DDI that allows for verification of overlay capabilities. For more information about the overlay DDI, see Overlay DDI.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

?

bb172513 D3DTEXOPCAPS_SELECTARG2 D3DTEXOPCAPS_SELECTARG2

Driver-specific capabilities identified in .

bb172513 D3DTEXOPCAPS_MODULATE D3DTEXOPCAPS_MODULATE

Driver-specific capabilities identified in .

bb172513 D3DTEXOPCAPS_MODULATE2X D3DTEXOPCAPS_MODULATE2X

Bit mask of values representing what presentation swap intervals are available.

ValueMeaning

The driver supports an immediate presentation swap interval.

The driver supports a presentation swap interval of every screen refresh.

The driver supports a presentation swap interval of every second screen refresh.

The driver supports a presentation swap interval of every third screen refresh.

The driver supports a presentation swap interval of every fourth screen refresh.

?

bb172513 D3DTEXOPCAPS_MODULATE4X D3DTEXOPCAPS_MODULATE4X

Bit mask indicating what hardware support is available for cursors. Direct3D 9 does not define alpha-blending cursor capabilities.

ValueMeaning

A full-color cursor is supported in hardware. Specifically, this flag indicates that the driver supports at least a hardware color cursor in high-resolution modes (with scan lines greater than or equal to 400).

A full-color cursor is supported in hardware. Specifically, this flag indicates that the driver supports a hardware color cursor in both high-resolution and low-resolution modes (with scan lines less than 400).

?

bb172513 D3DTEXOPCAPS_ADD D3DTEXOPCAPS_ADD

Flags identifying the capabilities of the device.

ValueMeaning

Device supports blits from system-memory textures to nonlocal video-memory textures.

Device can queue rendering commands after a page flip. Applications do not change their behavior if this flag is set; this capability means that the device is relatively fast.

Device can support at least a DirectX 5-compliant driver.

Device can support at least a DirectX 7-compliant driver.

Device exports an -aware hal.

Device can use execute buffers from system memory.

Device can use execute buffers from video memory.

Device has hardware acceleration for scene rasterization.

Device can support transformation and lighting in hardware.

Device supports N patches.

Device can support rasterization, transform, lighting, and shading in hardware.

Device supports quintic B?zier curves and B-splines.

Device supports rectangular and triangular patches.

When this device capability is set, the hardware architecture does not require caching of any information, and uncached patches (handle zero) will be drawn as efficiently as cached ones. Note that setting does not mean that a patch with handle zero can be drawn. A handle-zero patch can always be drawn whether this cap is set or not.

Device is texturing from separate memory pools.

Device can retrieve textures from non-local video memory.

Device can retrieve textures from system memory.

Device can retrieve textures from device memory.

Device can use buffers from system memory for transformed and lit vertices.

Device can use buffers from video memory for transformed and lit vertices.

?

bb172513 D3DTEXOPCAPS_ADDSIGNED D3DTEXOPCAPS_ADDSIGNED

Miscellaneous driver primitive capabilities. See .

bb172513 D3DTEXOPCAPS_ADDSIGNED2X D3DTEXOPCAPS_ADDSIGNED2X

Information on raster-drawing capabilities. This member can be one or more of the following flags.

ValueMeaning

Device supports anisotropic filtering.

Device iterates colors perspective correctly.

Device can dither to improve color resolution.

Device supports legacy depth bias. For true depth bias, see .

Device supports range-based fog. In range-based fog, the distance of an object from the viewer is used to compute fog effects, not the depth of the object (that is, the z-coordinate) in the scene.

Device calculates the fog value by referring to a lookup table containing fog values that are indexed to the depth of a given pixel.

Device calculates the fog value during the lighting operation and interpolates the fog value during rasterization.

Device supports level-of-detail bias adjustments. These bias adjustments enable an application to make a mipmap appear crisper or less sharp than it normally would. For more information about level-of-detail bias in mipmaps, see .

Device supports toggling multisampling on and off between and (using ).

Device supports scissor test. See Scissor Test (Direct3D 9).

Device performs true slope-scale based depth bias. This is in contrast to the legacy style depth bias.

Device supports depth buffering using w.

Device supports w-based fog. W-based fog is used when a perspective projection matrix is specified, but affine projections still use z-based fog. The system considers a projection matrix that contains a nonzero value in the [3][4] element to be a perspective projection matrix.

Device can perform hidden-surface removal (HSR) without requiring the application to sort polygons and without requiring the allocation of a depth-buffer. This leaves more video memory for textures. The method used to perform HSR is hardware-dependent and is transparent to the application.

Z-bufferless HSR is performed if no depth-buffer surface is associated with the rendering-target surface and the depth-buffer comparison test is enabled (that is, when the state value associated with the enumeration constant is set to TRUE).

Device supports z-based fog.

Device can perform z-test operations. This effectively renders a primitive and indicates whether any z pixels have been rendered.

?

bb172513 D3DTEXOPCAPS_SUBTRACT D3DTEXOPCAPS_SUBTRACT

Z-buffer comparison capabilities. This member can be one or more of the following flags.

ValueMeaning

Always pass the z-test.

Pass the z-test if the new z equals the current z.

Pass the z-test if the new z is greater than the current z.

Pass the z-test if the new z is greater than or equal to the current z.

Pass the z-test if the new z is less than the current z.

Pass the z-test if the new z is less than or equal to the current z.

Always fail the z-test.

Pass the z-test if the new z does not equal the current z.

?

bb172513 D3DTEXOPCAPS_ADDSMOOTH D3DTEXOPCAPS_ADDSMOOTH

Source-blending capabilities. This member can be one or more of the following flags. (The RGBA values of the source and destination are indicated by the subscripts s and d.)

ValueMeaning

The driver supports both and . See .

Source blend factor is (1 - As, 1 - As, 1 - As, 1 - As) and destination blend factor is (As, As, As, As); the destination blend selection is overridden.

The driver supports the blend mode. (This blend mode is obsolete. For more information, see .)

Blend factor is (Ad, Ad, Ad, Ad).

Blend factor is (Rd, Gd, Bd, Ad).

Blend factor is (1 - Ad, 1 - Ad, 1 - Ad, 1 - Ad).

Blend factor is (1 - Rd, 1 - Gd, 1 - Bd, 1 - Ad).

Blend factor is (1 - As, 1 - As, 1 - As, 1 - As).

Blend factor is (1 - Rs, 1 - Gs, 1 - Bs, 1 - As).

Blend factor is (1 - PSOutColor[1]r, 1 - PSOutColor[1]g, 1 - PSOutColor[1]b, not used)). See Render Target Blending.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

Blend factor is (1, 1, 1, 1).

Blend factor is (As, As, As, As).

Blend factor is (f, f, f, 1); f = min(As, 1 - Ad).

Blend factor is (Rs, Gs, Bs, As).

Blend factor is (PSOutColor[1]r, PSOutColor[1]g, PSOutColor[1]b, not used). See Render Target Blending.

Differences between Direct3D 9 and Direct3D 9Ex: This flag is available in Direct3D 9Ex only.

?

Blend factor is (0, 0, 0, 0).

?

bb172513 D3DTEXOPCAPS_BLENDDIFFUSEALPHA D3DTEXOPCAPS_BLENDDIFFUSEALPHA

Destination-blending capabilities. This member can be the same capabilities that are defined for the SrcBlendCaps member.

bb172513 D3DTEXOPCAPS_BLENDTEXTUREALPHA D3DTEXOPCAPS_BLENDTEXTUREALPHA

Alpha-test comparison capabilities. This member can include the same capability flags defined for the ZCmpCaps member. If this member contains only the capability or only the capability, the driver does not support alpha tests. Otherwise, the flags identify the individual comparisons that are supported for alpha testing.

bb172513 D3DTEXOPCAPS_BLENDFACTORALPHA D3DTEXOPCAPS_BLENDFACTORALPHA

Shading operations capabilities. It is assumed, in general, that if a device supports a given command at all, it supports the mode (as specified in the enumerated type). This flag specifies whether the driver can also support Gouraud shading and whether alpha color components are supported. When alpha components are not supported, the alpha value of colors generated is implicitly 255. This is the maximum possible alpha (that is, the alpha component is at full intensity).

The color, specular highlights, fog, and alpha interpolants of a triangle each have capability flags that an application can use to find out how they are implemented by the device driver.

This member can be one or more of the following flags.

ValueMeaning

Device can support an alpha component for Gouraud-blended transparency (the state for the enumerated type). In this mode, the alpha color component of a primitive is provided at vertices and interpolated across a face along with the other color components.

Device can support colored Gouraud shading. In this mode, the per-vertex color components (red, green, and blue) are interpolated across a triangle face.

Device can support fog in the Gouraud shading mode.

Device supports Gouraud shading of specular highlights.

?

bb172513 D3DTEXOPCAPS_BLENDTEXTUREALPHAPM D3DTEXOPCAPS_BLENDTEXTUREALPHAPM

Miscellaneous texture-mapping capabilities. This member can be one or more of the following flags.

ValueMeaning

Alpha in texture pixels is supported.

Device can draw alpha from texture palettes.

Supports cube textures.

Device requires that cube texture maps have dimensions specified as powers of two.

Device supports mipmapped cube textures.

Device supports mipmapped textures.

Device supports mipmapped volume textures.

is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. A device that exposes this capability can use such a texture if all of the following requirements are met.

  • The texture addressing mode for the texture stage is set to .
  • Texture wrapping for the texture stage is disabled (D3DRS_WRAP n set to 0).
  • Mipmapping is not in use (use magnification filter only).
  • Texture formats must not be through .

If this flag is not set, and is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.

A texture that is not a power of two cannot be set at a stage that will be read based on a shader computation (such as the bem - ps and texm3x3 - ps instructions in pixel shaders versions 1_0 to 1_3). For example, these textures can be used to store bumps that will be fed into texture reads, but not the environment maps that are used in texbem - ps, texbeml - ps, and texm3x3spec - ps. This means that a texture with dimensions that are not powers of two cannot be addressed or sampled using texture coordinates computed within the shader. This type of operation is known as a dependent read and cannot be performed on these types of textures.

Device does not support a projected bump-environment loopkup operation in programmable and fixed function shaders.

Perspective correction texturing is supported.

If is not set, all textures must have widths and heights specified as powers of two. This requirement does not apply to either cube textures or volume textures.

If is also set, conditionally supports the use of 2D textures with dimensions that are not powers of two. See description.

If this flag is not set, and is also not set, then unconditional support is provided for 2D textures with dimensions that are not powers of two.

Supports the texture transformation flag. When applied, the device divides transformed texture coordinates by the last texture coordinate. If this capability is present, then the projective divide occurs per pixel. If this capability is not present, but the projective divide needs to occur anyway, then it is performed on a per-vertex basis by the Direct3D runtime.

All textures must be square.

Texture indices are not scaled by the texture size prior to interpolation.

Device supports volume textures.

Device requires that volume texture maps have dimensions specified as powers of two.

?

bb172513 D3DTEXOPCAPS_BLENDCURRENTALPHA D3DTEXOPCAPS_BLENDCURRENTALPHA

Texture-filtering capabilities for a texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

bb172513 D3DTEXOPCAPS_PREMODULATE D3DTEXOPCAPS_PREMODULATE

Texture-filtering capabilities for a cube texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

bb172513 D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR D3DTEXOPCAPS_MODULATEALPHA_ADDCOLOR

Texture-filtering capabilities for a volume texture. Per-stage filtering capabilities reflect which filtering modes are supported for texture stages when performing multiple-texture blending. This member can be any combination of the per-stage texture-filtering flags defined in .

bb172513 D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA D3DTEXOPCAPS_MODULATECOLOR_ADDALPHA

Texture-addressing capabilities for texture objects. This member can be one or more of the following flags.

ValueMeaning

Device supports setting coordinates outside the range [0.0, 1.0] to the border color, as specified by the texture-stage state.

Device can clamp textures to addresses.

Device can separate the texture-addressing modes of the u and v coordinates of the texture. This ability corresponds to the and render-state values.

Device can mirror textures to addresses.

Device can take the absolute value of the texture coordinate (thus, mirroring around 0) and then clamp to the maximum value.

Device can wrap textures to addresses.

?

bb172513 D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR D3DTEXOPCAPS_MODULATEINVALPHA_ADDCOLOR

Texture-addressing capabilities for a volume texture. This member can be one or more of the flags defined for the TextureAddressCaps member.

bb172513 D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA D3DTEXOPCAPS_MODULATEINVCOLOR_ADDALPHA

Defines the capabilities for line-drawing primitives.

ValueMeaning

Supports alpha-test comparisons.

Antialiased lines are supported.

Supports source-blending.

Supports fog.

Supports texture-mapping.

Supports z-buffer comparisons.

?

bb172513 D3DTEXOPCAPS_BUMPENVMAP D3DTEXOPCAPS_BUMPENVMAP

Maximum texture width for this device.

bb172513 D3DTEXOPCAPS_BUMPENVMAPLUMINANCE D3DTEXOPCAPS_BUMPENVMAPLUMINANCE

Maximum texture height for this device.

bb172513 D3DTEXOPCAPS_DOTPRODUCT3 D3DTEXOPCAPS_DOTPRODUCT3

Maximum value for any of the three dimensions (width, height, and depth) of a volume texture.

bb172513 D3DTEXOPCAPS_MULTIPLYADD D3DTEXOPCAPS_MULTIPLYADD

This number represents the maximum range of the integer bits of the post-normalized texture coordinates. A texture coordinate is stored as a 32-bit signed integer using 27 bits to store the integer part and 5 bits for the floating point fraction. The maximum integer index, 227, is used to determine the maximum texture coordinate, depending on how the hardware does texture-coordinate scaling.

Some hardware reports the cap . For this case, the device defers scaling texture coordinates by the texture size until after interpolation and application of the texture address mode, so the number of times a texture can be wrapped is given by the integer value in MaxTextureRepeat.

Less desirably, on some hardware is not set and the device scales the texture coordinates by the texture size (using the highest level of detail) prior to interpolation. This limits the number of times a texture can be wrapped to MaxTextureRepeat / texture size.

For example, assume that MaxTextureRepeat is equal to 32k and the size of the texture is 4k. If the hardware sets , then the number of times a texture can be wrapped is equal to MaxTextureRepeat, which is 32k in this example. Otherwise, the number of times a texture can be wrapped is equal to MaxTextureRepeat divided by texture size, which is 32k/4k in this example.

bb172513 D3DTEXOPCAPS_LERP D3DTEXOPCAPS_LERP

Texture stage states define multi-blender texture operations. Some sampler states set up vertex processing, and some set up pixel processing. Texture stage states can be saved and restored using stateblocks (see State Blocks Save and Restore State (Direct3D 9)).

Members of this enumerated type are used with the and methods to retrieve and set texture state values.

The valid range of values for the , , , and bump-mapping matrix coefficients is greater than or equal to -8.0 and less than 8.0. This range, expressed in mathematical notation is (-8.0,8.0).

bb172617 D3DTEXTURESTAGESTATETYPE D3DTEXTURESTAGESTATETYPE
No documentation. bb172617 D3DTSS_COLOROP D3DTSS_COLOROP No documentation. bb172617 D3DTSS_COLORARG1 D3DTSS_COLORARG1 No documentation. bb172617 D3DTSS_COLORARG2 D3DTSS_COLORARG2 No documentation. bb172617 D3DTSS_ALPHAOP D3DTSS_ALPHAOP No documentation. bb172617 D3DTSS_ALPHAARG1 D3DTSS_ALPHAARG1 No documentation. bb172617 D3DTSS_ALPHAARG2 D3DTSS_ALPHAARG2 No documentation. bb172617 D3DTSS_BUMPENVMAT00 D3DTSS_BUMPENVMAT00 No documentation. bb172617 D3DTSS_BUMPENVMAT01 D3DTSS_BUMPENVMAT01 No documentation. bb172617 D3DTSS_BUMPENVMAT10 D3DTSS_BUMPENVMAT10 No documentation. bb172617 D3DTSS_BUMPENVMAT11 D3DTSS_BUMPENVMAT11 No documentation. bb172617 D3DTSS_TEXCOORDINDEX D3DTSS_TEXCOORDINDEX No documentation. bb172617 D3DTSS_BUMPENVLSCALE D3DTSS_BUMPENVLSCALE No documentation. bb172617 D3DTSS_BUMPENVLOFFSET D3DTSS_BUMPENVLOFFSET No documentation. bb172617 D3DTSS_TEXTURETRANSFORMFLAGS D3DTSS_TEXTURETRANSFORMFLAGS No documentation. bb172617 D3DTSS_COLORARG0 D3DTSS_COLORARG0 No documentation. bb172617 D3DTSS_ALPHAARG0 D3DTSS_ALPHAARG0 No documentation. bb172617 D3DTSS_RESULTARG D3DTSS_RESULTARG No documentation. bb172617 D3DTSS_CONSTANT D3DTSS_CONSTANT

Defines texture coordinate transformation values.

Texture coordinates can be transformed using a 4 x 4 matrix before the results are passed to the rasterizer. The texture coordinate transforms are set by calling , and by passing in the texture stage state and one of the values from . For more information about texture transforms, see Texture Coordinate Transformations (Direct3D 9).

bb172618 D3DTEXTURETRANSFORMFLAGS D3DTEXTURETRANSFORMFLAGS

Texture coordinates are passed directly to the rasterizer.

bb172618 D3DTTFF_DISABLE D3DTTFF_DISABLE

The rasterizer should expect 1D texture coordinates. This value is used by fixed function vertex processing; it should be set to 0 when using a programmable vertex shader.

bb172618 D3DTTFF_COUNT1 D3DTTFF_COUNT1

The rasterizer should expect 2D texture coordinates. This value is used by fixed function vertex processing; it should be set to 0 when using a programmable vertex shader.

bb172618 D3DTTFF_COUNT2 D3DTTFF_COUNT2

The rasterizer should expect 3D texture coordinates. This value is used by fixed function vertex processing; it should be set to 0 when using a programmable vertex shader.

bb172618 D3DTTFF_COUNT3 D3DTTFF_COUNT3

The rasterizer should expect 4D texture coordinates. This value is used by fixed function vertex processing; it should be set to 0 when using a programmable vertex shader.

bb172618 D3DTTFF_COUNT4 D3DTTFF_COUNT4

This flag is honored by the fixed function pixel pipeline, as well as the programmable pixel pipeline in versions ps_1_1 to ps_1_3. When texture projection is enabled for a texture stage, all four floating point values must be written to the corresponding texture register. Each texture coordinate is divided by the last element before being passed to the rasterizer. For example, if this flag is specified with the flag, the first and second texture coordinates are divided by the third coordinate before being passed to the rasterizer.

bb172618 D3DTTFF_PROJECTED D3DTTFF_PROJECTED

In short, texture wrapping changes the basic way that Direct3D rasterizes textured polygons using the texture coordinates specified for each vertex. While rasterizing a polygon, the system interpolates between the texture coordinates at each of the polygon's vertices to determine the texels that should be used for every pixel of the polygon. Normally, the system treats the texture as a 2D plane, interpolating new texels by taking the shortest route from point A within a texture to point B. If point A represents the u, v position (0.8, 0.1), and point B is at (0.1,0.1), the line of interpolation looks like the following diagram.

Note that the shortest distance between A and B in this illustration runs roughly through the middle of the texture. Enabling u-texture or v-texture coordinate wrapping changes how Direct3D perceives the shortest route between texture coordinates in the u-direction and v-direction. By definition, texture wrapping causes the rasterizer to take the shortest route between texture coordinate sets, assuming that 0.0 and 1.0 are coincident. The last bit is the tricky part: You can imagine that enabling texture wrapping in one direction causes the system to treat a texture as though it were wrapped around a cylinder. For example, consider the following diagram.

The preceding illustration shows how wrapping in the u - direction affects how the system interpolates texture coordinates. Using the same points as in the example for normal, or nonwrapped, textures, you can see that the shortest route between points A and B is no longer across the middle of the texture; it's now across the border where 0.0 and 1.0 exist together. Wrapping in the v-direction is similar, except that it wraps the texture around a cylinder that is lying on its side. Wrapping in both the u-direction and v-direction is more complex. In this situation, you can envision the texture as a torus, or doughnut.

The most common practical application for texture wrapping is to perform environment mapping. Usually, an object textured with an environment map appears very reflective, showing a mirrored image of the object's surroundings in the scene. For the sake of this discussion, picture a room with four walls, each one painted with a letter R, G, B, Y and the corresponding colors: red, green, blue, and yellow. The environment map for such a simple room might look like the following illustration.

Imagine that the room's ceiling is held up by a perfectly reflective, four-sided, pillar. Mapping the environment map texture to the pillar is simple; making the pillar look as though it is reflecting the letters and colors is not as easy. The following diagram shows a wire frame of the pillar with the applicable texture coordinates listed near the top vertices. The seam where wrapping will cross the edges of the texture is shown with a dotted line.

With wrapping enabled in the u-direction, the textured pillar shows the colors and symbols from the environment map appropriately and, at the seam in the front of the texture, the rasterizer properly chooses the shortest route between the texture coordinates, assuming that u-coordinates 0.0 and 1.0 share the same location. The textured pillar looks like the following illustration.

If texture wrapping isn't enabled, the rasterizer does not interpolate in the direction needed to generate a believable, reflected image. Rather, the area at the front of the pillar contains a horizontally compressed version of the texels between u-coordinates 0.175 and 0.875, as they pass through the center of the texture. The wrap effect is ruined.

bb206256 D3DWRAPCOORD D3DWRAPCOORD
No documentation. bb206256 D3DWRAPCOORD_0 D3DWRAPCOORD_0 No documentation. bb206256 D3DWRAPCOORD_1 D3DWRAPCOORD_1 No documentation. bb206256 D3DWRAPCOORD_2 D3DWRAPCOORD_2 No documentation. bb206256 D3DWRAPCOORD_3 D3DWRAPCOORD_3 None. None None

Defines the priority type to which an animation track is assigned.

Tracks with the same priority are blended together, and the two resulting values are then blended using the priority blend factor.

bb205401 D3DXPRIORITY_TYPE D3DXPRIORITY_TYPE

Track should be blended with all the low-priority tracks before the low-priority blend is mixed with the high-priority blend.

bb205401 D3DXPRIORITY_LOW D3DXPRIORITY_LOW

Track should be blended with all the high-priority tracks before the high-priority blend is mixed with the low-priority blend.

bb205401 D3DXPRIORITY_HIGH D3DXPRIORITY_HIGH
No documentation. D3DTRANSFORMSTATETYPE2 D3DTRANSFORMSTATETYPE2 No documentation. D3DTS2_VIEW D3DTS2_VIEW No documentation. D3DTS2_PROJECTION D3DTS2_PROJECTION No documentation. D3DTS2_WORLD D3DTS2_WORLD No documentation. D3DTS2_WORLD1 D3DTS2_WORLD1 No documentation. D3DTS2_WORLD2 D3DTS2_WORLD2 No documentation. D3DTS2_WORLD3 D3DTS2_WORLD3 No documentation. D3DTS2_TEXTURE0 D3DTS2_TEXTURE0 No documentation. D3DTS2_TEXTURE1 D3DTS2_TEXTURE1 No documentation. D3DTS2_TEXTURE2 D3DTS2_TEXTURE2 No documentation. D3DTS2_TEXTURE3 D3DTS2_TEXTURE3 No documentation. D3DTS2_TEXTURE4 D3DTS2_TEXTURE4 No documentation. D3DTS2_TEXTURE5 D3DTS2_TEXTURE5 No documentation. D3DTS2_TEXTURE6 D3DTS2_TEXTURE6 No documentation. D3DTS2_TEXTURE7 D3DTS2_TEXTURE7

Defines the transition style between values of a mesh animation.

The calculation for the ramp from ease in to ease out is calculated as follows:

Q(t) = 2(x - y)t3 + 3(y - x)t2 + x

where the ramp is a function Q(t) with the following properties:

  • Q(t) is a cubic spline.
  • Q(t) interpolates between x and y as t ranges from 0 to 1.
  • Q(t) is horizontal when t = 0 and t = 1.

Mathematically, this translates into:

Q(t) = At3 + Bt2 + Ct + D (and therefore, Q'(t) = 3At2 + 2Bt + C)
2a) Q(0) = x
2b) Q(1) = y
3a) Q'(0) = 0
3b) Q'(1) = 0

Solving for A, B, C, D:

D = x (from 2a)
C = 0 (from 3a)
3A + 2B = 0 (from 3b)
A + B = y - x (from 2b and D = x)

Therefore:

A = 2(x - y), B = 3(y - x), C = 0, D = x
bb205475 D3DXTRANSITION_TYPE D3DXTRANSITION_TYPE

Linear transition between values.

bb205475 D3DXTRANSITION_LINEAR D3DXTRANSITION_LINEAR

Ease-in, ease-out spline transition between values.

bb205475 D3DXTRANSITION_EASEINEASEOUT D3DXTRANSITION_EASEINEASEOUT

Usage options that identify how resources are to be used.

The following table summarizes the available usage options.

bb172625 D3DUSAGE D3DUSAGE
No documentation. bb172625 D3DUSAGE_RENDERTARGET D3DUSAGE_RENDERTARGET No documentation. bb172625 D3DUSAGE_DEPTHSTENCIL D3DUSAGE_DEPTHSTENCIL No documentation. bb172625 D3DUSAGE_DYNAMIC D3DUSAGE_DYNAMIC No documentation. bb172625 D3DUSAGE_NONSECURE D3DUSAGE_NONSECURE No documentation. bb172625 D3DUSAGE_AUTOGENMIPMAP D3DUSAGE_AUTOGENMIPMAP No documentation. bb172625 D3DUSAGE_DMAP D3DUSAGE_DMAP No documentation. bb172625 D3DUSAGE_QUERY_LEGACYBUMPMAP D3DUSAGE_QUERY_LEGACYBUMPMAP No documentation. bb172625 D3DUSAGE_QUERY_SRGBREAD D3DUSAGE_QUERY_SRGBREAD No documentation. bb172625 D3DUSAGE_QUERY_FILTER D3DUSAGE_QUERY_FILTER No documentation. bb172625 D3DUSAGE_QUERY_SRGBWRITE D3DUSAGE_QUERY_SRGBWRITE No documentation. bb172625 D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING D3DUSAGE_QUERY_POSTPIXELSHADER_BLENDING No documentation. bb172625 D3DUSAGE_QUERY_VERTEXTEXTURE D3DUSAGE_QUERY_VERTEXTEXTURE No documentation. bb172625 D3DUSAGE_QUERY_WRAPANDMIP D3DUSAGE_QUERY_WRAPANDMIP No documentation. bb172625 D3DUSAGE_WRITEONLY D3DUSAGE_WRITEONLY No documentation. bb172625 D3DUSAGE_SOFTWAREPROCESSING D3DUSAGE_SOFTWAREPROCESSING No documentation. bb172625 D3DUSAGE_DONOTCLIP D3DUSAGE_DONOTCLIP No documentation. bb172625 D3DUSAGE_POINTS D3DUSAGE_POINTS No documentation. bb172625 D3DUSAGE_RTPATCHES D3DUSAGE_RTPATCHES No documentation. bb172625 D3DUSAGE_NPATCHES D3DUSAGE_NPATCHES No documentation. bb172625 D3DUSAGE_TEXTAPI D3DUSAGE_TEXTAPI No documentation. bb172625 D3DUSAGE_RESTRICTED_CONTENT D3DUSAGE_RESTRICTED_CONTENT No documentation. bb172625 D3DUSAGE_RESTRICT_SHARED_RESOURCE D3DUSAGE_RESTRICT_SHARED_RESOURCE No documentation. bb172625 D3DUSAGE_RESTRICT_SHARED_RESOURCE_DRIVER D3DUSAGE_RESTRICT_SHARED_RESOURCE_DRIVER None. None None

Texture wrapping options for IMT computation APIs.

bb172880 D3DXIMT D3DXIMT

The texture wraps in the U direction.

bb172880 D3DXIMT_WRAP_U D3DXIMT_WRAP_U

The texture wraps in the V direction.

bb172880 D3DXIMT_WRAP_V D3DXIMT_WRAP_V

The texture wraps in both the U and V direction.

bb172880 D3DXIMT_WRAP_UV D3DXIMT_WRAP_UV

Defines flags used to control the number or matrices that the system applies when performing multimatrix vertex blending.

Members of this type are used with the render state.

Geometry blending (multimatrix vertex blending) requires that your application use a vertex format that has blending (beta) weights for each vertex.

bb172628 D3DVERTEXBLENDFLAGS D3DVERTEXBLENDFLAGS

Disable vertex blending; apply only the world matrix set by the D3DTS_WORLDMATRIX macro, where the index value for the transformation state is 0.

bb172628 D3DVBF_DISABLE D3DVBF_DISABLE

Enable vertex blending between the two matrices set by the D3DTS_WORLDMATRIX macro, where the index value for the transformation states are 0 and 1.

bb172628 D3DVBF_1WEIGHTS D3DVBF_1WEIGHTS

Enable vertex blending between the three matrices set by the D3DTS_WORLDMATRIX macro, where the index value for the transformation states are 0, 1, and 2.

bb172628 D3DVBF_2WEIGHTS D3DVBF_2WEIGHTS

Enable vertex blending between the four matrices set by the D3DTS_WORLDMATRIX macro, where the index value for the transformation states are 0, 1, 2, and 3.

bb172628 D3DVBF_3WEIGHTS D3DVBF_3WEIGHTS

Vertex blending is done by using the value assigned to .

bb172628 D3DVBF_TWEENING D3DVBF_TWEENING

Use a single matrix with a weight of 1.0.

bb172628 D3DVBF_0WEIGHTS D3DVBF_0WEIGHTS

Flexible Vertex Format Constants, or FVF codes, are used to describe the contents of vertices interleaved in a single data stream that will be processed by the fixed-function pipeline.

bb172559 D3DFVF D3DFVF
No documentation. bb172559 D3DFVF_RESERVED0 D3DFVF_RESERVED0 No documentation. bb172559 D3DFVF_POSITION_MASK D3DFVF_POSITION_MASK No documentation. bb172559 D3DFVF_XYZ D3DFVF_XYZ No documentation. bb172559 D3DFVF_XYZRHW D3DFVF_XYZRHW No documentation. bb172559 D3DFVF_XYZB1 D3DFVF_XYZB1 No documentation. bb172559 D3DFVF_XYZB2 D3DFVF_XYZB2 No documentation. bb172559 D3DFVF_XYZB3 D3DFVF_XYZB3 No documentation. bb172559 D3DFVF_XYZB4 D3DFVF_XYZB4 No documentation. bb172559 D3DFVF_XYZB5 D3DFVF_XYZB5 No documentation. bb172559 D3DFVF_XYZW D3DFVF_XYZW No documentation. bb172559 D3DFVF_NORMAL D3DFVF_NORMAL No documentation. bb172559 D3DFVF_PSIZE D3DFVF_PSIZE No documentation. bb172559 D3DFVF_DIFFUSE D3DFVF_DIFFUSE No documentation. bb172559 D3DFVF_SPECULAR D3DFVF_SPECULAR No documentation. bb172559 D3DFVF_TEXCOUNT_MASK D3DFVF_TEXCOUNT_MASK No documentation. bb172559 D3DFVF_TEXCOUNT_SHIFT D3DFVF_TEXCOUNT_SHIFT No documentation. bb172559 D3DFVF_TEX0 D3DFVF_TEX0 No documentation. bb172559 D3DFVF_TEX1 D3DFVF_TEX1 No documentation. bb172559 D3DFVF_TEX2 D3DFVF_TEX2 No documentation. bb172559 D3DFVF_TEX3 D3DFVF_TEX3 No documentation. bb172559 D3DFVF_TEX4 D3DFVF_TEX4 No documentation. bb172559 D3DFVF_TEX5 D3DFVF_TEX5 No documentation. bb172559 D3DFVF_TEX6 D3DFVF_TEX6 No documentation. bb172559 D3DFVF_TEX7 D3DFVF_TEX7 No documentation. bb172559 D3DFVF_TEX8 D3DFVF_TEX8 No documentation. bb172559 D3DFVF_LASTBETA_UBYTE4 D3DFVF_LASTBETA_UBYTE4 No documentation. bb172559 D3DFVF_LASTBETA_D3DCOLOR D3DFVF_LASTBETA_D3DCOLOR None. None None No documentation. ff569467 D3DFVFCAPS D3DFVFCAPS No documentation. ff569467 D3DFVFCAPS_TEXCOORDCOUNTMASK D3DFVFCAPS_TEXCOORDCOUNTMASK No documentation. ff569467 D3DFVFCAPS_DONOTSTRIPELEMENTS D3DFVFCAPS_DONOTSTRIPELEMENTS No documentation. ff569467 D3DFVFCAPS_PSIZE D3DFVFCAPS_PSIZE

This constant is the maximum number of vertex declarators for a mesh.

MAXD3DDECLLENGTH is defined as a maximum of 64 (see d3d9types.h). This does not include the "end" marker vertex element.

bb147183 _MAX_FVF_DECL_SIZE _MAX_FVF_DECL_SIZE

The maximum number of elements in the vertex declaration. The additional (+1) is for D3DDECL_END.

bb147183 MAX_FVF_DECL_SIZE MAX_FVF_DECL_SIZE

A combination of one or more flags that control the device create behavior.

bb172637 D3DVTXPCAPS D3DVTXPCAPS
No documentation. bb172637 D3DVTXPCAPS_TEXGEN D3DVTXPCAPS_TEXGEN No documentation. bb172637 D3DVTXPCAPS_MATERIALSOURCE7 D3DVTXPCAPS_MATERIALSOURCE7 No documentation. bb172637 D3DVTXPCAPS_DIRECTIONALLIGHTS D3DVTXPCAPS_DIRECTIONALLIGHTS No documentation. bb172637 D3DVTXPCAPS_POSITIONALLIGHTS D3DVTXPCAPS_POSITIONALLIGHTS No documentation. bb172637 D3DVTXPCAPS_LOCALVIEWER D3DVTXPCAPS_LOCALVIEWER No documentation. bb172637 D3DVTXPCAPS_TWEENING D3DVTXPCAPS_TWEENING No documentation. bb172637 D3DVTXPCAPS_TEXGEN_SPHEREMAP D3DVTXPCAPS_TEXGEN_SPHEREMAP No documentation. bb172637 D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER D3DVTXPCAPS_NO_TEXGEN_NONLOCALVIEWER

Vertex shader caps constants. These constants are used by the VS20Caps member of .

bb172634 D3DVS20CAPS D3DVS20CAPS
No documentation. bb172634 D3DVS20CAPS_PREDICATION D3DVS20CAPS_PREDICATION None. None None

Vertex texture sampler constants.

These constants identify the texture samplers used by vertex shaders.

bb172631 D3DVERTEXTEXTURESAMPLER D3DVERTEXTEXTURESAMPLER
No documentation. bb172631 D3DVERTEXTEXTURESAMPLER0 D3DVERTEXTEXTURESAMPLER0 No documentation. bb172631 D3DVERTEXTEXTURESAMPLER1 D3DVERTEXTEXTURESAMPLER1 No documentation. bb172631 D3DVERTEXTEXTURESAMPLER2 D3DVERTEXTEXTURESAMPLER2 No documentation. bb172631 D3DVERTEXTEXTURESAMPLER3 D3DVERTEXTEXTURESAMPLER3 No documentation. bb172631 D3DVERTEXTEXTURESAMPLERMAPSAMPLER D3DVERTEXTEXTURESAMPLERMAPSAMPLER

Specifies the type of I/O bus used by the graphics adapter.

As many as three flags can be set. Flags in the range 0x00 through 0x04 (D3DBUSTYPE_Xxx) provide the basic bus type. Flags in the range 0x10000 through 0x50000 (D3DBUSIMPL_MODIFIER_Xxx) modify the basic description. The driver sets one bus-type flag, and can set zero or one modifier flag. If the driver sets a modifier flag, it also sets the flag. Flags are combined with a bitwise OR.

dd318379 D3DBUSTYPE D3DBUSTYPE

Indicates a type of bus other than the types listed here.

dd318379 D3DBUSTYPE_OTHER D3DBUSTYPE_OTHER

PCI bus.

dd318379 D3DBUSTYPE_PCI D3DBUSTYPE_PCI

PCI-X bus.

dd318379 D3DBUSTYPE_PCIX D3DBUSTYPE_PCIX

PCI Express bus.

dd318379 D3DBUSTYPE_PCIEXPRESS D3DBUSTYPE_PCIEXPRESS

Accelerated Graphics Port (AGP) bus.

dd318379 D3DBUSTYPE_AGP D3DBUSTYPE_AGP

The implementation for the graphics adapter is in a motherboard chipset's north bridge. This flag implies that data never goes over an expansion bus (such as PCI or AGP) when it is transferred from main memory to the graphics adapter.

dd318379 D3DBUSIMPL_MODIFIER_INSIDE_OF_CHIPSET D3DBUSIMPL_MODIFIER_INSIDE_OF_CHIPSET

Indicates that the graphics adapter is connected to a motherboard chipset's north bridge by tracks on the motherboard and all of the graphics adapter's chips are soldered to the motherboard. This flag implies that data never goes over an expansion bus (such as PCI or AGP) when it is transferred from main memory to the graphics adapter.

dd318379 D3DBUSIMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_CHIP D3DBUSIMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_CHIP

The graphics adapter is connected to a motherboard chipset's north bridge by tracks on the motherboard, and all of the graphics adapter's chips are connected through sockets to the motherboard.

dd318379 D3DBUSIMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_SOCKET D3DBUSIMPL_MODIFIER_TRACKS_ON_MOTHER_BOARD_TO_SOCKET

The graphics adapter is connected to the motherboard through a daughterboard connector.

dd318379 D3DBUSIMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR D3DBUSIMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR

The graphics adapter is connected to the motherboard through a daughterboard connector, and the graphics adapter is inside an enclosure that is not user accessible.

dd318379 D3DBUSIMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR_INSIDE_OF_NUAE D3DBUSIMPL_MODIFIER_DAUGHTER_BOARD_CONNECTOR_INSIDE_OF_NUAE

One of the D3DBUSIMPL_MODIFIER_MODIFIER_Xxx flags is set.

dd318379 D3DBUSIMPL_MODIFIER_NON_STANDARD D3DBUSIMPL_MODIFIER_NON_STANDARD

Options for welding together vertices.

bb205561 _D3DXWELDEPSILONSFLAGS _D3DXWELDEPSILONSFLAGS

Weld together all vertices that are at the same location. Using this flag avoids an epsilon comparison between vertex components.

bb205561 D3DXWELDEPSILONS_WELDALL D3DXWELDEPSILONS_WELDALL

If a given vertex component is within epsilon, modify partially matched vertices so that both components are identical. If all components are equal, remove one of the vertices.

bb205561 D3DXWELDEPSILONS_WELDPARTIALMATCHES D3DXWELDEPSILONS_WELDPARTIALMATCHES

Instructs the weld to allow only modifications to vertices and not removal. This flag is valid only if is set. It is useful to modify vertices to be equal, but not to allow vertices to be removed.

bb205561 D3DXWELDEPSILONS_DONOTREMOVEVERTICES D3DXWELDEPSILONS_DONOTREMOVEVERTICES

Instructs the weld not to split vertices that are in separate attribute groups. When the method is called with the flag, then the flag will also be set. Setting this flag can slow down software vertex processing.

bb205561 D3DXWELDEPSILONS_DONOTSPLIT D3DXWELDEPSILONS_DONOTSPLIT
No documentation. D3DXF_FILEFORMAT2 D3DXF_FILEFORMAT2 No documentation. D3DXF_FILEFORMAT_BINARY D3DXF_FILEFORMAT_BINARY No documentation. D3DXF_FILEFORMAT_TEXT D3DXF_FILEFORMAT_TEXT No documentation. D3DXF_FILEFORMAT_COMPRESSED D3DXF_FILEFORMAT_COMPRESSED No documentation. D3DZBUFFERTYPE D3DZBUFFERTYPE No documentation. D3DZB_FALSE D3DZB_FALSE No documentation. D3DZB_TRUE D3DZB_TRUE No documentation. D3DZB_USEW D3DZB_USEW Functions Constant SdkVersion. D3D_SDK_VERSION

Creates an object and returns an interface to it.

No documentation. No documentation.
  • if Direct3DEx features are not supported (no WDDM driver is installed) or if the SDKVersion does not match the version of the DLL.
  • D3DERR_OUTOFMEMORY if out-of-memory conditions are detected when creating the enumerator object.
  • if the creation of the enumerator object is successful.

The object is the first object that the application creates and the last object thta the application releases. Functions for enumerating and retrieving capabilities of a device are accessible through the object. This enables applications to select devices without creating them.

The interface supports enumeration of active display adapters and allows the creation of objects. If the user dynamically adds adapters (either by adding devices to the desktop, or by hot-docking a laptop), these devices are not included in the enumeration. Creating a new interface will expose the new devices.

Pass the flag to this function to ensure that header files used in the compiled application match the version of the installed runtime DLLs. is changed in the runtime only when a header or another code change would require rebuilding the application. If this function fails, it indicates that the versions of the header file and the runtime DLL do not match.

Note??Direct3DCreate9Ex is supported only in Windows Vista, Windows Server 2008, and Windows 7. Earlier versions of the D3D9.dll library do not include Direct3D9Ex and Direct3DCreate9Ex.

bb219676 HRESULT Direct3DCreate9Ex([In] unsigned int SDKVersion,[Out, Fast] IDirect3D9Ex** arg1) Direct3DCreate9Ex

Create an object and return an interface to it.

The value of this parameter should be . See Remarks.

If successful, this function returns a reference to an interface; otherwise, a null reference is returned.

The Direct3D object is the first Direct3D COM object that your graphical application needs to create and the last object that your application needs to release. Functions for enumerating and retrieving capabilities of a device are accessible through the Direct3D object. This enables applications to select devices without creating them.

Create an object as shown here:

 LPDIRECT3D9 g_pD3D = null; if( null == (g_pD3D = Direct3DCreate9())) return E_FAIL;	
            

The interface supports enumeration of active display adapters and allows the creation of objects. If the user dynamically adds adapters (either by adding devices to the desktop, or by hot-docking a laptop), those devices will not be included in the enumeration. Creating a new interface will expose the new devices.

is passed to this function to ensure that the header files against which an application is compiled match the version of the runtime DLL's that are installed on the machine. is only changed in the runtime when a header change (or other code change) would require an application to be rebuilt. If this function fails, it indicates that the header file version does not match the runtime DLL version.

For an example, see Creating a Device (Direct3D 9).

bb219685 IDirect3D9* Direct3DCreate9([In] unsigned int SDKVersion) Direct3DCreate9
Functions Constant Version. D3DX_VERSION Constant SdkVersion. D3DX_SDK_VERSION No documentation. No documentation. No documentation. void D3DPERF_SetMarker([In] D3DCOLOR col,[In] const wchar_t* wszName) D3DPERF_SetMarker No documentation. No documentation. void D3DPERF_SetOptions([In] unsigned int dwOptions) D3DPERF_SetOptions No documentation. No documentation. unsigned int D3DPERF_GetStatus() D3DPERF_GetStatus No documentation. No documentation. No documentation. void D3DPERF_SetRegion([In] D3DCOLOR col,[In] const wchar_t* wszName) D3DPERF_SetRegion No documentation. No documentation. int D3DPERF_EndEvent() D3DPERF_EndEvent

Marks the beginning of a section of event code.

A null-terminated UNICODE string that contains the name of the event. The name is not relevant to the operating system. You can choose a name that is meaningful when the calling application is running under the Direct3D profiling tool.A null reference produces undefined results.

No documentation.

Returns the number of previous calls to BeginEvent that have not yet been finalized by calls to the ID3DUserDefinedAnnotation::EndEvent method.

The return value is ?1 if the calling application is not running under a Direct3D profiling tool.

You call the EndEvent method to mark the end of the section of event code.

A user can visualize the event when the calling application is running under an enabled Direct3D profiling tool such as Microsoft Visual Studio Ultimate?2012.

BeginEvent has no effect if the calling application is not running under an enabled Direct3D profiling tool.

hh446884 int D3DPERF_BeginEvent([In] D3DCOLOR col,[In] const wchar_t* wszName) D3DPERF_BeginEvent
No documentation. No documentation. BOOL D3DPERF_QueryRepeatFrame() D3DPERF_QueryRepeatFrame

Adds a child frame to a frame.

Pointer to the parent node.

Pointer to the child node.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

bb172846 HRESULT D3DXFrameAppendChild([In] D3DXFRAME* pFrameParent,[In] const D3DXFRAME* pFrameChild) D3DXFrameAppendChild

Loads the first frame hierarchy from a .x file.

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Combination of one or more flags from the D3DXMESH enumeration that specify creation options for the mesh.

Pointer to an interface, the device object associated with the mesh.

Pointer to an interface.

Application provided interface that allows loading of user data. See .

Returns a reference to the loaded frame hierarchy. See .

Returns a reference to the animation controller corresponding to animation in the .x file. This is created with default tracks and events. See .

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXLoadMeshHierarchyFromXA.

All the meshes in the file will be collapsed into one output mesh. If the file contains a frame hierarchy, all the transformations will be applied to the mesh.

loads the animation data and frame hierarchy from a .x file. It scans the .x file and builds a frame hierarchy and animation controller according to the -derived object passed to it through pAlloc. Loading the data requires several steps as follows:

  1. Derive , implementing each method. This controls how frames and meshes are allocated and freed.
  2. Derive , implementing each method. If your .x file has no embedded user-defined data, or if you do not need it, you can skip this part.
  3. Create an object of your class, and optionally of your LoadUserData class. You do not need to call any methods of these objects yourself.
  4. Call , passing in your object and your object (or null) to create the frame hierarchy and animation controller. All the animation sets and frames are automatically registered to the animation controller.

During the load, CreateFrame and LoadFrameChildData are called back on each frame to control loading and allocation of the frame. The application defines these methods to control how frames are stored. CreateMeshContainer and LoadMeshChildData are called back on each mesh object to control loading and allocation of mesh objects. LoadTopLevelData is called back for each top level object that doesn't get loaded by the other methods.

To free this data, call ID3DXAnimationController::Release to free the animation sets, and D3DXFRAMEDestroy, passing in the root node of the frame hierarchy and an object of your derived class. DestroyFrame and DestroyMeshContainer will each be called for every frame and mesh object in the frame hierarchy. Your implementation of DestroyFrame should release everything allocated by CreateFrame, and likewise for the mesh container methods.

bb172894 HRESULT D3DXLoadMeshHierarchyFromXW([In] const wchar_t* Filename,[In] unsigned int MeshOptions,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXAllocateHierarchy* pAlloc,[In] ID3DXLoadUserData* pUserDataLoader,[In] D3DXFRAME** ppFrameHierarchy,[In] ID3DXAnimationController** ppAnimController) D3DXLoadMeshHierarchyFromXW

Given a frame hierarchy, registers all the named matrices in the animation mixer.

The top level node in the frame hierarchy.

Pointer to the animation controller object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

bb172851 HRESULT D3DXFrameRegisterNamedMatrices([In] D3DXFRAME* pFrameRoot,[In] ID3DXAnimationController* pAnimController) D3DXFrameRegisterNamedMatrices

Loads the first frame hierarchy from a .x file.

Pointer to a buffer that contains the mesh hierarchy.

Size of the pMemory buffer, in bytes.

Combination of one or more flags from the D3DXMESH enumeration that specify creation options for the mesh.

Pointer to an interface, the device object associated with the mesh.

Pointer to an interface.

Application provided interface that allows loading of user data. See .

Returns a reference to the loaded frame hierarchy. See .

Returns a reference to the animation controller corresponding to animation in the .x file. This is created with default tracks and events. See .

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

All the meshes in the file will be collapsed into one output mesh. If the file contains a frame hierarchy, all the transformations will be applied to the mesh.

bb172895 HRESULT D3DXLoadMeshHierarchyFromXInMemory([In] const void* Memory,[In] unsigned int SizeOfMemory,[In] unsigned int MeshOptions,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXAllocateHierarchy* pAlloc,[In] ID3DXLoadUserData* pUserDataLoader,[In] D3DXFRAME** ppFrameHierarchy,[In] ID3DXAnimationController** ppAnimController) D3DXLoadMeshHierarchyFromXInMemory

Creates a key framed animation set interface that stores key frame data in a compressed format.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

bb172754 HRESULT D3DXCreateCompressedAnimationSet([In] const char* pName,[In] double TicksPerSecond,[In] D3DXPLAYBACK_TYPE Playback,[In] ID3DXBuffer* pCompressedData,[In] unsigned int NumCallbackKeys,[In] const D3DXKEY_CALLBACK* pCallbackKeys,[In] ID3DXCompressedAnimationSet** ppAnimationSet) D3DXCreateCompressedAnimationSet

Creates a .x file and saves the mesh hierarchy and corresponding animations in it.

Pointer to a string that specifies the name of the .x file identifying the saved mesh. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Format of the .x file (text or binary, compressed or not). See . can be combined (using a logical OR) with either the or flags to reduce the output file size.

Root node of the hierarchy to be saved. See .

Animation controller that has animation sets to be stored. See .

Application-provided interface that allows saving of user data. See .

If the function succeeds, the return value is . If the function fails, the return value can be: .

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXSaveMeshHierarchyToFileA.

This function does not save compressed animation sets.

bb205427 HRESULT D3DXSaveMeshHierarchyToFileW([In] const wchar_t* Filename,[In] unsigned int XFormat,[In] const D3DXFRAME* pFrameRoot,[In] ID3DXAnimationController* pAnimController,[In] ID3DXSaveUserData* pUserDataSaver) D3DXSaveMeshHierarchyToFileW

Computes the bounding sphere of all the meshes in the frame hierarchy.

Pointer to the root node.

Returns the center of the bounding sphere.

Returns the radius of the bounding sphere.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

bb172847 HRESULT D3DXFrameCalculateBoundingSphere([In] const D3DXFRAME* pFrameRoot,[In] D3DXVECTOR3* pObjectCenter,[In] float* pObjectRadius) D3DXFrameCalculateBoundingSphere

Creates an animation controller object.

Maximum number of animation outputs the controller can support.

Maximum number of animation sets that can be mixed.

Maximum number of animation sets that can be mixed simultaneously.

Maximum number of outstanding events that the controller will support.

Pointer to the animation controller object created. See .

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

An animation controller controls an animation mixer. The controller adds methods to modify blending parameters over time to enable smooth transitions.

bb172751 HRESULT D3DXCreateAnimationController([In] unsigned int MaxNumMatrices,[In] unsigned int MaxNumAnimationSets,[In] unsigned int MaxNumTracks,[In] unsigned int MaxNumEvents,[In] ID3DXAnimationController** ppAnimController) D3DXCreateAnimationController

Finds the child frame of a root frame.

Pointer to the root frame. See .

Name of the child frame to find.

Returns the child frame if it is found, or null otherwise. See .

bb172849 D3DXFRAME* D3DXFrameFind([In] const D3DXFRAME* pFrameRoot,[In] const char* Name) D3DXFrameFind

Creates a key framed animation set interface.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

bb172776 HRESULT D3DXCreateKeyframedAnimationSet([In] const char* pName,[In] double TicksPerSecond,[In] D3DXPLAYBACK_TYPE Playback,[In] unsigned int NumAnimations,[In] unsigned int NumCallbackKeys,[In] const D3DXKEY_CALLBACK* pCallbackKeys,[In] ID3DXKeyframedAnimationSet** ppAnimationSet) D3DXCreateKeyframedAnimationSet

Destroys the subtree of frames under the root, including the root.

Pointer to the root node.

Allocation interface used to deallocate nodes of the frame hierarchy.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

bb172848 HRESULT D3DXFrameDestroy([In] D3DXFRAME* pFrameRoot,[In] ID3DXAllocateHierarchy* pAlloc) D3DXFrameDestroy

Counts number of frames in a subtree that have non-null names.

Pointer to the root node of the subtree.

Returns the frame count.

bb172850 unsigned int D3DXFrameNumNamedMatrices([In] const D3DXFRAME* pFrameRoot) D3DXFrameNumNamedMatrices

Creates a render environment map.

Pointer to an interface, which is the device to associate with the render surface.

Size of the render surface.

The number of mipmap levels.

Member of the enumerated type that describes the pixel format of the environment map.

If TRUE, the render surface supports a depth-stencil surface. Otherwise, this member is set to .

If DepthStencil is set to TRUE, this parameter is a member of the enumerated type that describes the depth-stencil format of the environment map.

Address of a reference to an interface that represents the created render environment map.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

bb172790 HRESULT D3DXCreateRenderToEnvMap([In] IDirect3DDevice9* pDevice,[In] unsigned int Size,[In] unsigned int MipLevels,[In] D3DFORMAT Format,[In] BOOL DepthStencil,[In] D3DFORMAT DepthStencilFormat,[In] ID3DXRenderToEnvMap** ppRenderToEnvMap) D3DXCreateRenderToEnvMap

Returns the driver level.

Pointer to an interface representing the device.

The driver level. See remarks.

This method returns the driver version, which is one of the following:

  • 700 - Direct3D 7 level driver
  • 800 - Direct3D 8 level driver
  • 900 - Direct3D 9 level driver
bb172865 unsigned int D3DXGetDriverLevel([In] IDirect3DDevice9* pDevice) D3DXGetDriverLevel

Creates a font object for a device and font.

Pointer to an interface, the device to be associated with the font object.

The height of the characters in logical units.

The width of the characters in logical units.

Typeface weight. One example is bold.

The number of mipmap levels.

True for italic font, false otherwise.

The character set of the font.

Specifies how Windows should attempt to match the desired font sizes and characteristics with actual fonts. Use OUT_TT_ONLY_PRECIS for instance, to ensure that you always get a TrueType font.

Specifies how Windows should match the desired font with a real font. It applies to raster fonts only and should not affect TrueType fonts.

Pitch and family index.

String containing the typeface name. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Returns a reference to an interface, representing the created font object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The creation of an object requires that the device supports 32-bit color.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateFontA because ANSI strings are being used.

If you want more information about font parameters, see The Logical Font.

bb172773 HRESULT D3DXCreateFontW([In] IDirect3DDevice9* pDevice,[In] int Height,[In] unsigned int Width,[In] unsigned int Weight,[In] unsigned int MipLevels,[In] BOOL Italic,[In] unsigned int CharSet,[In] unsigned int OutputPrecision,[In] unsigned int Quality,[In] unsigned int PitchAndFamily,[In] const wchar_t* pFaceName,[Out, Fast] ID3DXFont** ppFont) D3DXCreateFontW

Creates a render surface.

Pointer to an interface, the device to be associated with the render surface.

Width of the render surface, in pixels.

Height of the render surface, in pixels.

Member of the enumerated type, describing the pixel format of the render surface.

If TRUE, the render surface supports a depth-stencil surface. Otherwise, this member is set to . This function will create a new depth buffer.

If DepthStencil is set to TRUE, this parameter is a member of the enumerated type, describing the depth-stencil format of the render surface.

Address of a reference to an interface, representing the created render surface.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

bb172791 HRESULT D3DXCreateRenderToSurface([In] IDirect3DDevice9* pDevice,[In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] BOOL DepthStencil,[In] D3DFORMAT DepthStencilFormat,[Out, Fast] ID3DXRenderToSurface** ppRenderToSurface) D3DXCreateRenderToSurface

Creates a sprite object which is associated with a particular device. Sprite objects are used to draw 2D images to the screen.

Pointer to an interface, the device to be associated with the sprite.

Address of a reference to an interface. This interface allows the user to access sprite functions.

If the function succeeds, the return value is .If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

This interface can be used to draw two dimensional images in screen space of the associated device.

bb172797 HRESULT D3DXCreateSprite([In] IDirect3DDevice9* pDevice,[Out, Fast] ID3DXSprite** ppSprite) D3DXCreateSprite

Creates a font object indirectly for both a device and a font.

Pointer to an interface, the device to be associated with the font object.

Pointer to a structure, describing the attributes of the font object to create. If the compiler settings require Unicode, the data type resolves to ; otherwise, the data type resolves to D3DXFONT_DESCA. See Remarks.

Returns a reference to an interface, representing the created font object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateFontIndirectA because ANSI strings are being used.

bb172774 HRESULT D3DXCreateFontIndirectW([In] IDirect3DDevice9* pDevice,[In] const D3DXFONT_DESCW* pDesc,[Out, Fast] ID3DXFont** ppFont) D3DXCreateFontIndirectW

Uses a left-handed coordinate system to create a line.

Pointer to an interface, representing the device associated with the created box mesh.

Pointer to an interface.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

This function creates a mesh with the creation option and | Flexible Vertex Format (FVF).

bb172778 HRESULT D3DXCreateLine([In] IDirect3DDevice9* pDevice,[Out, Fast] ID3DXLine** ppLine) D3DXCreateLine

Turns on or off all D3DX debug output.

If TRUE, debugger output is halted; if , debug output is enabled.

Returns the previous value of Mute.

bb172817 BOOL D3DXDebugMute([In] BOOL Mute) D3DXDebugMute

Verify that the version of D3DX you compiled with is the version that you are running.

Use . See remarks.

Use . See remarks.

Returns TRUE if the version of D3DX you compiled against is the version you are running with; otherwise, is returned.

Use this function during the initialization of your application like this:

  CD3DXMyApplication::Initialize( hInstance,  LPCSTR szWindowName, LPCSTR szClassName, UINT uWidth, UINT uHeight)	
            {  hr; if (!(, )) return E_FAIL; ...	
            }	
            

Use Direct3DCreate9 to verify that the correct runtime is installed.

bb172717 BOOL D3DXCheckVersion([In] unsigned int D3DSdkVersion,[In] unsigned int D3DXSdkVersion) D3DXCheckVersion

Create an effect from an ASCII or binary effect description.

Pointer to the device that will create the effect. See .

Pointer to a buffer containing an effect description.

Length of the effect data, in bytes.

An optional null-terminated array of structures that describe preprocessor definitions. This value can be null.

Optional interface reference, , to use for handling #include directives. If this value is null, #includes will either be honored when compiling from a file or will cause an error when compiled from a resource or memory.

If pSrcData contains a text effect, flags can be a combination of Flags and flags; otherwise, pSrcData contains a binary effect and the only flags honored are flags. The Direct3D 10 HLSL compiler is now the default. See Effect-Compiler Tool for details.

Pointer to a object to use for shared parameters. If this value is null, no parameters will be shared.

Returns a reference to an interface.

Returns a buffer containing a listing of compile errors.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

bb172763 HRESULT D3DXCreateEffect([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) D3DXCreateEffect

Disassemble an effect.

Pointer to an interface that contains the effect.

Enable color coding to make the disassembly easier to read.

Returns a buffer containing the disassembled shader. See .

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

bb172819 HRESULT D3DXDisassembleEffect([In] ID3DXEffect* pEffect,[In] BOOL EnableColorCode,[In] ID3DXBuffer** ppDisassembly) D3DXDisassembleEffect

Create an effect from an ASCII or binary effect description. This is an extended version of that allows an application to control which parameters are ignored by the effects system.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

This function is an extended version of that allows an application to specify which effect constants will be managed by the application. A constant that is managed by the application is ignored by the effects system. That is, the application is responsible for initializing the constant as well as saving and restoring its state whenever appropriate.

This function checks each constant in pSkipConstants to see that:

  • It is bound to a constant register.
  • It is only used in HLSL shader code.

If a constant is named in the string that is not present in the effect, it is ignored.

If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the LPCTSTR data type resolves to LPCSTR.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateEffectFromResourceA because ANSI strings are being used.

loads data from a resource of type RT_RCDATA. See MSDN for more information about Windows resources.

bb172771 HRESULT D3DXCreateEffectFromResourceExW([In] IDirect3DDevice9* pDevice,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) D3DXCreateEffectFromResourceExW

Create an effect from an ASCII or binary effect description.

Pointer to the device.

Handle to a module containing the effect description. If this parameter is null, the current module will be used.

Pointer to the resource. This parameter supports both Unicode and ANSI strings. See Remarks.

An optional null-terminated array of structures that describe preprocessor definitions. This value can be null.

Optional interface reference, , to use for handling #include directives. If this value is null, #includes will either be honored when compiling from a file or will cause an error when compiled from a resource or memory.

If hSrcModule contains a text effect, flags can be a combination of Flags and flags; otherwise, hSrcModule contains a binary effect and the only flags honored are flags. The Direct3D 10 HLSL compiler is now the default. See Effect-Compiler Tool for details.

Pointer to a object to use for shared parameters. If this value is null, no parameters will be shared.

Returns a buffer containing the compiled effect.

Returns a buffer containing a listing of compile errors.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the LPCTSTR data type resolves to LPCSTR.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateEffectFromResourceA because ANSI strings are being used.

loads data from a resource of type RT_RCDATA. See MSDN for more information about Windows resources.

bb172770 HRESULT D3DXCreateEffectFromResourceW([In] IDirect3DDevice9* pDevice,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) D3DXCreateEffectFromResourceW

Creates an effect compiler from an ASCII effect description.

Pointer to a buffer containing an effect description.

Length, in bytes, of the effect data.

An optional null-terminated array of structures that describe preprocessor definitions. This value can be null.

Optional interface reference, , to use for handling #include directives. If this value is null, #includes will either be honored when compiling from a file or will cause an error when compiled from a resource or memory.

Compile options identified by various flags (see Flags). The Direct3D 10 HLSL compiler is now the default. See Effect-Compiler Tool for details.

Address of a reference to an interface containing the effect compiler.

Address of a reference to an interface containing any error messages that occurred during compilation. This parameter can be set to null to ignore error messages.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

bb172764 HRESULT D3DXCreateEffectCompiler([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[Out, Fast] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) D3DXCreateEffectCompiler

Create an effect from an ASCII or binary effect description. This function is an extended version of that allows an application to control which parameters are ignored by the effects system.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

This function is an extended version of that allows an application to specify which effect constants will be managed by the application. A constant that is managed by the application is ignored by the effects system. That is, the application is responsible for initializing the constant as well as saving and restoring its state whenever appropriate.

This function checks each constant in pSkipConstants to see that:

  • It is bound to a constant register.
  • It is only used in HLSL shader code.

If a constant is named in the string that is not present in the effect, it is ignored.

If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the LPCTSTR data type resolves to LPCSTR.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateEffectFromFileA because ANSI strings are being used.

bb172769 HRESULT D3DXCreateEffectFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) D3DXCreateEffectFromFileExW

Creates an effect compiler from an ASCII effect description.

Pointer to the filename. This parameter supports both Unicode and ANSI strings. See Remarks.

An optional null-terminated array of structures that describe preprocessor definitions. This value can be null.

Optional interface reference, , to use for handling #include directives. If this value is null, #includes will either be honored when compiling from a file or will cause an error when compiled from a resource or memory.

Compile options identified by various flags (see Flags). The Direct3D 10 HLSL compiler is now the default. See Effect-Compiler Tool for details.

Address of a reference to an interface, containing the effect compiler.

Address of a reference to an interface, containing any error messages that occurred during compilation. This parameter can be set to null to ignore error messages.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the LPCTSTR data type resolves to LPCSTR.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateEffectCompilerFromFileA because ANSI strings are being used.

bb172765 HRESULT D3DXCreateEffectCompilerFromFileW([In] const wchar_t* pSrcFile,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) D3DXCreateEffectCompilerFromFileW

Creates an from an ASCII effect description.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the LPCTSTR data type resolves to LPCSTR.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateEffectCompilerFromResourceA because ANSI strings are being used.

bb172766 HRESULT D3DXCreateEffectCompilerFromResourceW([In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXEffectCompiler** ppCompiler,[In] ID3DXBuffer** ppParseErrors) D3DXCreateEffectCompilerFromResourceW

Create an effect from an ASCII or binary effect description.

Pointer to the device that will create the effect. See .

Pointer to the filename. This parameter supports both Unicode and ANSI strings. See Remarks.

Optional null-terminated array of preprocessor macro definitions. See .

Optional interface reference, , to use for handling #include directives. If this value is null, #includes will either be honored when compiling from a file or will cause an error when compiled from a resource or memory.

If pSrcFile contains a text effect, flags can be a combination of Flags and flags; otherwise, pSrcFile contains a binary effect and the only flags honored are flags. The Direct3D 10 HLSL compiler is now the default. See Effect-Compiler Tool for details.

Pointer to a object to use for shared parameters. If this value is null, no parameters will be shared.

Returns a reference to a buffer containing the compiled effect. See .

Returns a reference to a buffer containing a listing of compile errors. See .

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the LPCTSTR data type resolves to LPCSTR.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateEffectFromFileA because ANSI strings are being used.

bb172768 HRESULT D3DXCreateEffectFromFileW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) D3DXCreateEffectFromFileW

Create an effect pool. A pool is used to share parameters between effects.

Returns a reference to the created pool.

If the method succeeds, the return value is .

If the arguments are invalid, the method will return .

If the method fails, the return value will be E_FAIL.

For effects within a pool, shared parameters with the same name share values.

bb172772 HRESULT D3DXCreateEffectPool([Out, Fast] ID3DXEffectPool** ppPool) D3DXCreateEffectPool

Creates an effect from an ASCII or binary effect description. This function is an extended version of that allows an application to control which parameters are ignored by the effects system.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

This function is an extended version of that allows an application to specify which effect constants will be managed by the application. A constant that is managed by the application is ignored by the effects system. That is, the application is responsible for initializing the constant as well as saving and restoring its state whenever appropriate.

This function checks each constant in pSkipConstants to see that:

  • It is bound to a constant register.
  • It is only used in HLSL shader code.

If a constant is named in the string that is not present in the effect, it is ignored.

bb172767 HRESULT D3DXCreateEffectEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pSkipConstants,[In] unsigned int Flags,[In] ID3DXEffectPool* pPool,[In] ID3DXEffect** ppEffect,[In] ID3DXBuffer** ppCompilationErrors) D3DXCreateEffectEx

Saves a mesh to a .x file.

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Pointer to an interface, representing the mesh to save to a .x file.

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh. This parameter may be null.

Pointer to an array of structures, containing material information to be saved in the .x file.

Pointer to an array of effect instances, one per attribute group in the mesh. This parameter may be null. An effect instance is a particular instance of state information used to initialize an effect. For more information, see .

Number of structures in the pMaterials array.

A combination of file format and save options when saving an .x file. See D3DX X File Constants.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: .

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXSaveMeshToXA because ANSI strings are being used.

The default file format is binary; however, if a file is specified as both a binary and a text file, it will be saved as a text file. Regardless of the file format, you may also use the compressed format to reduce the file size.

The following is a typical code example of how to use this function.

 *    m_pMesh;           // Mesh object to be saved to a .x file	
            * m_pMaterials;      // Array of material structs in the mesh	
            DWORD         m_dwNumMaterials;  // Number of material structs in the mesh DWORD dwFormat = ;  // Binary-format .x file (default)	
            // DWORD dwFormat = ; // Text-format .x file // Load mesh into m_pMesh and determine values of m_pMaterials and 	
            // m_dwNumMaterials with calls to D3DXLoadMeshxxx or other D3DX functions // ... ( L"outputxfilename.x", m_pMesh, null, m_pMaterials, null, m_dwNumMaterials, dwFormat );	
            
bb205428 HRESULT D3DXSaveMeshToXW([In] const wchar_t* pFilename,[In] ID3DXMesh* pMesh,[In] const unsigned int* pAdjacency,[In] const D3DXMATERIAL* pMaterials,[In] const D3DXEFFECTINSTANCE* pEffectInstances,[In] unsigned int NumMaterials,[In] unsigned int Format) D3DXSaveMeshToXW

Creates an N-patch mesh from a triangle mesh.

Address of a reference to an interface that represents the triangle mesh object.

Address of a reference to an interface that represents the created patch mesh object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

bb172782 HRESULT D3DXCreateNPatchMesh([In] ID3DXMesh* pMeshSysMem,[In] ID3DXPatchMesh** pPatchMesh) D3DXCreateNPatchMesh

Returns a declarator from a flexible vertex format (FVF) code.

Combination of that describes the FVF from which to generate the returned declarator array.

An array of elements describing the vertex format of the mesh vertices. The upper limit of this declarator array is .

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: D3DXERR_INVALIDMESH.

bb172818 HRESULT D3DXDeclaratorFromFVF([In] D3DFVF FVF,[In, Buffer] D3DVERTEXELEMENT9* pDeclarator) D3DXDeclaratorFromFVF

Compute tangent, binormal, and normal vectors for a mesh.

Pointer to an input mesh object.

Combination of one or more flags.

Use null to specify the following options:

  • Weight the normal vector length by the angle, in radians, subtended by the two edges leaving the vertex.
  • Compute orthogonal Cartesian coordinates from the UV texture coordinates.
  • Textures are not wrapped in either U or V directions
  • Partial derivatives with respect to texture coordinates are normalized.
  • Vertices are ordered in a counterclockwise direction around each triangle.
  • Use per-vertex normal vectors already present in the input mesh.
  • The results will be stored in the original input mesh. The function will fail if new vertices need to be created.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

This function simply calls with the following input parameters:

 (pMesh, , 0,    , 0, , 0,  , 0,  dwOptions | , null, 0.01f, 0.25f, 0.01f, null, null);	
            

Singularities are handled as required by grouping edges and splitting vertices. If any vertices need to be split, the function will fail. The computed normal vector at each vertex is always normalized to have unit length.

The most robust solution for computing orthogonal Cartesian coordinates is to not set flags and , so that orthogonal coordinates are computed from both UV texture coordinates. However, in this case, if either U or V is zero, then the function will compute orthogonal coordinates using or respectively.

bb172744 HRESULT D3DXComputeTangentFrame([In] ID3DXMesh* pMesh,[In] unsigned int dwOptions) D3DXComputeTangentFrame

Generates an optimized face remapping for a triangle list.

Pointer to triangle list indices to use for ordering vertices.

Number of faces in the triangle list. For 16-bit meshes, this is limited to 2^16 - 1 (65535) or fewer faces.

Number of vertices referenced by the triangle list.

Flag indicating index type: TRUE if indices are 32-bit (more than 65535 indices), if indices are 16-bit (65535 or fewer indices).

Pointer to the original mesh face that was split to generate the current face.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

This function's optimization procedure is functionally equivalent to calling with the flag, but this function makes more efficient use of vertex caches.

bb205376 HRESULT D3DXOptimizeFaces([In] const void* pbIndices,[In] unsigned int cFaces,[In] unsigned int cVertices,[In] BOOL b32BitIndices,[In, Buffer] int* pFaceRemap) D3DXOptimizeFaces

Welds together replicated vertices that have equal attributes. This method uses specified epsilon values for equality comparisons.

Pointer to an object, the mesh from which to weld vertices.

Combination of one or more flags from D3DXWELDEPSILONSFLAGS.

Pointer to a D3DXWeldEpsilons structure, specifying the epsilon values to be used for this method. Use null to initialize all structure members to a default value of 1.0e-6f.

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the source mesh. If the edge has no adjacent faces, the value is 0xffffffff. If this parameter is set to null, will be called to create logical adjacency information.

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the optimized mesh. If the edge has no adjacent faces, the value is 0xffffffff.

An array of DWORDs, one per face, that identifies the original mesh face that corresponds to each face in the welded mesh.

Address of a reference to an interface, which contains a DWORD for each vertex that specifies how the new vertices map to the old vertices. This remap is useful if you need to alter external data based on the new vertex mapping.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

This function uses supplied adjacency information to determine the points that are replicated. Vertices are merged based on an epsilon comparison. Vertices with equal position must already have been calculated and represented by point-representative data.

This function combines logically-welded vertices that have similar components, such as normals or texture coordinates within pEpsilons.

The following example code calls this function with welding enabled. Vertices are compared using epsilon values for normal vector and vertex position. A reference is returned to a face remapping array (pFaceRemap).

 TCHAR            strMediaPath[512];       // X-file path 	
            LPD3DXBUFFER     pAdjacencyBuffer = null; // adjacency data buffer	
            LPD3DXBUFFER     pD3DXMtrlBuffer  = null; // material buffer	
            LPD3DXMESH       pMesh            = null; // mesh object	
            DWORD            m_dwNumMaterials;        // number of materials	
             Epsilons;                // structure with epsilon values	
            DWORD            *pFaceRemap[65536];      // face remapping array	
            DWORD            i;                       // internal variable // Load the mesh from the specified file hr =  ( strMediaPath, , m_pd3dDevice, &pAdjacencyBuffer, &pD3DXMtrlBuffer, null, &m_dwNumMaterials, &pMesh ) ) if( FAILED( hr ) )  goto End;              // Go to error handling // Set epsilon values Epsilons.Normal = 0.001; Epsilons.Position = 0.1; // Weld the vertices for( i=0; i < 65536; i++ ) {  pFaceRemap[i] = 0;  } hr =  ( pMesh, , &Epsilons, (DWORD*)pAdjacencyBuffer->GetBufferPointer(), (DWORD*)pAdjacencyBuffer->GetBufferPointer(), (DWORD*)pFaceRemap, null ) if( FAILED( hr ) )  goto End;              // Go to error handling	
            
bb205562 HRESULT D3DXWeldVertices([In] ID3DXMesh* pMesh,[In] unsigned int Flags,[In] const D3DXWELDEPSILONS* pEpsilons,[In] const unsigned int* pAdjacencyIn,[In] unsigned int* pAdjacencyOut,[In] unsigned int* pFaceRemap,[In] ID3DXBuffer** ppVertexRemap) D3DXWeldVertices

Generates an output vertex declaration from the input declaration. The output declaration is intended for use by the mesh tessellation functions.

Pointer to the output vertex declaration. See .

Pointer to the input vertex declaration. See .

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: .

bb172861 HRESULT D3DXGenerateOutputDecl([In, Buffer] D3DVERTEXELEMENT9* pOutput,[In, Buffer] const D3DVERTEXELEMENT9* pInput) D3DXGenerateOutputDecl

Creates a buffer object.

Size of the buffer to create, in bytes.

Address of a reference to an interface, representing the created buffer object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: E_OUTOFMEMORY.

bb172753 HRESULT D3DXCreateBuffer([In] unsigned int NumBytes,[In] ID3DXBuffer** ppBuffer) D3DXCreateBuffer

Loads a patch mesh from an object.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

For mesh files that do not contain effect instance information, default effect instances will be generated from the material information in the .x file. A default effect instance will have default values that correspond to the members of the structure.

The default texture name is also filled in, but is handled differently. The name will be Texture0@Name, which corresponds to an effect variable by the name of "Texture0" with an annotation called "Name." This will contain the string file name for the texture.

bb172896 HRESULT D3DXLoadPatchMeshFromXof([In] ID3DXFileData* pXofObjMesh,[In] unsigned int Options,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXBuffer** ppMaterials,[In] ID3DXBuffer** ppEffectInstances,[In] unsigned int* pNumMaterials,[In] ID3DXPatchMesh** ppMesh) D3DXLoadPatchMeshFromXof

Tessellates the given mesh using the N-patch tessellation scheme.

Pointer to an interface, representing the mesh to tessellate.

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the source mesh. This parameter may be null.

Number of segments per edge to tessellate.

Set to TRUE to use quadratic interpolation for normals; set to for linear interpolation.

Address of a reference to an interface, representing the returned tessellated mesh.

Address of a reference to an interface. If the value of this parameter is not set to null, this buffer will contain an array of three DWORDs per face that specify the three neighbors for each face in the output mesh. This parameter may be null.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

This function tessellates by using the N-patch algorithm.

bb205469 HRESULT D3DXTessellateNPatches([In] ID3DXMesh* pMeshIn,[In] const unsigned int* pAdjacencyIn,[In] float NumSegs,[In] BOOL QuadraticInterpNormals,[In] ID3DXMesh** ppMeshOut,[In] ID3DXBuffer** ppAdjacencyOut) D3DXTessellateNPatches

Calculates per-triangle IMT's from a custom application-specified signal that varies over the surface of the mesh (generally at a higher frequency than vertex data). The signal is evaluated via a user-specified callback function.

A reference to an input mesh (see ) which contains the object geometry for calculating the IMT.

Zero-based texture coordinate index that identifies which set of texture coordinates to use.

The number of components in each data point in the signal.

The maximum distance between vertices; the algorithm continues subdividing until the distance between all vertices is less than or equal to fMaxUVDistance.

Texture wrap options. This is a combination of one or more FLAGS.

A reference to a user-provided evaluator function, which will be used to compute the signal value at arbitrary U,V coordinates. The function follows the prototype of LPD3DXIMTSIGNALCALLBACK.

A reference to a user-defined value which is passed to the signal callback function. Typically used by an application to pass a reference to a data structure that provides context information for the callback function.

A reference to a callback function to monitor IMT computation progress.

A reference to a user-defined variable which is passed to the status callback function. Typically used by an application to pass a reference to a data structure that provides context information for the callback function.

A reference to the buffer (see ) containing the returned IMT array. This array can be provided as input to the D3DX UVAtlas Functions to prioritize texture-space allocation in the texture parameterization.

If the function succeeds, the return value is ; otherwise, the value is .

This function requires that the input mesh contain a signal-to-mesh texture mapping (ie. texture coordinates). It allows the user to define a signal arbitrarily over the surface of the mesh.

bb172739 HRESULT D3DXComputeIMTFromSignal([In] ID3DXMesh* pMesh,[In] unsigned int dwTextureIndex,[In] unsigned int uSignalDimension,[In] float fMaxUVDistance,[In] unsigned int dwOptions,[In] __function__stdcall* pSignalCallback,[In] void* pUserData,[In] __function__stdcall* pStatusCallback,[In] void* pUserContext,[In] ID3DXBuffer** ppIMTData) D3DXComputeIMTFromSignal

Validates a patch mesh, returning the number of degenerate vertices and patches.

Pointer to an interface, representing the patch mesh to be tested.

Returns the number of degenerate vertices in the patch mesh.

Returns the number of degenerate patches in the patch mesh.

Returns a reference to a buffer containing a string of errors and warnings that explain the problems found in the patch mesh.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

This method validates the mesh by checking for invalid indices. Error information is available from the debugger output.

bb205483 HRESULT D3DXValidPatchMesh([In] ID3DXPatchMesh* pMesh,[In] unsigned int* dwcDegenerateVertices,[In] unsigned int* dwcDegeneratePatches,[In] ID3DXBuffer** ppErrorsAndWarnings) D3DXValidPatchMesh

Validates a mesh.

Pointer to an interface, representing the mesh to be tested.

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh to be tested.

Returns a buffer containing a string of errors and warnings, which explain the problems found in the mesh.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: D3DXERR_INVALIDMESH, , E_OUTOFMEMORY.

This method validates the mesh by checking for invalid indices. Error information is available from the debugger output.

bb205482 HRESULT D3DXValidMesh([In] ID3DXMesh* pMeshIn,[In] const unsigned int* pAdjacency,[In] ID3DXBuffer** ppErrorsAndWarnings) D3DXValidMesh

Splits a mesh into meshes smaller than the specified size.

Pointer to an interface, representing the source mesh.

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh to be simplified.

Maximum number of vertices in the resulting mesh.

Option flags for the new meshes.

Number of meshes returned.

Buffer containing an array of interfaces for the new meshes. For a source mesh split into n meshes, ppMeshArrayOut is an array of n references.

Buffer containing an array of adjacency arrays (DWORDs) for the new meshes. See . This parameter is optional.

Buffer containing an array of face remap arrays (DWORDs) for the new meshes. See . This parameter is optional.

Buffer containing an array of vertex remap arrays for the new meshes. See . This parameter is optional.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

A common use of this function is to split a mesh with 32-bit indices (more than 65535 vertices) into more than one mesh, each of which has 16-bit indices.

The adjacency, vertex remap and face remap arrays are arrays are DWORDs where each array contains n DWORD references, followed by the DWORD data referenced by the references. For example, to obtain the face remap information for face 3 in mesh 2, the following code could be used, assuming the face remap data was returned in a variable named ppFaceRemapArrayOut.

 const DWORD **face_remaps =  static_cast<DWORD **>(ppFaceRemapArrayOut->GetBufferPointer());	
            const DWORD remap = face_remaps[2][3];	
            
bb205465 HRESULT D3DXSplitMesh([In] ID3DXMesh* pMeshIn,[In] const unsigned int* pAdjacencyIn,[In] const unsigned int MaxSize,[In] const unsigned int Options,[In] unsigned int* pMeshesOut,[In] ID3DXBuffer** ppMeshArrayOut,[In] ID3DXBuffer** ppAdjacencyArrayOut,[In] ID3DXBuffer** ppFaceRemapArrayOut,[In] ID3DXBuffer** ppVertRemapArrayOut) D3DXSplitMesh

Computes the tangent vectors for the texture coordinates given in the texture stage. Provided to support legacy applications. Use for better results.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

If the mesh vertex declaration specifies tangent or binormal fields, will update any user-supplied tangent or binormal data. Alternatively, set TangentIndex to D3DX_DEFAULT to not update the user-supplied tangent data, or set BinormIndex to D3DX_DEFAULT to not update the user-supplied binormal data. TexStageIndex cannot be set to D3DX_DEFAULT.

depends on the mesh vertex declaration containing either the binormal field (BinormIndex), the tangent field (TangentIndex), or both. If both are missing, this function will fail.

This function simply calls with the following input parameters:

 ( Mesh, , TexStageIndex, ( BinormIndex == D3DX_DEFAULT ) ? D3DX_DEFAULT : , // provides backward function compatibility BinormIndex, ( TangentIndex == D3DX_DEFAULT ) ? D3DX_DEFAULT : , TangentIndex, D3DX_DEFAULT, // do not store normals 0, ( Wrap ?  : 0 ) |  | , pAdjacency, -1.01f, -0.01f, -1.01f, null, null);	
            
bb172743 HRESULT D3DXComputeTangent([In] ID3DXMesh* Mesh,[In] unsigned int TexStage,[In] unsigned int TangentIndex,[In] unsigned int BinormIndex,[In] unsigned int Wrap,[In] const unsigned int* pAdjacency) D3DXComputeTangent

Determines if a ray intersects with a mesh.

Pointer to an interface, representing the mesh to be tested.

Pointer to a structure, specifying the point where the ray begins.

Pointer to a structure, specifying the direction of the ray.

Pointer to a . If the ray intersects a triangular face on the mesh, this value will be set to TRUE. Otherwise, this value is set to .

Pointer to an index value of the face closest to the ray origin, if pHit is TRUE.

Pointer to a barycentric hit coordinate, U.

Pointer to a barycentric hit coordinate, V.

Pointer to a ray intersection parameter distance.

Pointer to an object, containing an array of D3DXINTERSECTINFO structures.

Pointer to a DWORD that contains the number of entries in the ppAllHits array.

If the function succeeds, the return value is . If the function fails, the return value can be: E_OUTOFMEMORY.

The function provides a way to understand points in and around a triangle, independent of where the triangle is actually located. This function returns the resulting point by using the following equation: V1 + U(V2 - V1) + V(V3 - V1).

Any point in the plane V1V2V3 can be represented by the barycentric coordinate (U,V). The parameter U controls how much V2 gets weighted into the result, and the parameter V controls how much V3 gets weighted into the result. Lastly, the value of [1 - (U + V)] controls how much V1 gets weighted into the result.

Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.

Barycentric coordinates define a point inside a triangle in terms of the triangle's vertices. For a more in-depth description of barycentric coordinates, see Mathworld's Barycentric Coordinates Description.

bb172882 HRESULT D3DXIntersect([In] ID3DXBaseMesh* pMesh,[In] const D3DXVECTOR3* pRayPos,[In] const D3DXVECTOR3* pRayDir,[In] BOOL* pHit,[In] unsigned int* pFaceIndex,[In] float* pU,[In] float* pV,[In] float* pDist,[In] ID3DXBuffer** ppAllHits,[In] unsigned int* pCountOfHits) D3DXIntersect

Pack mesh partitioning data into an atlas.

Pointer to an input mesh (see ) which contains the object geometry for calculating the atlas. At a minimum, the mesh must contain position data and 2D texture coordinates.

Texture width.

Texture height.

The minimum distance, in texels, between two charts on the atlas. The gutter is always scaled by the width; so, if a gutter of 2.5 is used on a 512x512 texture, then the minimum distance between two charts is 2.5 / 512.0 texels.

Zero-based texture coordinate index that identifies which set of texture coordinates to use.

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh. It should be derived from the ppPartitionResultAdjacency returned from . This value cannot be null, because Pack needs to know where charts were cut in the partition step in order to find the edges of each chart.

A reference to a callback function (see LPD3DXUVATLASCB) that is useful for monitoring progress.

Specify how often D3DX will call the callback; a reasonable default value is 0.0001f.

A void reference to be passed back to the callback function.

This options parameter is currently reserved.

A reference to an containing the array of the final face-partitioning. Each element contains one DWORD per face.

If the function succeeds, the return value is ; otherwise, the value is .

bb205480 HRESULT D3DXUVAtlasPack([In] ID3DXMesh* pMesh,[In] unsigned int uWidth,[In] unsigned int uHeight,[In] float fGutter,[In] unsigned int dwTextureIndex,[In] const unsigned int* pdwPartitionResultAdjacency,[In] __function__stdcall* pStatusCallback,[In] float fCallbackFrequency,[In] void* pUserContext,[In] unsigned int dwOptions,[In] ID3DXBuffer* pFacePartitioning) D3DXUVAtlasPack

Loads a skin mesh from a DirectX .x file data object.

Pointer to an interface, representing the file data object to load.

Combination of one or more flags, from the D3DXMESH enumeration, specifying creation options for the mesh.

Pointer to an interface, the device object associated with the mesh.

Address of a reference to an interface. When this method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh.

Address of a reference to an interface. When the method returns, this parameter is filled with an array of structures.

Pointer to a buffer containing an array of effect instances, one per attribute group in the returned mesh. An effect instance is a particular instance of state information used to initialize an effect. See . For more information about accessing the buffer, see .

Pointer to the number of structures in the ppMaterials array, when the method returns.

Address of a reference to an interface, which represents the skinning information.

Address of a reference to an interface, which represents the loaded mesh.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY

This method takes a reference to an internal object in the .x file, enabling you to load the frame hierarchy.

For mesh files that do not contain effect instance information, default effect instances will be generated from the material information in the .x file. A default effect instance will have default values that correspond to the members of the structure.

The default texture name is also filled in, but is handled differently. The name will be Texture0@Name, which corresponds to an effect variable by the name of "Texture0" with an annotation called "Name." This will contain the string file name for the texture.

bb172899 HRESULT D3DXLoadSkinMeshFromXof([In] ID3DXFileData* pxofMesh,[In] unsigned int Options,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXBuffer** ppAdjacency,[In] ID3DXBuffer** ppMaterials,[In] ID3DXBuffer** ppEffectInstances,[In] unsigned int* pMatOut,[In] ID3DXSkinInfo** ppSkinInfo,[In] ID3DXMesh** ppMesh) D3DXLoadSkinMeshFromXof

Creates a mesh object using a declarator.

Number of faces for the mesh. The valid range for this number is greater than 0, and one less than the maximum DWORD (typically 65534), because the last index is reserved.

Number of vertices for the mesh. This parameter must be greater than 0.

Combination of one or more flags from the D3DXMESH enumeration, specifying options for the mesh.

Array of elements, describing the vertex format for the returned mesh. This parameter must map directly to a flexible vertex format (FVF).

Pointer to an interface, the device object to be associated with the mesh.

Address of a reference to an interface, representing the created mesh object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

bb172780 HRESULT D3DXCreateMesh([In] unsigned int NumFaces,[In] unsigned int NumVertices,[In] unsigned int Options,[In] const D3DVERTEXELEMENT9* pDeclaration,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXMesh** ppMesh) D3DXCreateMesh

Creates an empty skin mesh object using a flexible vertex format (FVF) code.

Number of vertices for the skin mesh.

Combination of that describes the vertex format for the returned skin mesh.

Number of bones for the skin mesh.

Address of a reference to an interface, representing the created skin information object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

Use SetBoneInfluence to populate the empty skin mesh object returned by this method.

bb172794 HRESULT D3DXCreateSkinInfoFVF([In] unsigned int NumVertices,[In] D3DFVF FVF,[In] unsigned int NumBones,[In] ID3DXSkinInfo** ppSkinInfo) D3DXCreateSkinInfoFVF

Intersects the specified ray with the given mesh subset. This provides similar functionality to .

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be the following value: E_OUTOFMEMORY.

The function provides a way to understand points in and around a triangle, independent of where the triangle is actually located. This function returns the resulting point by using the following equation: V1 + U(V2 - V1) + V(V3 - V1).

Any point in the plane V1V2V3 can be represented by the barycentric coordinate (U,V). The parameter U controls how much V2 gets weighted into the result and the parameter V controls how much V3 gets weighted into the result. Lastly, the value of [1 - (U + V)] controls how much V1 gets weighted into the result.

Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.

Barycentric coordinates define a point inside a triangle in terms of the triangle's vertices. For a more in-depth description of barycentric coordinates, see Mathworld's Barycentric Coordinates Description.

bb172884 HRESULT D3DXIntersectSubset([In] ID3DXBaseMesh* pMesh,[In] unsigned int AttribId,[In] const D3DXVECTOR3* pRayPos,[In] const D3DXVECTOR3* pRayDir,[In] BOOL* pHit,[In] unsigned int* pFaceIndex,[In] float* pU,[In] float* pV,[In] float* pDist,[In] ID3DXBuffer** ppAllHits,[In] unsigned int* pCountOfHits) D3DXIntersectSubset

Returns the size of a vertex for a flexible vertex format (FVF).

FVF to be queried. A combination of .

The FVF vertex size, in bytes.

bb172866 unsigned int D3DXGetFVFVertexSize([In] D3DFVF FVF) D3DXGetFVFVertexSize

Returns the number of elements in the vertex declaration.

A reference to the vertex declaration. See .

The number of elements in the vertex declaration.

bb172863 unsigned int D3DXGetDeclLength([In, Buffer] const D3DVERTEXELEMENT9* pDecl) D3DXGetDeclLength

Cleans a mesh, preparing it for simplification.

Vertex operations to perform in preparation for mesh cleaning. See .

Pointer to an interface, representing the mesh to be cleaned.

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh to be cleaned.

Address of a reference to an interface, representing the returned cleaned mesh. The same mesh is returned that was passed in if no cleaning was necessary.

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the output mesh.

Returns a buffer containing a string of errors and warnings, which explain the problems found in the mesh.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

This function cleans a mesh using the cleaning method and options specified in the CleanType parameter. See the enumeration for a description of the available options.

bb172719 HRESULT D3DXCleanMesh([In] D3DXCLEANTYPE CleanType,[In] ID3DXMesh* pMeshIn,[In] const unsigned int* pAdjacencyIn,[In] ID3DXMesh** ppMeshOut,[In] unsigned int* pAdjacencyOut,[In] ID3DXBuffer** ppErrorsAndWarnings) D3DXCleanMesh

Computes the intersection of a ray and a triangle.

Pointer to a structure, describing the first triangle vertex position.

Pointer to a structure, describing the second triangle vertex position.

Pointer to a structure, describing the third triangle vertex position.

Pointer to a structure, specifying the point where the ray begins.

Pointer to a structure, specifying the direction of the ray.

Barycentric hit coordinates, U.

Barycentric hit coordinates, V.

Ray-intersection parameter distance.

Returns TRUE if the ray intersects the area of the triangle. Otherwise, returns .

Any point in the plane V1V2V3 can be represented by the barycentric coordinate (U,V). The parameter U controls how much V2 gets weighted into the result, and the parameter V controls how much V3 gets weighted into the result. Lastly, the value of [1 - (U + V)] controls how much V1 gets weighted into the result.

Barycentric coordinates are a form of general coordinates. In this context, using barycentric coordinates represents a change in coordinate systems. What holds true for Cartesian coordinates holds true for barycentric coordinates.

Barycentric coordinates define a point inside a triangle in terms of the triangle's vertices. For a more in-depth description of barycentric coordinates, see Mathworld's Barycentric Coordinates Description.

bb204928 BOOL D3DXIntersectTri([In] const D3DXVECTOR3* p0,[In] const D3DXVECTOR3* p1,[In] const D3DXVECTOR3* p2,[In] const D3DXVECTOR3* pRayPos,[In] const D3DXVECTOR3* pRayDir,[In] float* pU,[In] float* pV,[In] float* pDist) D3DXIntersectTri

Converts the specified mesh subset into a single triangle strip.

Pointer to an interface, representing the mesh to convert to a strip.

Attribute ID of the mesh subset to convert to strips.

Combination of one or more flags from the D3DXMESH enumeration, specifying options for creating the index buffer. Cannot be . The index buffer will be created with 32-bit or 16-bit indices, depending on the format of the index buffer of the mesh specified by the MeshIn parameter.

Pointer to an interface, representing the index buffer containing the strip.

Number of indices in the buffer returned in the ppIndexBuffer parameter.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

Before running this function, call Optimize or , with the flag set.

bb172749 HRESULT D3DXConvertMeshSubsetToSingleStrip([In] ID3DXBaseMesh* MeshIn,[In] unsigned int AttribId,[In] unsigned int IBOptions,[In] IDirect3DIndexBuffer9** ppIndexBuffer,[In] unsigned int* pNumIndices) D3DXConvertMeshSubsetToSingleStrip

Creates an empty skin mesh object using a declarator.

Number of vertices for the skin mesh.

Array of elements, describing the vertex format for the returned mesh.

Number of bones for the skin mesh.

Address of a reference to an interface, representing the created skin mesh object.

If the function succeeds, the return value is . If the function fails, the return value can be: E_OUTOFMEMORY.

Use SetBoneInfluence to populate the empty skin mesh object returned by this method.

bb172792 HRESULT D3DXCreateSkinInfo([In] unsigned int NumVertices,[In] const D3DVERTEXELEMENT9* pDeclaration,[In] unsigned int NumBones,[In] ID3DXSkinInfo** ppSkinInfo) D3DXCreateSkinInfo

Returns the size of a vertex from the vertex declaration.

A reference to the vertex declaration. See .

The zero-based stream index.

The vertex declaration size, in bytes.

bb172864 unsigned int D3DXGetDeclVertexSize([In, Buffer] const D3DVERTEXELEMENT9* pDecl,[In] unsigned int Stream) D3DXGetDeclVertexSize
No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT D3DXGeneratePMesh([In] ID3DXMesh* pMesh,[In] const unsigned int* pAdjacency,[In] const D3DXATTRIBUTEWEIGHTS* pVertexAttributeWeights,[In] const float* pVertexWeights,[In] unsigned int MinValue,[In] unsigned int Options,[In] ID3DXPMesh** ppPMesh) D3DXGeneratePMesh

Tessellates a rectangular higher-order surface patch into a triangle mesh.

Vertex buffer containing the patch data.

Pointer to an array of four floating-point values that identify the number of segments into which each edge of the rectangle patch should be divided when tessellated. See .

Vertex declaration structure that defines the vertex data. See .

Describes a rectangular patch. See .

Pointer to the created mesh. See .

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

Use to get the number of output vertices and indices that the tessellation function needs.

bb205470 HRESULT D3DXTessellateRectPatch([In] IDirect3DVertexBuffer9* pVB,[In] const float* pNumSegs,[In] const D3DVERTEXELEMENT9* pdwInDecl,[In] const D3DRECTPATCH_INFO* pRectPatchInfo,[In] ID3DXMesh* pMesh) D3DXTessellateRectPatch

Returns a flexible vertex format (FVF) code from a declarator.

Array of elements, describing the FVF code.

Pointer to a DWORD value, representing the returned combination of that describes the vertex format returned from the declarator.

This function will fail for any declarator that does not map directly to an FVF.

bb172854 HRESULT D3DXFVFFromDeclarator([In, Buffer] const D3DVERTEXELEMENT9* pDeclarator,[Out] D3DFVF* pFVF) D3DXFVFFromDeclarator

Computes a coordinate-axis oriented bounding box.

Pointer to the first position.

Number of vertices.

Count or number of bytes between vertices.

Pointer to a structure, describing the returned lower-left corner of the bounding box.

Pointer to a structure, describing the returned upper-right corner of the bounding box.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: .

bb204920 HRESULT D3DXComputeBoundingBox([In] const D3DXVECTOR3* pFirstPosition,[In] unsigned int NumVertices,[In] unsigned int dwStride,[In] D3DXVECTOR3* pMin,[In] D3DXVECTOR3* pMax) D3DXComputeBoundingBox

Creates a skin mesh from another mesh.

Pointer to an object, the mesh from which to create the skin mesh.

The length of the array attached to the BoneId. See .

Pointer to an array of bone combinations. See .

Address of a reference to an interface representing the created skin mesh object.

If the function succeeds, the return value is . If the function fails, the return value can be the following: E_OUTOFMEMORY.

bb172793 HRESULT D3DXCreateSkinInfoFromBlendedMesh([In] ID3DXBaseMesh* pMesh,[In] unsigned int NumBones,[In] const D3DXBONECOMBINATION* pBoneCombinationTable,[In] ID3DXSkinInfo** ppSkinInfo) D3DXCreateSkinInfoFromBlendedMesh

Performs tangent frame computations on a mesh. Tangent, binormal, and optionally normal vectors are generated. Singularities are handled as required by grouping edges and splitting vertices.

Pointer to an input mesh object.

Specifies the texture coordinate input semantic. If D3DX_DEFAULT, the function assumes that there are no texture coordinates, and the function will fail unless normal vector calculation is specified.

If a mesh has multiple texture coordinates, specifies the texture coordinate to use for the tangent frame computations. If zero, the mesh has only a single texture coordinate.

Specifies the output semantic for the type, typically , that describes where the partial derivative with respect to the U texture coordinate will be stored. If D3DX_DEFAULT, then this partial derivative will not be stored.

Specifies the semantic index at which to store the partial derivative with respect to the U texture coordinate.

Specifies the type, typically , that describes where the partial derivative with respect to the V texture coordinate will be stored. If D3DX_DEFAULT, then this partial derivative will not be stored.

Specifies the semantic index at which to store the partial derivative with respect to the V texture coordinate.

Specifies the output normal semantic, typically , that describes where the normal vector at each vertex will be stored. If D3DX_DEFAULT, then this normal vector will not be stored.

Specifies the semantic index at which to store the normal vector at each vertex.

Combination of one or more flags that specify tangent frame computation options. If null, the following options will be specified:

Description Flag Value
Weight the normal vector length by the angle, in radians, subtended by the two edges leaving the vertex.& !( | )
Compute orthogonal Cartesian coordinates from texture coordinates (u, v). See Remarks.& !( | )
Textures are not wrapped in either u or v directions& !( )
Partial derivatives with respect to texture coordinates are normalized.& !( )
Vertices are ordered in a counterclockwise direction around each triangle.& !( )
Use per-vertex normal vectors already present in the input mesh.& !( )

?

If is not set, the input mesh is cloned. The original mesh must therefore have sufficient space to store the computed normal vector and partial derivative data.

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh. The number of bytes in this array must be at least 3 * GetNumFaces * sizeof(DWORD).

Specifies the maximum cosine of the angle at which two partial derivatives are deemed to be incompatible with each other. If the dot product of the direction of the two partial derivatives in adjacent triangles is less than or equal to this threshold, then the vertices shared between these triangles will be split.

Specifies the maximum magnitude of a partial derivative at which a vertex will be deemed singular. As multiple triangles are incident on a point that have nearby tangent frames, but altogether cancel each other out (such as at the top of a sphere), the magnitude of the partial derivative will decrease. If the magnitude is less than or equal to this threshold, then the vertex will be split for every triangle that contains it.

Similar to fPartialEdgeThreshold, specifies the maximum cosine of the angle between two normals that is a threshold beyond which vertices shared between triangles will be split. If the dot product of the two normals is less than the threshold, the shared vertices will be split, forming a hard edge between neighboring triangles. If the dot product is more than the threshold, neighboring triangles will have their normals interpolated.

Address of a reference to an output mesh object that receives the computed tangent, binormal, and normal vector data.

Address of a reference to an output buffer object that receives a mapping of new vertices computed by this method to the original vertices. The buffer is an array of DWORDs, with the array size defined as the number of vertices in ppMeshOut.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

A simplified version of this function is available as .

The computed normal vector at each vertex is always normalized to have unit length.

The most robust solution for computing orthogonal Cartesian coordinates is to not set flags and , so that orthogonal coordinates are computed from both texture coordinates u and v. However, in this case, if either u or v is zero, then the function will compute orthogonal coordinates using or , respectively.

bb172745 HRESULT D3DXComputeTangentFrameEx([In] ID3DXMesh* pMesh,[In] unsigned int dwTextureInSemantic,[In] unsigned int dwTextureInIndex,[In] unsigned int dwUPartialOutSemantic,[In] unsigned int dwUPartialOutIndex,[In] unsigned int dwVPartialOutSemantic,[In] unsigned int dwVPartialOutIndex,[In] unsigned int dwNormalOutSemantic,[In] unsigned int dwNormalOutIndex,[In] unsigned int dwOptions,[In] const unsigned int* pdwAdjacency,[In] float fPartialEdgeThreshold,[In] float fSingularPointThreshold,[In] float fNormalEdgeThreshold,[In] ID3DXMesh** ppMeshOut,[In] ID3DXBuffer** ppVertexMapping) D3DXComputeTangentFrameEx

Determines if a ray intersects the volume of a sphere's bounding box.

Pointer to a structure, specifying the center coordinate of the sphere.

Radius of the sphere.

Pointer to a structure, specifying the origin coordinate of the ray.

Pointer to a structure, specifying the direction of the ray. This vector should not be (0,0,0) but does not need to be normalized.

Returns TRUE if the ray intersects the volume of the sphere's bounding box. Otherwise, returns .

determines if the ray intersects the volume of the sphere's bounding box, not just the surface of the sphere.

bb204995 BOOL D3DXSphereBoundProbe([In] const D3DXVECTOR3* pCenter,[In] float Radius,[In] const D3DXVECTOR3* pRayPosition,[In] const D3DXVECTOR3* pRayDirection) D3DXSphereBoundProbe

Create a UV atlas for a mesh.

Pointer to an input mesh (see ) which contains the object geometry for calculating the atlas. At a minimum, the mesh must contain position data and 2D texture coordinates.

The maximum number of charts to partition the mesh into. See remarks about the partitioning modes. Use 0 to tell D3DX that the atlas should be parameterized based on stretch.

The amount of stretching allowed. 0 means no stretching is allowed, 1 means any amount of stretching can be used.

Texture width.

Texture height.

The minimum distance, in texels, between two charts on the atlas. The gutter is always scaled by the width; so, if a gutter of 2.5 is used on a 512x512 texture, then the minimum distance between two charts is 2.5 / 512.0 texels.

Zero-based texture coordinate index that identifies which set of texture coordinates to use.

A reference to an array of adjacency data. with 3 DWORDs per face, indicating which triangles are adjacent to each other (see ).

An array with 3 DWORDS per face. Each face indicates if an edge is false or not. A non-false edge is indicated by -1, a false edge is indicated by any other value. This enables the parameterization of a mesh of quads where the edges down the middle of each quad will not be cut.

A reference to an array of integrated metric tensors that describes how to stretch a triangle (see IntegratedMetricTensor).

A reference to a callback function (see LPD3DXUVATLASCB) that is useful for monitoring progress.

Specify how often D3DX will call the callback; a reasonable default value is 0.0001f.

Pointer to a user-defined value which is passed to the callback function; typically used by an application to pass a reference to a data structure that provides context information for the callback function.

Specify the quality of the charts generated. See D3DXUVATLAS.

Pointer to the created mesh with the atlas (see ).

A reference to an array of the final face-partitioning data. Each element contains one DWORD per face (see ).

A reference to an array of remapped vertices. Each array element identifies the original vertex that each final vertex came from (if the vertex was split during remapping). Each array element contains one DWORD per vertex.

A reference to the maximum stretch value generated by the atlas algorithm. The range is between 0.0 and 1.0.

A reference to the number of charts created by the atlas algorithm. If dwMaxChartNumber is too low, this parameter will return the minimum number of charts required to create an atlas.

If the function succeeds, the return value is ; otherwise, the value is .

can partition mesh geometry two ways:

  • Based on the number of charts
  • Based on the maximum allowed stretch. If the maximum allowed stretch is 0, each triangle will likely be in its own chart.
bb205479 HRESULT D3DXUVAtlasCreate([In] ID3DXMesh* pMesh,[In] unsigned int uMaxChartNumber,[In] float fMaxStretch,[In] unsigned int uWidth,[In] unsigned int uHeight,[In] float fGutter,[In] unsigned int dwTextureIndex,[In] const unsigned int* pdwAdjacency,[In] const unsigned int* pdwFalseEdgeAdjacency,[In] const float* pfIMTArray,[In] __function__stdcall* pStatusCallback,[In] float fCallbackFrequency,[In] void* pUserContext,[In] unsigned int dwOptions,[In] ID3DXMesh** ppMeshOut,[In] ID3DXBuffer** ppFacePartitioning,[In] ID3DXBuffer** ppVertexRemapArray,[In] float* pfMaxStretchOut,[In] unsigned int* puNumChartsOut) D3DXUVAtlasCreate

Create a UV atlas for a mesh.

Pointer to an input mesh (see ) that contains the object geometry for calculating the atlas. At a minimum, the mesh must contain position data and 2D texture coordinates.

The maximum number of charts to partition the mesh into. See remarks about the partitioning modes. Use 0 to tell D3DX that the atlas should be parameterized based on stretch.

The amount of stretching allowed. 0 means no stretching is allowed, 1 means any amount of stretching can be used.

Zero-based texture coordinate index that identifies which set of texture coordinates to use.

A reference to an array of adjacency data with 3 DWORDs per face, indicating which triangles are adjacent to each other (see ).

An array with 3 DWORDS per face. Each face indicates if an edge is false or not. A non-false edge is indicated by -1, a false edge is indicated by any other value. This enables the parameterization of a mesh of quads where the edges down the middle of each quad will not be cut.

A reference to an array of integrated metric tensors that describes how to stretch a triangle (see IntegratedMetricTensor).

A reference to a callback function (see LPD3DXUVATLASCB) that is useful for monitoring progress.

Specify how often D3DX will call the callback; a reasonable default value is 0.0001f.

Pointer to a user-defined value that is passed to the callback function; typically used by an application to pass a reference to a data structure that provides context information for the callback function.

Specify the quality of the charts generated by combining one or more D3DXUVATLAS flags.

Pointer to the created mesh with the atlas (see ).

A reference to an array of the final face-partitioning data. Each element contains one DWORD per face (see ).

A reference to an array of remapped vertices. Each array element identifies the original vertex each final vertex came from (if the vertex was split during remapping). Each array element contains one DWORD per vertex.

Address of a reference to an interface. This buffer will contain an array of three DWORDs per face that specify the three neighbors for each face in the output mesh. This parameter must not be null, because the subsequent call to () requires it.

A reference to the maximum stretch value generated by the atlas algorithm. The range is between 0.0 and 1.0.

A reference to the number of charts created by the atlas algorithm. If dwMaxChartNumber is too low, this parameter will return the minimum number of charts required to create an atlas.

If the function succeeds, the return value is ; otherwise, the value is .

is similar to , except that does not performing the final packing step.

bb205481 HRESULT D3DXUVAtlasPartition([In] ID3DXMesh* pMesh,[In] unsigned int uMaxChartNumber,[In] float fMaxStretch,[In] unsigned int dwTextureIndex,[In] const unsigned int* pdwAdjacency,[In] const unsigned int* pdwFalseEdgeAdjacency,[In] const float* pfIMTArray,[In] __function__stdcall* pStatusCallback,[In] float fCallbackFrequency,[In] void* pUserContext,[In] unsigned int dwOptions,[In] ID3DXMesh** ppMeshOut,[In] ID3DXBuffer** ppFacePartitioning,[In] ID3DXBuffer** ppVertexRemapArray,[In] ID3DXBuffer** ppPartitionResultAdjacency,[In] float* pfMaxStretchOut,[In] unsigned int* puNumChartsOut) D3DXUVAtlasPartition
No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT D3DXCreatePMeshFromStream([In] IStream* pStream,[In] unsigned int Options,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXBuffer** ppMaterials,[In] ID3DXBuffer** ppEffectInstances,[In] unsigned int* pNumMaterials,[In] ID3DXPMesh** ppPMesh) D3DXCreatePMeshFromStream

Calculates per-triangle IMT's from a texture mapped onto a mesh, to be used optionally as input to the D3DX UVAtlas Functions.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is ; otherwise, the value is .

Given a texture that maps over the surface of the mesh, the algorithm computes the IMT for each face. This will cause triangles containing lower-frequency signal data to take up less space in the final texture atlas when parameterized with the UVAtlas functions. The texture is assumed to be interpolated over the mesh bilinearly.

bb172740 HRESULT D3DXComputeIMTFromTexture([In] ID3DXMesh* pMesh,[In] IDirect3DTexture9* pTexture,[In] unsigned int dwTextureIndex,[In] unsigned int dwOptions,[In] __function__stdcall* pStatusCallback,[In] void* pUserContext,[In] ID3DXBuffer** ppIMTData) D3DXComputeIMTFromTexture
No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT D3DXCreateSPMesh([In] ID3DXMesh* pMesh,[In] const unsigned int* pAdjacency,[In] const D3DXATTRIBUTEWEIGHTS* pVertexAttributeWeights,[In] const float* pVertexWeights,[In] ID3DXSPMesh** ppSMesh) D3DXCreateSPMesh

Concatenates a group of meshes into one common mesh. This method can optionally apply a matrix transformation to each input mesh and its texture coordinates.

Array of input mesh references (see ). The number of elements in the array is NumMeshes.

Number of input meshes to concatenate.

Mesh creation options; this is a combination of one or more D3DXMESH flags. The mesh creation options are equivalent to the options parameter required by .

Optional array of geometry transforms. The number of elements in the array is NumMeshes; each element is a transformation matrix (see ). May be null.

Optional array of texture transforms. The number of elements in the array is NumMeshes; each element is a transformation matrix (see ). This parameter may be null.

Optional reference to a vertex declaration (see ). This parameter may be null.

Pointer to a device that is used to create the new mesh.

Address of a reference to the mesh created (see ).

If the function succeeds, the return value is . If the function fails, the return value can be one of these: , E_OUTOFMEMORY.

If no vertex declaration is given as part of the Options mesh creation parameter, the method will generate a union of all of the vertex declarations of the submeshes, promoting channels and types if necessary. The method will create an attribute table from attribute tables of the input meshes. To ensure creation of an attribute table, call Optimize with Flags set to and (see D3DXMESHOPT).

bb172746 HRESULT D3DXConcatenateMeshes([In] ID3DXMesh** ppMeshes,[In] unsigned int NumMeshes,[In] unsigned int Options,[In] const D3DXMATRIX* pGeomXForms,[In] const D3DXMATRIX* pTextureXForms,[In, Buffer] const D3DVERTEXELEMENT9* pDecl,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXMesh** ppMeshOut) D3DXConcatenateMeshes

Determines whether a ray intersects the volume of a box's bounding box.

Pointer to a , describing the lower-left corner of the bounding box. See Remarks.

Pointer to a structure, describing the upper-right corner of the bounding box. See Remarks.

Pointer to a structure, specifying the origin coordinate of the ray.

Pointer to a structure, specifying the direction of the ray. This vector should not be (0,0,0) but does not need to be normalized.

Returns TRUE if the ray intersects the volume of the box's bounding box. Otherwise, returns .

determines if the ray intersects the volume of the box's bounding box, not just the surface of the box.

The values passed to are xmin, xmax, ymin, ymax, zmin, and zmax. Thus, the following defines the corners of the bounding box.

 xmax, ymax, zmax	
            xmax, ymax, zmin	
            xmax, ymin, zmax	
            xmax, ymin, zmin	
            xmin, ymax, zmax	
            xmin, ymax, zmin	
            xmin, ymin, zmax	
            xmin, ymin, zmin	
            

The depth of the bounding box in the z direction is zmax - zmin, in the y direction is ymax - ymin, and in the x direction is xmax - xmin. For example, with the following minimum and maximum vectors, min (-1, -1, -1) and max (1, 1, 1), the bounding box is defined in the following manner.

 1,  1,  1 1,  1, -1 1, -1,  1 1, -1, -1	
            -1,  1,  1	
            -1,  1, -1	
            -1, -1,  1	
            -1, -1, -l	
            
bb204916 BOOL D3DXBoxBoundProbe([In] const D3DXVECTOR3* pMin,[In] const D3DXVECTOR3* pMax,[In] const D3DXVECTOR3* pRayPosition,[In] const D3DXVECTOR3* pRayDirection) D3DXBoxBoundProbe

Loads a mesh from a resource.

Handle to the module where the resource is located, or null for the module associated with the image the operating system used to create the current process. See remarks.

Pointer to a string that specifies the resource to create the mesh from. See remarks.

Pointer to a string that specifies the resource type. See remarks.

Combination of one or more flags from the D3DXMESH enumeration that specify creation options for the mesh.

Pointer to an interface, the device object associated with the mesh.

Address of a reference to an interface. When the method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh.

Address of a reference to an interface. When this method returns, this parameter is filled with an array of structures, containing information saved in the DirectX file.

Pointer to a buffer containing an array of effect instances, one per attribute group in the returned mesh. An effect instance is a particular instance of state information used to initialize an effect. See . For more information about accessing the buffer, see .

Pointer to the number of structures in the ppMaterials array, when the method returns.

Address of a reference to an interface, representing the loaded mesh.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

See FindResource to find out more about the Module, Name and Type parameters.

All the meshes in the file will be collapsed into one output mesh. If the file contains a frame hierarchy, all the transformations will be applied to the mesh.

For mesh files that do not contain effect instance information, default effect instances will be generated from the material information in the .x file. A default effect instance will have default values that correspond to the members of the structure.

The default texture name is also filled in, but is handled differently. The name will be Texture0@Name, which corresponds to an effect variable by the name of "Texture0" with an annotation called "Name." This will contain the string file name for the texture.

bb172893 HRESULT D3DXLoadMeshFromXResource([In] HINSTANCE Module,[In] const char* Name,[In] const char* Type,[In] unsigned int Options,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXBuffer** ppAdjacency,[In] ID3DXBuffer** ppMaterials,[In] ID3DXBuffer** ppEffectInstances,[In] unsigned int* pNumMaterials,[In] ID3DXMesh** ppMesh) D3DXLoadMeshFromXResource

Generates a simplified mesh using the provided weights that come as close as possible to the given MinValue.

Pointer to an interface, representing the source mesh.

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh to be simplified.

Pointer to a structure, containing the weight for each vertex component. If this parameter is set to null, a default structure is used. See Remarks.

Pointer to an array of vertex weights. If this parameter is set to null, all vertex weights are set to 1.0.

Number of vertices or faces, depending on the flag set in the Options parameter, by which to simplify the source mesh.

Specifies simplification options for the mesh. One of the flags in D3DXMESHSIMP can be set.

Address of a reference to an interface, representing the returned simplification mesh.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

This function generates a mesh that has MinValue vertices or faces.

If the simplification process cannot reduce the mesh to MinValue, the call still succeeds because MinValue is a desired minimum, not an absolute minimum.

If pVertexAttributeWeights is set to null, the following values are assigned to the default structure.

  AttributeWeights; AttributeWeights.Position  = 1.0;	
            AttributeWeights.Boundary =  1.0;	
            AttributeWeights.Normal   =  1.0;	
            AttributeWeights.Diffuse  =  0.0;	
            AttributeWeights.Specular =  0.0;	
            AttributeWeights.Tex[8]   =  {0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0};	
            

This default structure is what most applications should use because it considers only geometric and normal adjustment. Only in special cases will the other member fields need to be modified.

bb205463 HRESULT D3DXSimplifyMesh([In] ID3DXMesh* pMesh,[In] const unsigned int* pAdjacency,[In] const D3DXATTRIBUTEWEIGHTS* pVertexAttributeWeights,[In] const float* pVertexWeights,[In] unsigned int MinValue,[In] unsigned int Options,[In] ID3DXMesh** ppMesh) D3DXSimplifyMesh

Creates a mesh object using a flexible vertex format (FVF) code.

Number of faces for the mesh. The valid range for this number is greater than 0, and one less than the max DWORD value, typically 232 - 1, because the last index is reserved.

Number of vertices for the mesh. This parameter must be greater than 0.

Combination of one or more flags from the D3DXMESH enumeration, specifying creation options for the mesh.

Combination of that describes the vertex format for the returned mesh. This function does not support .

Pointer to an interface, the device object to be associated with the mesh.

Address of a reference to an interface, representing the created mesh object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

bb172781 HRESULT D3DXCreateMeshFVF([In] unsigned int NumFaces,[In] unsigned int NumVertices,[In] unsigned int Options,[In] D3DFVF FVF,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXMesh** ppMesh) D3DXCreateMeshFVF

Calculate per-triangle IMT's from from per-vertex data. This function allows you to calculate the IMT based off of any value in a mesh (color, normal, etc).

A reference to an input mesh (see ) which contains the object geometry for calculating the IMT.

A reference to an array of per-vertex data from which IMT will be computed. The array size is uSignalStride * v, where v is the number of vertices in the mesh.

The number of floats per vertex.

The number of bytes per vertex in the array. This must be a multiple of sizeof(float)

Texture wrap options. This is a combination of one or more FLAGS.

A reference to a callback function to monitor IMT computation progress.

A reference to a user-defined variable which is passed to the status callback function. Typically used by an application to pass a reference to a data structure that provides context information for the callback function.

A reference to the buffer (see ) containing the returned IMT array. This array can be provided as input to the D3DX UVAtlas Functions to prioritize texture-space allocation in the texture parameterization.

If the function succeeds, the return value is ; otherwise, the value is .

bb172738 HRESULT D3DXComputeIMTFromPerVertexSignal([In] ID3DXMesh* pMesh,[In] const float* pfVertexSignal,[In] unsigned int uSignalDimension,[In] unsigned int uSignalStride,[In] unsigned int dwOptions,[In] __function__stdcall* pStatusCallback,[In] void* pUserContext,[In] ID3DXBuffer** ppIMTData) D3DXComputeIMTFromPerVertexSignal

Generates an optimized vertex remapping for a triangle list. This function is commonly used after applying the face remapping generated by .

No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

By default, a mesh uses 16 bit indices when it is created unless the application specifies otherwise. To check whether an existing mesh uses 16-bit or 32-bit indices, call and check for the flag.

bb205377 HRESULT D3DXOptimizeVertices([In] const void* pbIndices,[In] unsigned int cFaces,[In] unsigned int cVertices,[In] BOOL b32BitIndices,[In, Buffer] int* pVertexRemap) D3DXOptimizeVertices

Loads a mesh from a DirectX .x file.

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Combination of one or more flags from the D3DXMESH enumeration, which specifies creation options for the mesh.

Pointer to an interface, the device object associated with the mesh.

Pointer to a buffer that contains adjacency data. The adjacency data contains an array of three DWORDs per face that specify the three neighbors for each face in the mesh. For more information about accessing the buffer, see .

Pointer to a buffer containing materials data. The buffer contains an array of structures, containing information from the DirectX file. For more information about accessing the buffer, see .

Pointer to a buffer containing an array of effect instances, one per attribute group in the returned mesh. An effect instance is a particular instance of state information used to initialize an effect. See . For more information about accessing the buffer, see .

Pointer to the number of structures in the ppMaterials array, when the method returns.

Address of a reference to an interface, representing the loaded mesh.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXLoadMeshFromXA because ANSI strings are being used.

All the meshes in the file will be collapsed into one output mesh. If the file contains a frame hierarchy, all the transformations will be applied to the mesh.

For mesh files that do not contain effect instance information, default effect instances will be generated from the material information in the .x file. A default effect instance will have default values that correspond to the members of the structure.

The default texture name is also filled in, but is handled differently. The name will be Texture0@Name, which corresponds to an effect variable by the name of "Texture0" with an annotation called "Name." This will contain the string file name for the texture.

bb172890 HRESULT D3DXLoadMeshFromXof([In] ID3DXFileData* pxofMesh,[In] unsigned int Options,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXBuffer** ppAdjacency,[In] ID3DXBuffer** ppMaterials,[In] ID3DXBuffer** ppEffectInstances,[In] unsigned int* pNumMaterials,[In] ID3DXMesh** ppMesh) D3DXLoadMeshFromXof

Creates a mesh from a control-patch mesh.

Patch information structure. For more information, see .

Number of patches.

Number of control vertices in the patch.

Unused. Reserved for later use.

Array of elements, describing the vertex format for the returned mesh.

Pointer the device that creates the patch mesh. See .

Pointer to the object that is created.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

This method takes an input patch mesh and converts it to a tessellated mesh. Patch meshes use 16-bit index buffers. Therefore, indices to LockIndexBuffer are 16 bits.

bb172783 HRESULT D3DXCreatePatchMesh([In] const D3DXPATCHINFO* pInfo,[In] unsigned int dwNumPatches,[In] unsigned int dwNumVertices,[In] unsigned int dwOptions,[In, Buffer] const D3DVERTEXELEMENT9* pDecl,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXPatchMesh** pPatchMesh) D3DXCreatePatchMesh

Gets the size of the rectangle patch.

Number of segments per edge to tessellate.

Pointer to a DWORD that contains the number of triangles in the patch.

Pointer to a DWORD that contains the number of vertices in the patch.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

bb205423 HRESULT D3DXRectPatchSize([In] const float* pfNumSegs,[Out] unsigned int* pdwTriangles,[Out] unsigned int* pdwVertices) D3DXRectPatchSize

Tessellates a triangular higher-order surface patch into a triangle mesh.

Vertex buffer containing the patch data.

Pointer to an array of three floating-point values that identify the number of segments into which each edge of the triangle patch should be divided when tessellated. See .

Vertex declaration structure that defines the vertex data. See .

Describes a triangle patch. See .

Pointer to the created mesh. See .

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

Use to get the number of output vertices and indices that the tessellation function needs.

bb205471 HRESULT D3DXTessellateTriPatch([In] IDirect3DVertexBuffer9* pVB,[In] const float* pNumSegs,[In] const D3DVERTEXELEMENT9* pInDecl,[In] const D3DTRIPATCH_INFO* pTriPatchInfo,[In] ID3DXMesh* pMesh) D3DXTessellateTriPatch

Computes a bounding sphere for the mesh.

Pointer to first position.

Number of vertices.

Number of bytes between position vectors. Use GetNumBytesPerVertex, , or to get the vertex stride.

structure, defining the coordinate center of the returned bounding sphere.

Radius of the returned bounding sphere.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: .

bb172736 HRESULT D3DXComputeBoundingSphere([In] const D3DXVECTOR3* pFirstPosition,[In] unsigned int NumVertices,[In] unsigned int dwStride,[In] D3DXVECTOR3* pCenter,[In] float* pRadius) D3DXComputeBoundingSphere

Loads a mesh from a DirectX .x file.

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Combination of one or more flags from the D3DXMESH enumeration, which specifies creation options for the mesh.

Pointer to an interface, the device object associated with the mesh.

Pointer to a buffer that contains adjacency data. The adjacency data contains an array of three DWORDs per face that specify the three neighbors for each face in the mesh. For more information about accessing the buffer, see .

Pointer to a buffer containing materials data. The buffer contains an array of structures, containing information from the DirectX file. For more information about accessing the buffer, see .

Pointer to a buffer containing an array of effect instances, one per attribute group in the returned mesh. An effect instance is a particular instance of state information used to initialize an effect. See . For more information about accessing the buffer, see .

Pointer to the number of structures in the ppMaterials array, when the method returns.

Address of a reference to an interface, representing the loaded mesh.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXLoadMeshFromXA because ANSI strings are being used.

All the meshes in the file will be collapsed into one output mesh. If the file contains a frame hierarchy, all the transformations will be applied to the mesh.

For mesh files that do not contain effect instance information, default effect instances will be generated from the material information in the .x file. A default effect instance will have default values that correspond to the members of the structure.

The default texture name is also filled in, but is handled differently. The name will be Texture0@Name, which corresponds to an effect variable by the name of "Texture0" with an annotation called "Name." This will contain the string file name for the texture.

bb172890 HRESULT D3DXLoadMeshFromXW([In] const wchar_t* pFilename,[In] unsigned int Options,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXBuffer** ppAdjacency,[In] ID3DXBuffer** ppMaterials,[In] ID3DXBuffer** ppEffectInstances,[In] unsigned int* pNumMaterials,[In] ID3DXMesh** ppMesh) D3DXLoadMeshFromXW

Loads a mesh from memory.

Pointer to the memory buffer which contains the mesh data.

Size of the file in memory, in bytes.

Combination of one or more flags from the D3DXMESH enumeration, specifying creation options for the mesh.

Pointer to an interface, the device object associated with the mesh.

Address of a reference to an interface. When the method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh.

Address of a reference to an interface. When this method returns, this parameter is filled with an array of structures, containing information saved in the DirectX file.

Pointer to a buffer containing an array of effect instances, one per attribute group in the returned mesh. An effect instance is a particular instance of state information used to initialize an effect. See . For more information about accessing the buffer, see .

Pointer to the number of structures in the ppMaterials array, when the method returns.

Address of a reference to an interface, representing the loaded mesh.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

All the meshes in the file will be collapsed into one output mesh. If the file contains a frame hierarchy, all the transformations will be applied to the mesh.

For mesh files that do not contain effect instance information, default effect instances will be generated from the material information in the .x file. A default effect instance will have default values that correspond to the members of the structure.

The default texture name is also filled in, but is handled differently. The name will be Texture0@Name, which corresponds to an effect variable by the name of "Texture0" with an annotation called "Name." This will contain the string file name for the texture.

bb172891 HRESULT D3DXLoadMeshFromXInMemory([In] const void* Memory,[In] unsigned int SizeOfMemory,[In] unsigned int Options,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXBuffer** ppAdjacency,[In] ID3DXBuffer** ppMaterials,[In] ID3DXBuffer** ppEffectInstances,[In] unsigned int* pNumMaterials,[In] ID3DXMesh** ppMesh) D3DXLoadMeshFromXInMemory

Convert the specified mesh subset into a series of strips.

Pointer to an interface, representing the mesh to convert to a strip.

Attribute ID of the mesh subset to convert to strips.

Combination of one or more flags from the D3DXMESH enumeration, specifying options for creating the index buffer. Cannot be . The index buffer will be created with 32-bit or 16-bit indices depending on the format of the index buffer of the mesh specified by the MeshIn parameter.

Pointer to an interface, representing index buffer containing the strip.

Number of indices in the buffer returned in the ppIndexBuffer parameter.

Buffer containing an array of one DWORD per strip, which specifies the number of triangles in the that strip.

Number of individual strips in the index buffer and corresponding strip length array.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , E_OUTOFMEMORY.

Before running this function, call Optimize or , with the flag set.

bb172750 HRESULT D3DXConvertMeshSubsetToStrips([In] ID3DXBaseMesh* MeshIn,[In] unsigned int AttribId,[In] unsigned int IBOptions,[In] IDirect3DIndexBuffer9** ppIndexBuffer,[In] unsigned int* pNumIndices,[In] ID3DXBuffer** ppStripLengths,[In] unsigned int* pNumStrips) D3DXConvertMeshSubsetToStrips

Calculate per-triangle IMT's from per-texel data. This function is similar to , but it uses a float array to pass in the data, and it can calculate higher dimensional values than 4.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is ; otherwise, the value is .

bb172737 HRESULT D3DXComputeIMTFromPerTexelSignal([In] ID3DXMesh* pMesh,[In] unsigned int dwTextureIndex,[In] float* pfTexelSignal,[In] unsigned int uWidth,[In] unsigned int uHeight,[In] unsigned int uSignalDimension,[In] unsigned int uComponents,[In] unsigned int dwOptions,[In] __function__stdcall* pStatusCallback,[In] void* pUserContext,[In] ID3DXBuffer** ppIMTData) D3DXComputeIMTFromPerTexelSignal

Gets the size of the triangle patch.

Number of segments per edge to tessellate.

Pointer to a DWORD that contains the number of triangles in the patch.

Pointer to a DWORD that contains the number of vertices in the triangle patch.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , E_OUTOFMEMORY.

bb205476 HRESULT D3DXTriPatchSize([In] const float* pfNumSegs,[Out] unsigned int* pdwTriangles,[Out] unsigned int* pdwVertices) D3DXTriPatchSize

Computes unit normals for each vertex in a mesh. Provided to support legacy applications. Use for better results.

No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The input mesh must have the flag specified in its flexible vertex format (FVF).

A normal for a vertex is generated by averaging the normals of all faces that share that vertex.

If adjacency is provided, replicated vertices are ignored and "smoothed" over. If adjacency is not provided, replicated vertices will have normals averaged in from only the faces explicitly referencing them.

This function simply calls with the following input parameters:

 ( pMesh, D3DX_DEFAULT, 0, D3DX_DEFAULT, 0, D3DX_DEFAULT, 0, , 0,  | , pAdjacency, -1.01f, -0.01f, -1.01f, null, null);	
            
bb172742 HRESULT D3DXComputeNormals([In] ID3DXBaseMesh* pMesh,[In] const unsigned int* pAdjacency) D3DXComputeNormals

Disassemble a shader.

Note??Instead of using this legacy function, we recommend that you use the API.

No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

bb172820 HRESULT D3DXDisassembleShader([In] const void* pShader,[In] BOOL EnableColorCode,[In] const char* pComments,[In] ID3DXBuffer** ppDisassembly) D3DXDisassembleShader

Preprocesses a shader without performing compilation. This resolves all #defines and #includes, providing a self-contained shader for subsequent compilation.

Note??Instead of using this legacy function, we recommend that you use the API.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

bb205398 HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) D3DXPreprocessShader

Compile a shader file.

Note??Instead of using this legacy function, we recommend that you compile offline by using the Fxc.exe command-line compiler or use the API.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_NOTIMPL, E_OUTOFMEMORY.

E_NOTIMPL is returned if you're using 1.1 shaders (vs_1_1and ps_1_1).

bb172732 HRESULT D3DXCompileShaderFromFileW([In] const wchar_t* pSrcFile,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) D3DXCompileShaderFromFileW

Creates a texture shader object from the compiled shader.

Pointer to the function DWORD stream.

Returns an object which can be used to procedurally fill the contents of a texture using the functions.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

bb172808 HRESULT D3DXCreateTextureShader([In] const unsigned int* pFunction,[In] ID3DXTextureShader** ppTextureShader) D3DXCreateTextureShader

Get the semantics for all shader output elements.

Pointer to the shader function DWORD stream.

Pointer to an array of structures. The function will fill this array with the semantics for each output element referenced by the shader. This array is assumed to contain at least MAXD3DDECLLENGTH elements. However, calling with pSemantics = null will return the number of elements needed for pCount.

Returns the number of elements in pSemantics.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

bb172873 HRESULT D3DXGetShaderOutputSemantics([In] const void* pFunction,[In, Out, Buffer] D3DXSEMANTIC* pSemantics,[InOut] unsigned int* pCount) D3DXGetShaderOutputSemantics

Gets the semantics for the shader inputs. Use this method to determine the input vertex format.

Pointer to the shader function DWORD stream.

Pointer to an array of structures. The function will fill this array with the semantics for each input element referenced by the shader. This array is assumed to contain at least MAXD3DDECLLENGTH elements. However, calling with pSemantics = null will return the number of elements needed for pCount.

Returns the number of elements in pSemantics.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

Use to return a list of input semantics required by the shader. This is the way to find out what the input vertex format is for a high-level shader language (HLSL) shader. If the shader has additional inputs that your vertex declaration is missing, you could create an extra vertex stream that has a stride of 0 that has the missing components with default values. For instance, this technique could be used to provide default vertex color for models that do not specify it.

bb172872 HRESULT D3DXGetShaderInputSemantics([In] const void* pFunction,[In, Out, Buffer] D3DXSEMANTIC* pSemantics,[InOut] unsigned int* pCount) D3DXGetShaderInputSemantics

Returns the name of the highest high-level shader language (HLSL) profile supported by a given device.

Pointer to the device. See .

The HLSL profile name.

If the device does not support pixel shaders then the function returns null.

A shader profile specifies the assembly shader version to use and the capabilities available to the HLSL compiler when compiling a shader. The following table lists the pixel shader profiles that are supported.

Shader ProfileDescription
ps_1_1Compile to ps_1_1 version.
ps_1_2Compile to ps_1_2 version.
ps_1_3Compile to ps_1_3 version.
ps_1_4Compile to ps_1_4 version.
ps_2_0Compile to ps_2_0 version.
ps_2_aSame as the ps_2_0 profile, with the following additional capabilities available for the compiler to target:
  • Number of Temporary Registers (r#) is greater than or equal to 22.
  • Arbitrary source swizzle.
  • Gradient instructions: dsx, dsy.
  • Predication.
  • No dependent texture read limit.
  • No limit for the number of texture instructions.
ps_2_bSame as the ps_2_0 profile, with the following additional capabilities available for the compiler to target:
  • Number of Temporary Registers (r#) is greater than or equal to 32.
  • No limit for the number of texture instructions.
ps_3_0Compile to ps_3_0 version.

?

For more information about the differences between shader versions, see Pixel Shader Differences.

bb172870 const char* D3DXGetPixelShaderProfile([In] IDirect3DDevice9* pDevice) D3DXGetPixelShaderProfile

Searches through a shader for a particular comment. The comment is identified by a four-character code (FOURCC) in the first DWORD of the comment.

Pointer to the shader function DWORD stream.

FOURCC code that identifies the comment block. See FourCC Formats.

Returns a reference to the comment data (not including the comment token and FOURCC code). This value can be null.

Returns the size of the comment data in bytes. This value can be null.

If the function succeeds, the return value is . If the comment is not found, and no other error has occurred, S_FALSE is returned.

bb172838 HRESULT D3DXFindShaderComment([In] const void* pFunction,[In] unsigned int FourCC,[Out] const void** ppData,[Out] unsigned int* pSizeInBytes) D3DXFindShaderComment

Assemble a shader.

Handle to a module containing the effect description. If this parameter is null, the current module will be used.

Pointer to a string that specifies the resource name. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

An optional null terminated array of structures. This value may be null.

Optional interface reference, , to use for handling #include directives. If this value is null, #includes will either be honored when compiling from a file or will cause an error when compiled from a resource or memory.

Compile options identified by various flags. The Direct3D 10 HLSL compiler is now the default. See Flags for details.

Returns a buffer containing the created shader. This buffer contains the compiled shader code, as well as any embedded debug and symbol table information.

Returns a buffer containing a listing of errors and warnings that were encountered during the compile. These are the same messages the debugger displays when running in debug mode. This value may be null.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXAssembleShaderFromResourceA because ANSI strings are being used.

bb172709 HRESULT D3DXAssembleShaderFromResourceW([In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs) D3DXAssembleShaderFromResourceW

Assemble a shader.

Pointer to a memory buffer that contains the shader data.

Length of the effect data, in bytes.

An optional null terminated array of structures. This value may be null.

Optional interface reference, , to use for handling #include directives. If this value is null, #includes will either be honored when compiling from a file or will cause an error when compiled from a resource or memory.

Compile options identified by various flags. The Direct3D 10 HLSL compiler is now the default. See Flags for details.

Returns a buffer containing the created shader. This buffer contains the compiled shader code, as well as any embedded debug and symbol table information.

Returns a buffer containing a listing of errors and warnings that were encountered during the compile. These are the same messages the debugger displays when running in debug mode. This value may be null.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

bb172707 HRESULT D3DXAssembleShader([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs) D3DXAssembleShader

Compile a shader file.

Note??Instead of using this legacy function, we recommend that you compile offline by using the Fxc.exe command-line compiler or use the API.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

bb172731 HRESULT D3DXCompileShader([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) D3DXCompileShader

Get the sampler names referenced in a shader.

Pointer to the shader function DWORD stream.

Pointer to an array of LPCSTRs. The function will fill this array with references to the sampler names contained within pFunction. The maximum array size is the maximum number of sampler registers (16 for vs_3_0 and ps_3_0).

To find the number of samplers used, check pCount after calling with pSamplers = null.

Returns the number of samplers referenced by the shader.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

bb172874 HRESULT D3DXGetShaderSamplers([In] const void* pFunction,[In, Out, Buffer] const void** pSamplers,[InOut] unsigned int* pCount) D3DXGetShaderSamplers

Gets the shader-constant table embedded inside a shader.

Pointer to the function DWORD stream.

Returns the constant table interface (see ) that manages the constant table.

A constant table is generated by and embedded in the shader body. If you need additional virtual address space, see .

bb172871 HRESULT D3DXGetShaderConstantTable([In] const void* pFunction,[Out] ID3DXConstantTable** ppConstantTable) D3DXGetShaderConstantTable

Assemble a shader.

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

An optional null terminated array of structures. This value may be null.

Optional interface reference, , to use for handling #include directives. If this value is null, #includes will either be honored when compiling from a file or will cause an error when compiled from a resource or memory.

Compile options identified by various flags. The Direct3D 10 HLSL compiler is now the default. See Flags for details.

Returns a buffer containing the created shader. This buffer contains the compiled shader code, as well as any embedded debug and symbol table information.

Returns a buffer containing a listing of errors and warnings that were encountered during the compile. These are the same messages the debugger displays when running in debug mode. This value may be null.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXAssembleShaderFromFileA because ANSI strings are being used.

bb172708 HRESULT D3DXAssembleShaderFromFileW([In] const wchar_t* pSrcFile,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs) D3DXAssembleShaderFromFileW

Gets the shader-constant table embedded inside a shader.

Pointer to the function DWORD stream.

Use the D3DXCONSTTABLE_LARGEADDRESSAWARE flag to access up to 4 GB of virtual address space (instead of the default of 2 GB). If you do not need the additional virtual address space, use .

Returns the constant table interface (see ) that manages the constant table.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

A constant table is generated by and embedded in the shader body.

bb943959 HRESULT D3DXGetShaderConstantTableEx([In] const void* pFunction,[In] unsigned int Flags,[In] ID3DXConstantTable** ppConstantTable) D3DXGetShaderConstantTableEx

Returns the name of the highest high-level shader language (HLSL) profile supported by a given device.

Pointer to the device. See .

The HLSL profile name.

If the device does not support vertex shaders then the function returns null.

A shader profile specifies the assembly shader version to use and the capabilities available to the HLSL compiler when compiling a shader. The following table lists the vertex shader profiles that are supported.

Shader ProfileDescription
vs_1_1Compile to vs_1_1 version.
vs_2_0Compile to vs_2_0 version.
vs_2_aSame as the vs_2_0 profile, with the following additional capabilities available for the compiler to target:
  • Number of Temporary Registers (r#) is greater than or equal to 13.
  • Dynamic flow control instruction.
  • Predication.
vs_3_0Compile to vs_3_0 version.

?

For more information about the differences between shader versions, see Vertex Shader Differences.

bb172877 const char* D3DXGetVertexShaderProfile([In] IDirect3DDevice9* pDevice) D3DXGetVertexShaderProfile

Preprocesses a shader resource without performing compilation. This resolves all #defines and #includes, providing a self-contained shader for subsequent compilation.

Note??Instead of using this legacy function, we recommend that you use the API.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

bb205400 HRESULT D3DXPreprocessShaderFromResourceW([In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) D3DXPreprocessShaderFromResourceW

Compile a shader file.

Note??Instead of using this legacy function, we recommend that you compile offline by using the Fxc.exe command-line compiler or use the API.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

bb172733 HRESULT D3DXCompileShaderFromResourceW([In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) D3DXCompileShaderFromResourceW

Preprocesses a shader file without performing compilation. This resolves all #defines and #includes, providing a self-contained shader for subsequent compilation.

Note??Instead of using this legacy function, we recommend that you use the API.

No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

bb205399 HRESULT D3DXPreprocessShaderFromFileW([In] const wchar_t* pSrcFile,[In, Buffer, Optional] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) D3DXPreprocessShaderFromFileW

Returns the size of the shader byte code, in bytes.

Pointer to the function DWORD stream.

Returns the size of the shader byte code, in bytes.

bb172875 unsigned int D3DXGetShaderSize([In] const void* pFunction) D3DXGetShaderSize

Returns the shader version of the compiled shader.

Pointer to the function DWORD stream.

Returns the shader version of the given shader, or zero if the shader function is null.

bb172876 unsigned int D3DXGetShaderVersion([In] const void* pFunction) D3DXGetShaderVersion

Uses a left-handed coordinate system to create a mesh containing a cylinder.

Pointer to an interface, representing the device associated with the created cylinder mesh.

Radius at the negative Z end. Value should be greater than or equal to 0.0f.

Radius at the positive Z end. Value should be greater than or equal to 0.0f.

Length of the cylinder along the z-axis.

Number of slices about the main axis.

Number of stacks along the main axis.

Address of a reference to the output shape, an interface.

Address of a reference to an interface. When the method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh. null can be specified.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The created cylinder is centered at the origin, and its axis is aligned with the z-axis.

This function creates a mesh with the creation option and | flexible vertex format (FVF).

bb172762 HRESULT D3DXCreateCylinder([In] IDirect3DDevice9* pDevice,[In] float Radius1,[In] float Radius2,[In] float Length,[In] unsigned int Slices,[In] unsigned int Stacks,[In] ID3DXMesh** ppMesh,[In] ID3DXBuffer** ppAdjacency) D3DXCreateCylinder

Uses a left-handed coordinate system to create a mesh containing a torus.

Pointer to an interface, representing the device associated with the created torus mesh.

Inner-radius of the torus. Value should be greater than or equal to 0.0f.

Outer-radius of the torus. Value should be greater than or equal to 0.0f.

Number of sides in a cross-section. Value must be greater than or equal to 3.

Number of rings making up the torus. Value must be greater than or equal to 3.

Address of a reference to the output shape, an interface.

Address of a reference to an interface. When the method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh. null can be specified.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The created torus is centered at the origin, and its axis is aligned with the z-axis. The inner radius of the torus is the radius of the cross-section (the minor radius), and the outer radius of the torus is the radius of the central hole.

This function returns a mesh that can be used later for drawing or manipulation by the application.

This function creates a mesh with the creation option and | flexible vertex format (FVF).

bb172809 HRESULT D3DXCreateTorus([In] IDirect3DDevice9* pDevice,[In] float InnerRadius,[In] float OuterRadius,[In] unsigned int Sides,[In] unsigned int Rings,[In] ID3DXMesh** ppMesh,[In] ID3DXBuffer** ppAdjacency) D3DXCreateTorus

Uses a left-handed coordinate system to create a mesh containing a sphere.

Pointer to an interface, representing the device associated with the created sphere mesh.

Radius of the sphere. This value should be greater than or equal to 0.0f.

Number of slices about the main axis.

Number of stacks along the main axis.

Address of a reference to the output shape, an interface.

Address of a reference to an interface. When the method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh. null can be specified.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The created sphere is centered at the origin, and its axis is aligned with the z-axis.

This function creates a mesh with the creation option and | flexible vertex format (FVF).

bb172795 HRESULT D3DXCreateSphere([In] IDirect3DDevice9* pDevice,[In] float Radius,[In] unsigned int Slices,[In] unsigned int Stacks,[In] ID3DXMesh** ppMesh,[In] ID3DXBuffer** ppAdjacency) D3DXCreateSphere

Uses a left-handed coordinate system to create a mesh containing a teapot.

Pointer to an interface, representing the device associated with the created teapot mesh.

Address of a reference to the output shape, an interface.

Address of a reference to an interface. When the method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh. null can be specified.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

This function creates a mesh with the creation option and | flexible vertex format (FVF).

bb172798 HRESULT D3DXCreateTeapot([In] IDirect3DDevice9* pDevice,[In] ID3DXMesh** ppMesh,[In] ID3DXBuffer** ppAdjacency) D3DXCreateTeapot

Uses a left-handed coordinate system to create a mesh containing an axis-aligned box.

Pointer to an interface, representing the device associated with the created box mesh.

Width of the box, along the x-axis.

Height of the box, along the y-axis.

Depth of the box, along the z-axis.

Address of a reference to the output shape, an interface.

Address of a reference to an interface. When the method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh. null can be specified.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The created box is centered at the origin.

This function creates a mesh with the creation option and | flexible vertex format (FVF).

bb172752 HRESULT D3DXCreateBox([In] IDirect3DDevice9* pDevice,[In] float Width,[In] float Height,[In] float Depth,[In] ID3DXMesh** ppMesh,[In] ID3DXBuffer** ppAdjacency) D3DXCreateBox

Uses a left-handed coordinate system to create a mesh containing an n-sided polygon.

Pointer to an interface, representing the device associated with the created polygon mesh.

Length of each side.

Number of sides for the polygon. Value must be greater than or equal to 3.

Address of a reference to the output shape, an interface.

Address of a reference to an interface. When the method returns, this parameter is filled with an array of three DWORDs per face that specify the three neighbors for each face in the mesh. null can be specified.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The created polygon is centered at the origin.

This function creates a mesh with the creation option and | flexible vertex format (FVF).

bb172785 HRESULT D3DXCreatePolygon([In] IDirect3DDevice9* pDevice,[In] float Length,[In] unsigned int Sides,[In] ID3DXMesh** ppMesh,[In] ID3DXBuffer** ppAdjacency) D3DXCreatePolygon

Creates a mesh containing the specified text, using the font associated with the device context.

Pointer to the device that created the mesh.

Device context, containing the font for output. The font selected by the device context must be a TrueType font.

Pointer to a string that specifies the text to generate. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Maximum chordal deviation from TrueType font outlines.

Amount to extrude text in the negative z-direction.

Pointer to the returned mesh.

Pointer to a buffer containing adjacency information. May be null.

Pointer to an array of GLYPHMETRICSFLOAT structures that contain the glyph metric data. Each element contains information about the position and orientation of the corresponding glyph in the string. The number of elements in the array should be equal to the number of characters in the string. Note that the origin in each structure is not relative to the entire string, but rather is relative to that character cell. To compute the entire bounding box, add the increment for each glyph while traversing the string. If you are not concerned with the glyph sizes, set this parameter to null.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateTextA because ANSI strings are being used.

This function creates a mesh with the creation option and | flexible vertex format (FVF).

bb172799 HRESULT D3DXCreateTextW([In] IDirect3DDevice9* pDevice,[In] HDC hDC,[In] const wchar_t* pText,[In] float Deviation,[In] float Extrusion,[In] ID3DXMesh** ppMesh,[In] ID3DXBuffer** ppAdjacency,[In] LPGLYPHMETRICSFLOAT pGlyphMetrics) D3DXCreateTextW

Retrieves information about a given image file in memory.

VOID reference to the source file in memory.

Size of file in memory, in bytes. .

Pointer to a structure to be filled with the description of the data in the source file.

bb172868 HRESULT D3DXGetImageInfoFromFileInMemory([In] const void* pSrcData,[In] unsigned int SrcDataSize,[Out] D3DXIMAGE_INFO* pSrcInfo) D3DXGetImageInfoFromFileInMemory

Uses a compiled high-level shader language (HLSL) function to fill each texel of each mipmap level of a texture.

Pointer to an object, representing the texture to be filled.

Pointer to a texture shader object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following:D3DERR_NOTAVAILABLE, .

The texture target must be an HLSL function that takes contains the following semantics:

  • One input parameter must use a POSITION semantic.
  • One input parameter must use a PSIZE semantic.
  • The function must return a parameter that uses the COLOR semantic.

The input parameters can be in any order. For an example, see

bb172836 HRESULT D3DXFillVolumeTextureTX([In] IDirect3DVolumeTexture9* pVolumeTexture,[In] ID3DXTextureShader* pTextureShader) D3DXFillVolumeTextureTX

Creates an empty cube texture, adjusting the calling parameters as needed.

Pointer to an interface, representing the device to be associated with the texture.

Width and height of the cube texture, in pixels. For example, if the cube texture is an 8-pixel by 8-pixel cube, the value for this parameter should be 8.

Number of mip levels requested. If this value is zero or D3DX_DEFAULT, a complete mipmap chain is created.

0, , or . Setting this flag to indicates that the surface is to be used as a render target. The resource can then be passed to the pNewRenderTarget parameter of the SetRenderTarget method. If is specified, the application should check that the device supports this operation by calling CheckDeviceFormat. For more information about using dynamic textures, see Using Dynamic Textures.

Member of the enumerated type, describing the requested pixel format for the cube texture. The returned cube texture might have a different format from that specified by Format. Applications should check the format of the returned cube texture.

Member of the enumerated type, describing the memory class into which the cube texture should be placed.

Address of a reference to an interface, representing the created cube texture object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , E_OUTOFMEMORY.

Cube textures differ from other surfaces in that they are collections of surfaces.

Internally, uses to adjust the calling parameters. Therefore, calls to will often succeed where calls to CreateCubeTexture would fail.

bb172755 HRESULT D3DXCreateCubeTexture([In] IDirect3DDevice9* pDevice,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] IDirect3DCubeTexture9** ppCubeTexture) D3DXCreateCubeTexture

Creates a volume texture from a file. This is a more advanced function than .

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

When skipping mipmap levels while loading a .dds file, use the D3DX_SKIP_DDS_MIP_LEVELS macro to generate the MipFilter value. This macro takes the number of levels to skip and the filter type and returns the filter value, which would then be passed into the MipFilter parameter.

bb172814 HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Depth,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) D3DXCreateVolumeTextureFromFileInMemoryEx

Uses a compiled high-level shader language (HLSL) function to fill each texel of each mipmap level of a texture.

Pointer to an object, representing the texture to be filled.

Pointer to a texture shader object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , .

The texture target must be an HLSL function that takes contains the following semantics:

  • One input parameter must use a POSITION semantic.
  • One input parameter must use a PSIZE semantic.
  • The function must return a parameter that uses the COLOR semantic.

The following is an example of such an HLSL function:

 float4 TextureGradientFill( float2 vTexCoord : POSITION,  float2 vTexelSize : PSIZE) : COLOR  { float r,g, b, xSq,ySq, a; xSq = 2.f*vTexCoord.x-1.f; xSq *= xSq; ySq = 2.f*vTexCoord.y-1.f; ySq *= ySq; a = sqrt(xSq+ySq); if (a > 1.0f) { a = 1.0f-(a-1.0f); } else if (a < 0.2f) { a = 0.2f; } r = 1-vTexCoord.x; g = 1-vTexCoord.y; b = vTexCoord.x; return float4(r, g, b, a); };	
            

Note that the input parameters can be in any order, but both input semantics must be represented.

bb172834 HRESULT D3DXFillTextureTX([In] IDirect3DTexture9* pTexture,[In] ID3DXTextureShader* pTextureShader) D3DXFillTextureTX

Checks cube-texture-creation parameters.

Pointer to an interface, representing the device to be associated with the cube texture.

Pointer to the requested width and height in pixels, or null. Returns the corrected size.

Pointer to the number of requested mipmap levels, or null. Returns the corrected number of mipmap levels.

0 or . Setting this flag to indicates that the surface is to be used as a render target. The resource can then be passed to the pNewRenderTarget parameter of the SetRenderTarget method. If is specified, the application should check that the device supports this operation by calling CheckDeviceFormat.

Pointer to a member of the enumerated type. Specifies the desired pixel format, or null. Returns the corrected format.

Member of the enumerated type, describing the memory class into which the texture should be placed.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , .

If parameters to this function are invalid, this function returns corrected parameters.

Cube textures differ from other surfaces in that they are collections of surfaces. To call SetRenderTarget with a cube texture, you must select an individual face using GetCubeMapSurface and pass the resulting surface to SetRenderTarget.

bb172715 HRESULT D3DXCheckCubeTextureRequirements([In] IDirect3DDevice9* pDevice,[InOut] unsigned int* pSize,[InOut] unsigned int* pNumMipLevels,[In] unsigned int Usage,[InOut] D3DFORMAT* pFormat,[In] D3DPOOL Pool) D3DXCheckCubeTextureRequirements

Creates a texture from a file.

Pointer to an interface, representing the device to be associated with the texture.

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Address of a reference to an interface, representing the created texture object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateTextureFromFileA because ANSI strings are being used.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

The function is equivalent to (pDevice, pSrcFile, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppTexture).

Mipmapped textures automatically have each level filled with the loaded texture.

When loading images into mipmapped textures, some devices are unable to go to a 1x1 image and this function will fail. If this happens, the images need to be loaded manually.

Note that a resource created with this function will be placed in the memory class denoted by .

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

For the best performance when using :

  1. Doing image scaling and format conversion at load time can be slow. Store images in the format and resolution they will be used. If the target hardware requires power of two dimensions, create and store images using power of two dimensions.
  2. Consider using DirectDraw surface (DDS) files. Because DDS files can be used to represent any Direct3D 9 texture format, they are very easy for D3DX to read. Also, they can store mipmaps, so any mipmap-generation algorithms can be used to author the images.
bb172801 HRESULT D3DXCreateTextureFromFileW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] IDirect3DTexture9** ppTexture) D3DXCreateTextureFromFileW

Loads a surface from a file.

Pointer to an interface. Specifies the destination surface, which receives the image.

Pointer to a structure, the destination palette of 256 colors or null.

Pointer to a structure. Specifies the destination rectangle. Set this parameter to null to specify the entire surface.

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Pointer to a structure. Specifies the source rectangle. Set this parameter to null to specify the entire image.

Combination of one or more controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

value to replace with transparent black, or 0 to disable the 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 color keys Thus, for opaque black, the value would be equal to 0xFF000000.

Pointer to a structure to be filled with a description of the data in the source image file, or null.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , D3DXERR_INVALIDDATA.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXLoadSurfaceFromFileA because ANSI strings are being used.

This function handles conversion to and from compressed texture formats and supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Writing to a non-level-zero surface will not cause the dirty rectangle to be updated. If is called and the surface was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call AddDirtyRect on the surface.

bb172900 HRESULT D3DXLoadSurfaceFromFileW([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const wchar_t* pSrcFile,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) D3DXLoadSurfaceFromFileW

Uses a user-provided function to fill each texel of each mip level of a given cube texture.

Pointer to an interface, representing the filled texture.

Pointer to a user-provided evaluator function, which will be used to compute the value of each texel. The function follows the prototype of LPD3DXFILL3D.

Pointer to an arbitrary block of user-defined data. This reference will be passed to the function provided in pFunction.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: .

Here is an example that creates a function called ColorCubeFill, which relies on .

 // Define a function that matches the prototype of LPD3DXFILL3D	
            VOID WINAPI ColorCubeFill (* pOut, const * pTexCoord, 	
            const * pTexelSize, LPVOID pData)	
            { *pOut = (pTexCoord->x, pTexCoord->y, pTexCoord->z, 0.0f);	
            } // Fill the texture using 	
            if (FAILED (hr =  (m_pTexture, ColorCubeFill, null)))	
            { return hr;	
            }	
            
bb172831 HRESULT D3DXFillCubeTexture([In] IDirect3DCubeTexture9* pCubeTexture,[In] __function__stdcall* pFunction,[In] void* pData) D3DXFillCubeTexture

Creates an empty volume texture, adjusting the calling parameters as needed.

Pointer to an interface, representing the device to be associated with the volume texture.

Width in pixels. This value must be nonzero. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

Height in pixels. This value must be nonzero. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

Depth in pixels. This value must be nonzero. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

Number of mip levels requested. If this value is zero or D3DX_DEFAULT, a complete mipmap chain is created.

0 or . For more information about using dynamic textures, see Using Dynamic Textures.

Member of the enumerated type, describing the requested pixel format for the volume texture. The returned volume texture might have a different format from that specified by Format. Applications should check the format of the returned volume texture.

Member of the enumerated type, describing the memory class into which the volume texture should be placed.

Address of a reference to an interface, representing the created volume texture object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , E_OUTOFMEMORY .

Internally, uses to adjust the calling parameters. Therefore, calls to will often succeed where calls to CreateVolumeTexture would fail.

bb172810 HRESULT D3DXCreateVolumeTexture([In] IDirect3DDevice9* pDevice,[In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Depth,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] IDirect3DVolumeTexture9** ppVolumeTexture) D3DXCreateVolumeTexture

Loads a volume from a file.

Pointer to an interface. Specifies the destination volume.

Pointer to a structure, the destination palette of 256 colors or null.

Pointer to a structure. Specifies the destination box. Set this parameter to null to specify the entire volume.

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Pointer to a structure. Specifies the source box. Set this parameter to null to specify the entire volume.

Combination of one or more , controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

value to replace with transparent black, or 0 to disable the 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 color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

Pointer to a structure to be filled with a description of the data in the source image file, or null.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , D3DXERR_INVALIDDATA.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXLoadVolumeFromFileA because ANSI strings are being used.

This function handles conversion to and from compressed texture formats and supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Writing to a non-level-zero surface of the volume texture will not cause the dirty rectangle to be updated. If is called and the texture was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call on the volume texture.

bb172905 HRESULT D3DXLoadVolumeFromFileW([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const wchar_t* pSrcFile,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) D3DXLoadVolumeFromFileW
No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT D3DXLoadSurfaceFromResourceW([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) D3DXLoadSurfaceFromResourceW

Creates a texture from a file. This is a more advanced function than .

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateTextureFromFileExA because ANSI strings are being used.

Use to determine if your device can support the texture given the current state.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Mipmapped textures automatically have each level filled with the loaded texture. When loading images into mipmapped textures, some devices are unable to go to a 1x1 image and this function will fail. If this happens, then the images need to be loaded manually.

For the best performance when using :

  1. Doing image scaling and format conversion at load time can be slow. Store images in the format and resolution they will be used. If the target hardware requires power of 2 dimensions, then create and store images using power of 2 dimensions.
  2. For mipmap image creation at load time, filter using . A box filter is much faster than other filter types such as .
  3. Consider using DDS files. Since DDS files can be used to represent any Direct3D 9 texture format, they are very easy for D3DX to read. Also, they can store mipmaps, so any mipmap-generation algorithms can be used to author the images.

When skipping mipmap levels while loading a .dds file, use the D3DX_SKIP_DDS_MIP_LEVELS macro to generate the MipFilter value. This macro takes the number of levels to skip and the filter type and returns the filter value, which would then be passed into the MipFilter parameter.

bb172802 HRESULT D3DXCreateTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Width,[In] unsigned int Height,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) D3DXCreateTextureFromFileExW

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.

Pointer to an interface, representing the destination texture.

Pointer to an interface, representing the source height-map texture.

Pointer to a type that contains the source palette of 256 colors or null.

One or more flags that control generation of normal maps.

One flag specifying the source of height information.

Constant value multiplier that increases (or decreases) the values in the normal map. Higher values usually make bumps more visible, lower values usually make bumps less visible.

If the function succeeds, the return value is . If the function fails, the return value can be the following value: .

This method computes the normal by using the central difference with a kernel size of 3x3. The central differencing denominator used is 2.0. RGB channels in the destination contain biased (x,y,z) components of the normal.

bb172741 HRESULT D3DXComputeNormalMap([In] IDirect3DTexture9* pTexture,[In] IDirect3DTexture9* pSrcTexture,[Out, Buffer] const PALETTEENTRY* pSrcPalette,[In] unsigned int Flags,[In] unsigned int Channel,[In] float Amplitude) D3DXComputeNormalMap

Checks volume-texture-creation parameters.

Pointer to an interface, representing the device to be associated with the volume texture.

Pointer to the requested width in pixels, or null. Returns the corrected size.

Pointer to the requested height in pixels, or null. Returns the corrected size.

Pointer to the requested depth in pixels, or null. Returns the corrected size.

Pointer to the number of requested mipmap levels, or null. Returns the corrected number of mipmap levels.

Currently not used, set to 0.

Pointer to a member of the enumerated type. Specifies the desired pixel format, or null. Returns the corrected format.

Member of the enumerated type, describing the memory class into which the volume texture should be placed.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , .

If parameters to this function are invalid, this function returns corrected parameters.

bb172718 HRESULT D3DXCheckVolumeTextureRequirements([In] IDirect3DDevice9* pDevice,[InOut] unsigned int* pWidth,[InOut] unsigned int* pHeight,[InOut] unsigned int* pDepth,[InOut] unsigned int* pNumMipLevels,[In] unsigned int Usage,[InOut] D3DFORMAT* pFormat,[In] D3DPOOL Pool) D3DXCheckVolumeTextureRequirements
No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) D3DXLoadSurfaceFromFileInMemory

Creates a texture from a file in memory.

Pointer to an interface representing the device to be associated with the texture.

Pointer to the file in memory from which to create the texture.

Size in bytes of the file in memory.

Address of a reference to an interface representing the created texture object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The function is equivalent to (pDevice, pSrcData, SrcDataSize, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppTexture).

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Note that a resource created with this function when called from a object will be placed in the memory class denoted by . When this method is called from a object the resource will be placed in the memory class denoted by .

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

bb172803 HRESULT D3DXCreateTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DTexture9** ppTexture) D3DXCreateTextureFromFileInMemory

Creates a cube texture from a resource specified by a string. This is a more advanced function than .

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The compiler setting determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateCubeTextureFromResourceExA because ANSI strings are being used.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Cube textures differ from other surfaces in that they are collections of surfaces. To call SetRenderTarget with a cube texture, you must select an individual face using GetCubeMapSurface and pass the resulting surface to SetRenderTarget.

uses the DirectDraw surface (DDS) file format. The DirectX Texture Editor (Dxtex.exe) enables you to generate a cube map from other file formats and save it in the DDS file format.

bb172761 HRESULT D3DXCreateCubeTextureFromResourceExW([In] IDirect3DDevice9* pDevice,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo,[In] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) D3DXCreateCubeTextureFromResourceExW

Creates a volume texture from a file in memory.

Pointer to an interface, representing the device to be associated with the volume texture.

Pointer to the file in memory from which to create the volume texture.

Size of the file in memory, in bytes.

Address of a reference to an interface, representing the created texture object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

The function is equivalent to (pDevice, pSrcFile, SrcData, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppVolumeTexture).

Note that a resource created with this function when called from a object will be placed in the memory class denoted by . When this method is called from a object the resource will be placed in the memory class denoted by .

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

bb172813 HRESULT D3DXCreateVolumeTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DVolumeTexture9** ppVolumeTexture) D3DXCreateVolumeTextureFromFileInMemory

Loads a volume from another volume.

Pointer to an interface. Specifies the destination volume, which receives the image.

Pointer to a structure, the destination palette of 256 colors or null.

Pointer to a structure. Specifies the destination box. Set this parameter to null to specify the entire volume.

A Pointer to an interface. Specifies the source volume.

Pointer to a structure, the source palette of 256 colors or null.

Pointer to a structure. Specifies the source box. Set this parameter to null to specify the entire volume.

A combination of one or more , controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

value to replace with transparent black, or 0 to disable the 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 color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

Writing to a non-level-zero surface of the volume texture will not cause the dirty rectangle to be updated. If is called and the surface was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call on the surface.

bb172909 HRESULT D3DXLoadVolumeFromVolume([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] IDirect3DVolume9* pSrcVolume,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey) D3DXLoadVolumeFromVolume

Saves a texture to a file.

Pointer to a string that specifies the file name of the destination image. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

specifying the file format to use when saving. This function supports saving to all formats except Portable Pixmap (.ppm) and Targa/Truevision Graphics Adapter (.tga).

Pointer to interface, containing the texture to be saved.

Pointer to a structure containing a palette of 256 colors. This parameter can be null.

If the function succeeds, the return value is . If the function fails, the return value can be the following:

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXSaveTextureToFileA because ANSI strings are being used.

This function handles conversion to and from compressed texture formats.

If the volume is nondynamic (because of a usage parameter set to 0 at the creation) and located in video memory (the memory pool set to ), will fail because D3DX cannot lock nondynamic volumes located in video memory.

bb205433 HRESULT D3DXSaveTextureToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DBaseTexture9* pSrcTexture,[In, Buffer] const PALETTEENTRY* pSrcPalette) D3DXSaveTextureToFileW

Creates a texture from a file.

Pointer to an interface, representing the device to be associated with the texture.

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Address of a reference to an interface, representing the created texture object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateTextureFromFileA because ANSI strings are being used.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

The function is equivalent to (pDevice, pSrcFile, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppTexture).

Mipmapped textures automatically have each level filled with the loaded texture.

When loading images into mipmapped textures, some devices are unable to go to a 1x1 image and this function will fail. If this happens, the images need to be loaded manually.

Note that a resource created with this function will be placed in the memory class denoted by .

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

For the best performance when using :

  1. Doing image scaling and format conversion at load time can be slow. Store images in the format and resolution they will be used. If the target hardware requires power of two dimensions, create and store images using power of two dimensions.
  2. Consider using DirectDraw surface (DDS) files. Because DDS files can be used to represent any Direct3D 9 texture format, they are very easy for D3DX to read. Also, they can store mipmaps, so any mipmap-generation algorithms can be used to author the images.
bb172801 HRESULT D3DXCreateCubeTextureFromFileW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] IDirect3DCubeTexture9** ppCubeTexture) D3DXCreateCubeTextureFromFileW

Creates a cube texture from a file in memory. This is a more advanced function than .

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Cube textures differ from other surfaces in that they are collections of surfaces. To call SetRenderTarget with a cube texture, you must select an individual face using GetCubeMapSurface and pass the resulting surface to SetRenderTarget .

This method is designed to be used for loading image files stored as RT_RCDATA, which is an application-defined resource (raw data). Otherwise this method will fail.

For details on , see the Platform SDK. Note that as of DirectX 8.0, the peFlags member of the structure does not function as documented in the Platform SDK. The peFlags member is now the alpha channel for 8-bit palettized formats.

uses the DirectDraw surface (DDS) file format. The DirectX Texture Editor (Dxtex.exe) enables you to generate a cube map from other file formats and save it in the DDS file format

When skipping mipmap levels while loading a .dds file, use the D3DX_SKIP_DDS_MIP_LEVELS macro to generate the MipFilter value. This macro takes the number of levels to skip and the filter type and returns the filter value, which would then be passed into the MipFilter parameter.

bb172759 HRESULT D3DXCreateCubeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) D3DXCreateCubeTextureFromFileInMemoryEx

Creates a texture from a resource. This is a more advanced function than .

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateTextureFromResourceExA because ANSI strings are being used.

The resource being loaded must be of type RT_BITMAP or RT_RCDATA. Resource type RT_RCDATA is used to load formats other than bitmaps (such as .tga, .jpg, and .dds).

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

bb172806 HRESULT D3DXCreateTextureFromResourceExW([In] IDirect3DDevice9* pDevice,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In] unsigned int Width,[In] unsigned int Height,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo,[In] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) D3DXCreateTextureFromResourceExW

Retrieves information about a given image file.

File name of image to retrieve information about. If UNICODE or _UNICODE are defined, this parameter type is LPCWSTR, otherwise, the type is LPCSTR.

Pointer to a structure to be filled with the description of the data in the source file.

This function supports both Unicode and ANSI strings.

bb172867 HRESULT D3DXGetImageInfoFromFileW([In] const wchar_t* pSrcFile,[Out] D3DXIMAGE_INFO* pSrcInfo) D3DXGetImageInfoFromFileW
No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT D3DXFilterTexture([In] IDirect3DBaseTexture9* pBaseTexture,[In, Buffer] const PALETTEENTRY* pPalette,[In] unsigned int SrcLevel,[In] D3DX_FILTER Filter) D3DXFilterTexture

Loads a surface from memory.

Pointer to an interface. Specifies the destination surface, which receives the image.

Pointer to a structure, the destination palette of 256 colors or null.

Pointer to a structure. Specifies the destination rectangle. Set this parameter to null to specify the entire surface.

Pointer to the upper left corner of the source image in memory.

Member of the enumerated type, the pixel format of the source image.

Pitch of source image, in bytes. For DXT formats, this number should represent the width of one row of cells, in bytes.

Pointer to a structure, the source palette of 256 colors or null.

Pointer to a structure. Specifies the dimensions of the source image in memory. This value cannot be null.

Combination of one or more controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

value to replace with transparent black, or 0 to disable the 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 color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , D3DXERR_INVALIDDATA.

This function handles conversion to and from compressed texture formats.

Writing to a non-level-zero surface will not cause the dirty rectangle to be updated. If is called and the surface was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call AddDirtyRect on the surface.

bb172902 HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) D3DXLoadSurfaceFromMemory

Saves a texture to an image file.

specifying the file format to use when saving. This function supports saving to all formats except Portable Pixmap (.ppm) and Targa/Truevision Graphics Adapter (.tga).

Pointer to interface containing the image to be saved.

Pointer to a structure containing a palette of 256 colors. This parameter can be null.

Address of a reference to an that will store the image.

This function handles conversion to and from compressed texture formats.

bb205434 HRESULT D3DXSaveTextureToFileInMemory([Out] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DBaseTexture9* pSrcTexture,[In, Buffer] const PALETTEENTRY* pSrcPalette) D3DXSaveTextureToFileInMemory

Checks texture-creation parameters.

Pointer to an interface, representing the device to be associated with the texture.

Pointer to the requested width in pixels, or null. Returns the corrected size.

Pointer to the requested height in pixels, or null. Returns the corrected size.

Pointer to number of requested mipmap levels, or null. Returns the corrected number of mipmap levels.

0 or . Setting this flag to indicates that the surface is to be used as a render target. The resource can then be passed to the pNewRenderTarget parameter of the SetRenderTarget method. If is specified, the application should check that the device supports this operation by calling CheckDeviceFormat.

Pointer to a member of the enumerated type. Specifies the desired pixel format, or null. Returns the corrected format.

Member of the enumerated type, describing the memory class into which the texture should be placed.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , .

If parameters to this function are invalid, this function returns corrected parameters.

This function uses the following heuristics when comparing the requested requirements against available formats:

  • Do not choose a format that has fewer channels.
  • Avoid FOURCC And 24-bit formats unless explicitly requested.
  • Try not to add new channels.
  • Try not to change the number of bits per channel.
  • Try to avoid converting between types of formats. For instance, avoid converting an ARGB format to a depth format.
bb172716 HRESULT D3DXCheckTextureRequirements([In] IDirect3DDevice9* pDevice,[InOut] unsigned int* pWidth,[InOut] unsigned int* pHeight,[InOut] unsigned int* pNumMipLevels,[In] unsigned int Usage,[InOut] D3DFORMAT* pFormat,[In] D3DPOOL Pool) D3DXCheckTextureRequirements

Saves a volume to a file on disk.

Pointer to a string that specifies the file name of the destination image. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

specifying the file format to use when saving. This function supports saving to all formats except Portable Pixmap (.ppm) and Targa/Truevision Graphics Adapter (.tga).

Pointer to interface containing the image to be saved.

Pointer to a structure containing a palette of 256 colors. This parameter can be null.

Pointer to a structure. Specifies the source box. Set this parameter to null to specify the entire volume.

If the function succeeds, the return value is . If the function fails, the return value can be the following:

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to >D3DXSaveVolumeToFileA because ANSI strings are being used.

This function handles conversion to and from compressed texture formats.

If the volume is nondynamic (because of a usage parameter set to 0 at the creation) and located in video memory (the memory pool set to ), will fail because D3DX cannot lock nondynamic volumes located in video memory.

bb205435 HRESULT D3DXSaveVolumeToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox) D3DXSaveVolumeToFileW

Loads a volume from a resource.

Pointer to an interface. Specifies the destination volume.

Pointer to a structure, the destination palette of 256 colors or null.

Pointer to a structure. Specifies the destination box. Set this parameter to null to specify the entire volume.

Handle to the module where the resource is located, or null for module associated with the image the operating system used to create the current process.

Pointer to a string that specifies the file name of the source image. If UNICODE or _UNICODE are defined, this parameter type is LPCWSTR, otherwise, the type is LPCSTR.

Pointer to a structure. Specifies the source box. Set this parameter to null to specify the entire volume.

Combination of one or more , controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

value to replace with transparent black, or 0 to disable the 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 color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

Pointer to a structure to be filled with a description of the data in the source image file, or null.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , D3DXERR_INVALIDDATA.

The resource being loaded must be a bitmap resource(RT_BITMAP).

This function handles conversion to and from compressed texture formats.

Writing to a non-level-zero surface of the volume texture will not cause the dirty rectangle to be updated. If is called and the texture was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call on the volume texture.

This function supports both Unicode and ANSI strings.

bb172908 HRESULT D3DXLoadVolumeFromResourceW([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) D3DXLoadVolumeFromResourceW

Creates a volume texture from a resource specified by a string. This is a more advanced function than .

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateVolumeTextureFromResourceExA because ANSI strings are being used.

The resource being loaded must be an application-defined resource (RT_RCDATA).

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

bb172816 HRESULT D3DXCreateVolumeTextureFromResourceExW([In] IDirect3DDevice9* pDevice,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Depth,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo,[In] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) D3DXCreateVolumeTextureFromResourceExW

Creates a cube texture from a resource.

Pointer to an interface, representing the device to be associated with the cube texture.

Handle to the module where the resource is located, or null for the module associated with the image the operating system used to create the current process.

Pointer to a string that specifies the resource name. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Address of a reference to an interface, representing the created cube texture object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The compiler setting determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateCubeTextureFromResourceA because ANSI strings are being used.

The function is equivalent to (pDevice, hSrcModule, pSrcResource, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppCubeTexture).

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Note that a resource created with this function when called from a object will be placed in the memory class denoted by . When this method is called from a object the resource will be placed in the memory class denoted by .

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

uses the DirectDraw surface (DDS) file format. The DirectX Texture Editor (Dxtex.exe) enables you to generate a cube map from other file formats and save it in the DDS file format.

bb172760 HRESULT D3DXCreateCubeTextureFromResourceW([In] IDirect3DDevice9* pDevice,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In] IDirect3DCubeTexture9** ppCubeTexture) D3DXCreateCubeTextureFromResourceW

Saves a surface to a file.

Pointer to a string that specifies the file name of the destination image. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

specifying the file format to use when saving. This function supports saving to all formats except Portable Pixmap (.ppm) and Targa/Truevision Graphics Adapter (.tga).

Pointer to interface, containing the image to be saved.

Pointer to a structure containing a palette of 256 colors. This parameter can be null.

Pointer to a structure. Specifies the source rectangle. Set this parameter to null to specify the entire image.

If the function succeeds, the return value is . If the function fails, the return value can be the following:

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXSaveSurfaceToFileA because ANSI strings are being used.

This function handles conversion to and from compressed texture formats.

bb205431 HRESULT D3DXSaveSurfaceToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect) D3DXSaveSurfaceToFileW

Creates a cube texture from a file in memory.

Pointer to an interface, representing the device to be associated with the cube texture.

Pointer to the file in memory from which to create the cubemap. See Remarks.

Size of the file in memory, in bytes.

Address of a reference to an interface, representing the created cube texture object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

The function is equivalent to (pDevice, pSrcData, SrcDataSize, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppCubeTexture).

Note that a resource created with this function when called from a object will be placed in the memory class denoted by . When this method is called from a object the resource will be placed in the memory class denoted by .

This method is designed to be used for loading image files stored as RT_RCDATA, which is an application-defined resource (raw data). Otherwise this method will fail.

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

uses the DirectDraw surface (DDS) file format. The DirectX Texture Editor (Dxtex.exe) enables you to generate a cube map from other file formats and save it in the DDS file format.

bb172758 HRESULT D3DXCreateCubeTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DCubeTexture9** ppCubeTexture) D3DXCreateCubeTextureFromFileInMemory

Creates a cube texture from a file. This is a more advanced function than .

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateCubeTextureFromFileExA because ANSI strings are being used.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Cube textures differ from other surfaces in that they are collections of surfaces. To call SetRenderTarget with a cube texture, you must select an individual face using GetCubeMapSurface and pass the resulting surface to SetRenderTarget.

uses the DirectDraw surface (DDS) file format. The DirectX Texture Editor (Dxtex.exe) enables you to generate a cube map from other file formats and save it in the DDS file format.

When skipping mipmap levels while loading a .dds file, use the D3DX_SKIP_DDS_MIP_LEVELS macro to generate the MipFilter value. This macro takes the number of levels to skip and the filter type and returns the filter value, which would then be passed into the MipFilter parameter.

bb172757 HRESULT D3DXCreateCubeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DCubeTexture9** ppCubeTexture) D3DXCreateCubeTextureFromFileExW

Retrieves information about a given image in a resource.

Module where the resource is loaded. Set this parameter to null to specify the module associated with the image that the operating system used to create the current process.

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Pointer to a structure to be filled with the description of the data in the source file.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXGetImageInfoFromResourceA because ANSI strings are being used.

bb172869 HRESULT D3DXGetImageInfoFromResourceW([In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[Out] D3DXIMAGE_INFO* pSrcInfo) D3DXGetImageInfoFromResourceW

Uses a compiled high-level shader language (HLSL) function to fill each texel of each mipmap level of a texture.

Pointer to an object, representing the texture to be filled.

Pointer to a texture shader object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , .

The texture target must be an HLSL function that takes contains the following semantics:

  • One input parameter must use a POSITION semantic.
  • One input parameter must use a PSIZE semantic.
  • The function must return a parameter that uses the COLOR semantic.

The input parameters can be in any order. For an example, see

bb172832 HRESULT D3DXFillCubeTextureTX([In] IDirect3DCubeTexture9* pCubeTexture,[In] ID3DXTextureShader* pTextureShader) D3DXFillCubeTextureTX

Uses a user-provided function to fill each texel of each mip level of a given texture.

Pointer to an interface, representing the filled texture.

Pointer to a user-provided evaluator function, which will be used to compute the value of each texel. The function follows the prototype of LPD3DXFILL2D.

Pointer to an arbitrary block of user-defined data. This reference will be passed to the function provided in pFunction.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: .

Here is an example that creates a function called ColorFill, which relies on .

 // Define a function that matches the prototype of LPD3DXFILL3D	
            VOID WINAPI ColorFill (* pOut, const * pTexCoord, 	
            const * pTexelSize, LPVOID pData)	
            { *pOut = (pTexCoord->x, pTexCoord->y, 0.0f, 0.0f);	
            } // Fill the texture using 	
            if (FAILED (hr =  (m_pTexture, ColorFill, null)))	
            { return hr;	
            }	
            
bb172833 HRESULT D3DXFillTexture([In] IDirect3DTexture9* pTexture,[In] __function__stdcall* pFunction,[In] void* pData) D3DXFillTexture

Saves a surface to an image file.

Address of a reference to an that will store the image.

specifying the file format to use when saving. This function supports saving to all formats except Portable Pixmap (.ppm) and Targa/Truevision Graphics Adapter (.tga).

Pointer to interface containing the image to be saved.

Pointer to a structure containing a palette of 256 colors. This parameter can be null.

Pointer to a structure. Specifies the source rectangle. Set this parameter to null to specify the entire image.

If the function succeeds, the return value is . If the function fails, the return value can be the following: .

This function handles conversion to and from compressed texture formats.

bb205432 HRESULT D3DXSaveSurfaceToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect) D3DXSaveSurfaceToFileInMemory

Creates a volume texture from a file.

Pointer to an interface, representing the device to be associated with the volume texture.

Pointer to a string that specifies the file name. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Address of a reference to an interface representing the created texture object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateVolumeTextureFromFileA because ANSI strings are being used.

The function is equivalent to (pDevice, pSrcFile, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppVolumeTexture).

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Mipmapped textures automatically have each level filled with the loaded texture.

When loading images into mipmapped textures, some devices are unable to go to a 1x1 image and this function will fail. If this happens, then the images need to be loaded manually.

Note that a resource created with this function when called from a object will be placed in the memory class denoted by . When this method is called from a object the resource will be placed in the memory class denoted by .

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

bb172811 HRESULT D3DXCreateVolumeTextureFromFileW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] IDirect3DVolumeTexture9** ppVolumeTexture) D3DXCreateVolumeTextureFromFileW

Creates a texture from a resource.

Pointer to an interface, representing the device to be associated with the texture.

Handle to the module where the resource is located, or null for module associated with the image the operating system used to create the current process.

Pointer to a string that specifies the resource name. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Address of a reference to an interface, representing the created texture object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateTextureFromResourceA because ANSI strings are being used.

The function is equivalent to (pDevice, hSrcModule, pSrcResource, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppTexture).

The resource being loaded must be of type RT_BITMAP or RT_RCDATA. Resource type RT_RCDATA is used to load formats other than bitmaps (such as .tga, .jpg, and .dds).

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Note that a resource created with this function when called from a object will be placed in the memory class denoted by . When this method is called from a object the resource will be placed in the memory class denoted by .

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

bb172805 HRESULT D3DXCreateTextureFromResourceW([In] IDirect3DDevice9* pDevice,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In] IDirect3DTexture9** ppTexture) D3DXCreateTextureFromResourceW

Loads a volume from memory.

Pointer to an interface. Specifies the destination volume, which receives the image.

Pointer to a structure, the destination palette of 256 colors or null.

Pointer to a structure. Specifies the destination box. Set this parameter to null to specify the entire volume.

Pointer to the top-left corner of the source volume in memory.

Member of the enumerated type, the pixel format of the source volume.

Pitch of source image, in bytes. For DXT formats (compressed texture formats), this number should represent the size of one row of cells, in bytes.

Pitch of source image, in bytes. For DXT formats (compressed texture formats), this number should represent the size of one slice of cells, in bytes.

Pointer to a structure, the source palette of 256 colors or null.

Pointer to a structure. Specifies the source box. null is not a valid value for this parameter.

A combination of one or more controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

value to replace with transparent black, or 0 to disable the 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 color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , D3DXERR_INVALIDDATA.

Writing to a non-level-zero surface of the volume texture will not cause the dirty rectangle to be updated. If is called and the texture was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call on the volume texture.

bb172907 HRESULT D3DXLoadVolumeFromMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcRowPitch,[In] unsigned int SrcSlicePitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey) D3DXLoadVolumeFromMemory

Creates a volume texture from a file.

Pointer to an interface, representing the device to be associated with the texture.

Pointer to a string that specifies the filename. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Width in pixels. If this value is zero or D3DX_DEFAULT, the dimensions are taken from the file. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

Height, in pixels. If this value is zero or D3DX_DEFAULT, the dimensions are taken from the file. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

Depth, in pixels. If this value is zero or D3DX_DEFAULT, the dimensions are taken from the file. The maximum dimension that a driver supports (for width, height, and depth) can be found in MaxVolumeExtent in .

Number of mip levels requested. If this value is zero or D3DX_DEFAULT, a complete mipmap chain is created.

0, , or . Setting this flag to indicates that the surface is to be used as a render target. The resource can then be passed to the pNewRenderTarget parameter of the SetRenderTarget method. If either or is specified, Pool must be set to , and the application should check that the device supports this operation by calling CheckDeviceFormat. indicates that the surface should be handled dynamically. For more information about using dynamic textures, see Using Dynamic Textures.

Member of the enumerated type, describing the requested pixel format for the texture. The returned texture might have a different format from that specified by Format. Applications should check the format of the returned texture. If , the format is taken from the file. If D3DFMT_FROM_FILE, the format is taken exactly as it is in the file, and the call will fail if this violates device capabilities.

Member of the enumerated type, describing the memory class into which the texture should be placed.

A combination of one or more controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

A combination of one or more controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying . In addition, use bits 27-31 to specify the number of mip levels to be skipped (from the top of the mipmap chain) when a .dds texture is loaded into memory; this allows you to skip up to 32 levels.

value to replace with transparent black, or 0 to disable the 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 color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

Pointer to a structure to be filled in with a description of the data in the source image file, or null.

Pointer to a structure, representing a 256-color palette to fill in, or null.

Address of a reference to an interface, representing the created texture object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateVolumeTextureFromFileExA because ANSI strings are being used.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Mipmapped textures automatically have each level filled with the loaded volume texture. When loading images into mipmapped textures, some devices are unable to go to a 1x1 image and this function will fail. If this happens, then the images need to be loaded manually.

When skipping mipmap levels while loading a .dds file, use the D3DX_SKIP_DDS_MIP_LEVELS macro to generate the MipFilter value. This macro takes the number of levels to skip and the filter type and returns the filter value, which would then be passed into the MipFilter parameter.

bb172812 HRESULT D3DXCreateVolumeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Depth,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) D3DXCreateVolumeTextureFromFileExW

Creates a texture from a file in memory. This is a more advanced function than .

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

For details about , see the Platform SDK. Note that as of DirectX 8.0, the peFlags member of the structure does not function as documented in the Platform SDK. The peFlags member is now the alpha channel for 8-bit palettized formats.

When skipping mipmap levels while loading a .dds file, use the D3DX_SKIP_DDS_MIP_LEVELS macro to generate the MipFilter value. This macro takes the number of levels to skip and the filter type and returns the filter value, which would then be passed into the MipFilter parameter.

bb172804 HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Width,[In] unsigned int Height,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) D3DXCreateTextureFromFileInMemoryEx

Saves a volume to a buffer. The method creates an buffer to store the data, and returns that object.

No documentation. No documentation. No documentation. No documentation. No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be the following:

bb205436 HRESULT D3DXSaveVolumeToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox) D3DXSaveVolumeToFileInMemory

Creates a volume texture from a resource.

Pointer to an interface, representing the device to be associated with the volume texture.

Handle to the module where the resource is located, or null for the module associated with the image the operating system used to create the current process.

Pointer to a string that specifies the resource name. If the compiler settings require Unicode, the data type LPCTSTR resolves to LPCWSTR. Otherwise, the string data type resolves to LPCSTR. See Remarks.

Address of a reference to an interface representing the created texture object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

The compiler setting also determines the function version. If Unicode is defined, the function call resolves to . Otherwise, the function call resolves to D3DXCreateVolumeTextureFromResourceA because ANSI strings are being used.

The function is equivalent to (pDevice, hSrcModule, pSrcResource, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, D3DX_DEFAULT, 0, , , D3DX_DEFAULT, D3DX_DEFAULT, 0, null, null, ppVolumeTexture).

The resource being loaded must be an application-defined resource (RT_RCDATA).

This function supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Note that a resource created with this function when called from a object will be placed in the memory class denoted by . When this method is called from a object the resource will be placed in the memory class denoted by .

Filtering is automatically applied to a texture created using this method. The filtering is equivalent to | in .

bb172815 HRESULT D3DXCreateVolumeTextureFromResourceW([In] IDirect3DDevice9* pDevice,[In] HINSTANCE hSrcModule,[In] const wchar_t* pSrcResource,[In] IDirect3DVolumeTexture9** ppVolumeTexture) D3DXCreateVolumeTextureFromResourceW

Creates an empty texture, adjusting the calling parameters as needed.

Pointer to an interface, representing the device to be associated with the texture.

Width in pixels. If this value is 0, a value of 1 is used. See Remarks.

Height in pixels. If this value is 0, a value of 1 is used. See Remarks.

Number of mip levels requested. If this value is zero or D3DX_DEFAULT, a complete mipmap chain is created.

0, , or . Setting this flag to indicates that the surface is to be used as a render target by calling the SetRenderTarget method. If either or is specified, the application should check that the device supports this operation by calling CheckDeviceFormat. For more information about using dynamic textures, see Using Dynamic Textures.

Member of the enumerated type, describing the requested pixel format for the texture. The returned texture may be of a different format from that specified, if the device does not support the requested format. Applications should check the format of the returned texture to see if it matches the format requested.

Member of the enumerated type, describing the memory class into which the texture should be placed.

Address of a reference to an interface, representing the created texture object.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , , , E_OUTOFMEMORY.

Internally, uses to adjust the calling parameters. Therefore, calls to will often succeed where calls to CreateTexture would fail.

If both Height and Width are set to D3DX_DEFAULT, a value of 256 is used for both parameters. If either Height or Width is set to D3DX_DEFAULT And the other parameter is set to a numeric value, the texture will be square with both the height and width equal to the numeric value.

bb172800 HRESULT D3DXCreateTexture([In] IDirect3DDevice9* pDevice,[In] unsigned int Width,[In] unsigned int Height,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] IDirect3DTexture9** ppTexture) D3DXCreateTexture

Uses a user-provided function to fill each texel of each mip level of a given volume texture.

Pointer to an interface, representing the filled texture.

Pointer to a user-provided evaluator function, which will be used to compute the value of each texel. The function follows the prototype of LPD3DXFILL3D.

Pointer to an arbitrary block of user-defined data. This reference will be passed to the function provided in pFunction.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: .

If the volume is non-dynamic (because usage is set to 0 when it is created), and located in video memory (the memory pool set to ), will fail because the volume cannot be locked.

This example creates a function called ColorVolumeFill, which relies on .

 // Define a function that matches the prototype of LPD3DXFILL3D	
            VOID WINAPI ColorVolumeFill (* pOut, const * pTexCoord, 	
            const * pTexelSize, LPVOID pData)	
            { *pOut = (pTexCoord->x, pTexCoord->y, pTexCoord->z, 0.0f);	
            } // Fill volume texture	
            if (FAILED (hr =  (m_pTexture, ColorVolumeFill, null)))	
            { return hr;	
            }	
            
bb172835 HRESULT D3DXFillVolumeTexture([In] IDirect3DVolumeTexture9* pVolumeTexture,[In] __function__stdcall* pFunction,[In] void* pData) D3DXFillVolumeTexture

Loads a surface from another surface with color conversion.

Pointer to an interface. Specifies the destination surface, which receives the image.

Pointer to a structure, the destination palette of 256 colors or null.

Pointer to a structure. Specifies the destination rectangle. Set this parameter to null to specify the entire surface.

Pointer to an interface, representing the source surface.

Pointer to a structure, the source palette of 256 colors or null.

Pointer to a structure. Specifies the source rectangle. Set this parameter to null to specify the entire surface.

A combination of one or more , controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

value to replace with transparent black, or 0 to disable the 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 color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

This function handles conversion to and from compressed texture formats.

Writing to a non-level-zero surface will not cause the dirty rectangle to be updated. If is called and the surface was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call AddDirtyRect on the surface.

bb172904 HRESULT D3DXLoadSurfaceFromSurface([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) D3DXLoadSurfaceFromSurface

Loads a volume from a file in memory.

Pointer to an interface. Specifies the destination volume.

Pointer to a structure, the destination palette of 256 colors or null.

Pointer to a structure. Specifies the destination box. Set this parameter to null to specify the entire volume.

Pointer to the file in memory from which to load the volume.

Size in bytes of the file in memory.

Pointer to a structure. Specifies the source box. Set this parameter to null to specify the entire volume.

Combination of one or more , controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | .

value to replace with transparent black, or 0 to disable the 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 color keys. Thus, for opaque black, the value would be equal to 0xFF000000.

Pointer to a structure to be filled with a description of the data in the source image file, or null.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

This function handles conversion to and from compressed texture formats and supports the following file formats: .bmp, .dds, .dib, .hdr, .jpg, .pfm, .png, .ppm, and .tga. See .

Writing to a non-level-zero surface of the volume texture will not cause the dirty rectangle to be updated. If is called and the texture was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call on the volume texture.

bb172906 HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) D3DXLoadVolumeFromFileInMemory

Creates an instance of an object.

No documentation.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: E_POINTER, E_OUTOFMEMORY.

After using this function, use RegisterTemplates or RegisterEnumTemplates to register templates, CreateEnumObject to create an enumerator object, or CreateSaveObject to create a save object.

bb172830 HRESULT D3DXFileCreate([In] ID3DXFile** lplpDirectXFile) D3DXFileCreate
Functions Constant ConflictingRenderState. D3DERR_CONFLICTINGRENDERSTATE Constant ConflictingTextureFilter. D3DERR_CONFLICTINGTEXTUREFILTER Constant ConflictingTexturePalette. D3DERR_CONFLICTINGTEXTUREPALETTE Constant DeviceHung. D3DERR_DEVICEHUNG Constant DeviceLost. D3DERR_DEVICELOST Constant DeviceNotReset. D3DERR_DEVICENOTRESET Constant DeviceRemoved. D3DERR_DEVICEREMOVED Constant DriverInternalError. D3DERR_DRIVERINTERNALERROR Constant InvalidCall. D3DERR_INVALIDCALL Constant InvalidDevice. D3DERR_INVALIDDEVICE Constant MoreData. D3DERR_MOREDATA Constant NoAutomaticGeneration. D3DOK_NOAUTOGEN Constant NotAvailable. D3DERR_NOTAVAILABLE Constant NotFound. D3DERR_NOTFOUND Constant OutOfVideoMemory. D3DERR_OUTOFVIDEOMEMORY Constant PresentModeChanged. S_PRESENT_MODE_CHANGED Constant PresentOccluded. S_PRESENT_OCCLUDED Constant ResidentInSharedMemory. S_RESIDENT_IN_SHARED_MEMORY Constant Success. D3D_OK Constant TooManyOperations. D3DERR_TOOMANYOPERATIONS Constant UnsupportedAlphaArgument. D3DERR_UNSUPPORTEDALPHAARG Constant UnsupportedAlphaOperation. D3DERR_UNSUPPORTEDALPHAOPERATION Constant UnsupportedColorArgument. D3DERR_UNSUPPORTEDCOLORARG Constant UnsupportedColorOperation. D3DERR_UNSUPPORTEDCOLOROPERATION Constant UnsupportedFactorValue. D3DERR_UNSUPPORTEDFACTORVALUE Constant UnsupportedTextureFilter. D3DERR_UNSUPPORTEDTEXTUREFILTER Constant WasStillDrawing. D3DERR_WASSTILLDRAWING Constant WrongTextureFormat. D3DERR_WRONGTEXTUREFORMAT

An application implements this interface to handle callbacks in animation sets generated by calls to .

The LPD3DXANIMATIONCALLBACKHANDLER type is defined as a reference to this interface.

 typedef interface  ;	
            typedef interface  *LPD3DXANIMATIONCALLBACKHANDLER;	
            
bb205624 ID3DXAnimationCallbackHandler ID3DXAnimationCallbackHandler
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

The application implements this method. This method is called when a callback occurs for an animation set in one of the tracks during a call to .

No documentation. No documentation.

The return values of this method are implemented by an application programmer. In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR.

bb205625 HRESULT ID3DXAnimationCallbackHandler::HandleCallback([In] unsigned int Track,[In] void* pCallbackData) ID3DXAnimationCallbackHandler::HandleCallback

This interface is used to control animation functionality, connecting animation sets with the transformation frames that are being animated. The interface has methods to mix multiple animations and to modify blending parameters over time to enable smooth transitions and other effects.

Create an animation controller object with .

The LPD3DXANIMATIONCONTROLLER type is defined as a reference to the interface.

 typedef interface  ;	
            typedef interface  *LPD3DXANIMATIONCONTROLLER;	
            

The D3DXEVENTHANDLE type is defined as an event handle to animation controller events.

 typedef DWORD D3DXEVENTHANDLE;	
            

The LPD3DXEVENTHANDLE type is defined as a reference to an event handle to animation controller events.

 typedef D3DXEVENTHANDLE *LPD3DXEVENTHANDLE;	
            
bb205626 ID3DXAnimationController ID3DXAnimationController
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Get the maximum number of animation outputs the animation controller can support.

bb205634 GetMaxNumAnimationOutputs GetMaxNumAnimationOutputs unsigned int ID3DXAnimationController::GetMaxNumAnimationOutputs()

Gets the maximum number of animation sets the animation controller can support.

bb205635 GetMaxNumAnimationSets GetMaxNumAnimationSets unsigned int ID3DXAnimationController::GetMaxNumAnimationSets()

Gets the maximum number of tracks in the animation controller.

The maximum number of tracks the controller can manage.

bb205637 GetMaxNumTracks GetMaxNumTracks unsigned int ID3DXAnimationController::GetMaxNumTracks()

Gets the maximum number of events the animation controller can support.

bb205636 GetMaxNumEvents GetMaxNumEvents unsigned int ID3DXAnimationController::GetMaxNumEvents()

Returns the number of animation sets currently registered in the animation controller.

The controller contains any number of animations sets and tracks. Animation sets can be registered with RegisterAnimationOutput. An animation controller created by a call to will automatically register loaded animation sets.

bb205638 GetNumAnimationSets GetNumAnimationSets unsigned int ID3DXAnimationController::GetNumAnimationSets()

Gets the global animation time.

Animations are designed using a local animation time and mixed into global time with AdvanceTime.

bb205640 GetTime GetTime double ID3DXAnimationController::GetTime()

Gets or sets the current priority blending weight used by the animation controller.

The priority blending weight is used to blend high and low priority tracks together.

bb205639 GetPriorityBlend / SetPriorityBlend GetPriorityBlend float ID3DXAnimationController::GetPriorityBlend()

Returns an event handle to a priority blend event that is currently running.

bb205631 GetCurrentPriorityBlend GetCurrentPriorityBlend unsigned int ID3DXAnimationController::GetCurrentPriorityBlend()

Get the maximum number of animation outputs the animation controller can support.

The maximum number of animation outputs the controller can manage.

bb205634 unsigned int ID3DXAnimationController::GetMaxNumAnimationOutputs() ID3DXAnimationController::GetMaxNumAnimationOutputs

Gets the maximum number of animation sets the animation controller can support.

The maximum number of animation sets the controller can manage.

bb205635 unsigned int ID3DXAnimationController::GetMaxNumAnimationSets() ID3DXAnimationController::GetMaxNumAnimationSets

Gets the maximum number of tracks in the animation controller.

Number of tracks.

The maximum number of tracks the controller can manage.

bb205637 unsigned int ID3DXAnimationController::GetMaxNumTracks() ID3DXAnimationController::GetMaxNumTracks

Gets the maximum number of events the animation controller can support.

The maximum number of events the controller can manage.

bb205636 unsigned int ID3DXAnimationController::GetMaxNumEvents() ID3DXAnimationController::GetMaxNumEvents

Adds an animation output to the animation controller and registers references for scale, rotate, and translate (SRT) transformations.

Name of the animation output.

Pointer to a structure containing SRT transformation data. Can be null.

Pointer to a vector that describes the scale of the animation set. Can be null.

Pointer to a quaternion that describes the rotation of the animation set. Can be null.

Pointer to a vector that describes the translation of the animation set. Can be null.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

If the animation output is already registered, pMatrix will be filled with the input transformation data.

Animation sets created with automatically register all loaded animation sets.

bb205650 HRESULT ID3DXAnimationController::RegisterAnimationOutput([In] const char* pName,[In] D3DXMATRIX* pMatrix,[In] D3DXVECTOR3* pScale,[In] D3DXQUATERNION* pRotation,[In] D3DXVECTOR3* pTranslation) ID3DXAnimationController::RegisterAnimationOutput

Adds an animation set to the animation controller.

Pointer to the animation set to add.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb205651 HRESULT ID3DXAnimationController::RegisterAnimationSet([In] ID3DXAnimationSet* pAnimSet) ID3DXAnimationController::RegisterAnimationSet

Removes an animation set from the animation controller.

Pointer to the animation set to remove.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , .

bb205664 HRESULT ID3DXAnimationController::UnregisterAnimationSet([In] ID3DXAnimationSet* pAnimSet) ID3DXAnimationController::UnregisterAnimationSet

Returns the number of animation sets currently registered in the animation controller.

Number of animation sets.

The controller contains any number of animations sets and tracks. Animation sets can be registered with RegisterAnimationOutput. An animation controller created by a call to will automatically register loaded animation sets.

bb205638 unsigned int ID3DXAnimationController::GetNumAnimationSets() ID3DXAnimationController::GetNumAnimationSets

Gets an animation set.

Index of the animation set.

Pointer to the animation set.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

The animation controller contains an array of animation sets. This method returns one of them at the given index.

bb205629 HRESULT ID3DXAnimationController::GetAnimationSet([In] unsigned int Index,[Out] ID3DXAnimationSet** ppAnimationSet) ID3DXAnimationController::GetAnimationSet

Gets an animation set, given its name.

String containing the name of the animation set.

Pointer to the animation set.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

The animation controller contains an array of animation sets. This method returns an animation set that has the given name.

bb205630 HRESULT ID3DXAnimationController::GetAnimationSetByName([In] const char* szName,[In] ID3DXAnimationSet** ppAnimationSet) ID3DXAnimationController::GetAnimationSetByName

Animates the mesh and advances the global animation time by a specified amount.

Amount, in seconds, by which to advance the global animation time. TimeDelta value must be non-negative or zero.

Pointer to a user-defined animation callback handler interface, .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

bb205627 HRESULT ID3DXAnimationController::AdvanceTime([In] double TimeDelta,[In] ID3DXAnimationCallbackHandler* pCallbackHandler) ID3DXAnimationController::AdvanceTime

Resets the global animation time to zero. Any pending events will retain their original schedules, but in the new timeframe.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

This method is typically used when the global animation time value is nearing the maximum precision of DOUBLE storage, or 264 - 1.

bb205652 HRESULT ID3DXAnimationController::ResetTime() ID3DXAnimationController::ResetTime

Gets the global animation time.

Returns the global animation time.

Animations are designed using a local animation time and mixed into global time with AdvanceTime.

bb205640 double ID3DXAnimationController::GetTime() ID3DXAnimationController::GetTime

Applies the animation set to the specified track.

Identifier of the track to which the animation set is applied.

Pointer to the animation set to be added to the track.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

This method sets the animation set to the specified track for mixing. The animation set for each track is blended according to the track weight and speed when AdvanceTime is called.

bb205654 HRESULT ID3DXAnimationController::SetTrackAnimationSet([In] unsigned int Track,[In] ID3DXAnimationSet* pAnimSet) ID3DXAnimationController::SetTrackAnimationSet

Gets the animation set for the given track.

Track identifier.

Pointer to the animation set for the given track.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

bb205641 HRESULT ID3DXAnimationController::GetTrackAnimationSet([In] unsigned int Track,[Out] ID3DXAnimationSet** ppAnimSet) ID3DXAnimationController::GetTrackAnimationSet

Sets the priority blending weight for the specified animation track.

Track identifier.

Track priority. This parameter should be set to one of the constants from .

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb205658 HRESULT ID3DXAnimationController::SetTrackPriority([In] unsigned int Track,[In] D3DXPRIORITY_TYPE Priority) ID3DXAnimationController::SetTrackPriority

Sets the track speed. The track speed is similar to a multiplier that is used to speed up or slow down the playback of the track.

Identifier of the track to set the speed on.

New speed.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

bb205659 HRESULT ID3DXAnimationController::SetTrackSpeed([In] unsigned int Track,[In] float Speed) ID3DXAnimationController::SetTrackSpeed

Sets the track weight. The weight is used to determine how to blend multiple tracks together.

Identifier of the track to set the weight on.

Weight value.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

bb205660 HRESULT ID3DXAnimationController::SetTrackWeight([In] unsigned int Track,[In] float Weight) ID3DXAnimationController::SetTrackWeight

Sets the track to the specified local animation time.

Track identifier.

Local animation time value to assign to the track.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

bb205657 HRESULT ID3DXAnimationController::SetTrackPosition([In] unsigned int Track,[In] double Position) ID3DXAnimationController::SetTrackPosition

Enables or disables a track in the animation controller.

Identifier of the track to be mixed.

Enable value. Set to TRUE to enable this track in the controller, or to to prevent it from being mixed.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

To mix a track with other tracks, the Enable flag must be set to TRUE. Conversely, setting the flag to will prevent the track from being mixed with other tracks.

bb205656 HRESULT ID3DXAnimationController::SetTrackEnable([In] unsigned int Track,[In] BOOL Enable) ID3DXAnimationController::SetTrackEnable

Sets the track description.

Identifier of the track to modify.

Description of the track.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

bb205655 HRESULT ID3DXAnimationController::SetTrackDesc([In] unsigned int Track,[In] D3DXTRACK_DESC* pDesc) ID3DXAnimationController::SetTrackDesc

Gets the track description.

Track identifier.

Pointer to the track description. See .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

bb205642 HRESULT ID3DXAnimationController::GetTrackDesc([In] unsigned int Track,[In] D3DXTRACK_DESC* pDesc) ID3DXAnimationController::GetTrackDesc

Sets the priority blending weight used by the animation controller.

Priority blending weight used by the animation controller.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: .

The blend weight is used to blend high and low priority tracks together.

bb205653 HRESULT ID3DXAnimationController::SetPriorityBlend([In] float BlendWeight) ID3DXAnimationController::SetPriorityBlend

Gets the current priority blending weight used by the animation controller.

Returns the current priority blending weight.

The priority blending weight is used to blend high and low priority tracks together.

bb205639 float ID3DXAnimationController::GetPriorityBlend() ID3DXAnimationController::GetPriorityBlend

Sets an event key that changes the rate of play of an animation track.

Identifier of the track to modify.

New speed of the animation track.

Global time key. Specifies the global time when the change will take place.

Transition time, which specifies how long the smooth transition will take to complete.

Specifies the transition type used for transitioning between speeds. See .

Event handle to the priority blend event. null is returned if one or more of the input parameters is invalid, or no free event is available.

bb205648 unsigned int ID3DXAnimationController::KeyTrackSpeed([In] unsigned int Track,[In] float NewSpeed,[In] double StartTime,[In] double Duration,[In] D3DXTRANSITION_TYPE Transition) ID3DXAnimationController::KeyTrackSpeed

Sets an event key that changes the weight of an animation track. The weight is used as a multiplier when combining multiple tracks together.

Identifier of the track to modify.

New weight of the track.

Global time key. Specifies the global time when the change will take place.

Transition time, which specifies how long the smooth transition will take to complete.

Specifies the transition type used for transitioning between weights. See .

Event handle to the priority blend event. null is returned if one or more of the input parameters is invalid, or no free event is available.

The weight is used like a multiplier to determine how much of this track to blend together with other tracks.

bb205649 unsigned int ID3DXAnimationController::KeyTrackWeight([In] unsigned int Track,[In] float NewWeight,[In] double StartTime,[In] double Duration,[In] D3DXTRANSITION_TYPE Transition) ID3DXAnimationController::KeyTrackWeight

Sets an event key that changes the local time of an animation track.

Identifier of the track to modify.

New local time of the animation track.

Global time key. Specifies the global time when the change will take place.

Event handle to the priority blend event. null is returned if Track is invalid, or if no free event is available.

bb205647 unsigned int ID3DXAnimationController::KeyTrackPosition([In] unsigned int Track,[In] double NewPosition,[In] double StartTime) ID3DXAnimationController::KeyTrackPosition

Sets an event key that enables or disables an animation track.

Identifier of the animation track to modify.

Enable flag. Set this to TRUE to enable the animation track, or to to disable the track.

Global time key. Specifies the global time when the change will take place.

Event handle to the priority blend event. null is returned if Track is invalid.

bb205646 unsigned int ID3DXAnimationController::KeyTrackEnable([In] unsigned int Track,[In] BOOL NewEnable,[In] double StartTime) ID3DXAnimationController::KeyTrackEnable

Sets blending event keys for the specified animation track.

Number between 0 and 1 that is used to blend tracks together.

Global time to start the blend.

Global time duration of the blend.

Specifies the transition type used for the duration of the blend. See .

Event handle to the priority blend event. null is returned if one or more of the input parameters is invalid, or no free event is available.

The animation controller blends in three phases: low priority tracks are blended first, high priority tracks are blended second, and then the results of both are blended.

bb205645 unsigned int ID3DXAnimationController::KeyPriorityBlend([In] float NewBlendWeight,[In] double StartTime,[In] double Duration,[In] D3DXTRANSITION_TYPE Transition) ID3DXAnimationController::KeyPriorityBlend

Removes a specified event from an animation track, preventing the execution of the event.

Event handle to the event to be removed from the animation track.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb205663 HRESULT ID3DXAnimationController::UnkeyEvent([In] unsigned int hEvent) ID3DXAnimationController::UnkeyEvent

Removes all events from a specified animation track.

Identifier of the track on which all events should be removed.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

This method prevents the execution of all events previously scheduled on the track, and discards all data associated with those events.

bb205662 HRESULT ID3DXAnimationController::UnkeyAllTrackEvents([In] unsigned int Track) ID3DXAnimationController::UnkeyAllTrackEvents

Removes all scheduled priority blend events from the animation controller.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb205661 HRESULT ID3DXAnimationController::UnkeyAllPriorityBlends() ID3DXAnimationController::UnkeyAllPriorityBlends

Returns an event handle to the event currently running on the specified animation track.

Track identifier.

Type of event to query.

Event handle to the event currently running on the specified track. null is returned if no event is running on the specified track.

bb205632 unsigned int ID3DXAnimationController::GetCurrentTrackEvent([In] unsigned int Track,[In] D3DXEVENT_TYPE EventType) ID3DXAnimationController::GetCurrentTrackEvent

Returns an event handle to a priority blend event that is currently running.

Event handle to the currently running priority blend event. null is returned if no priority blend event is currently running.

bb205631 unsigned int ID3DXAnimationController::GetCurrentPriorityBlend() ID3DXAnimationController::GetCurrentPriorityBlend

Returns an event handle to the next event scheduled to occur after a specified event on an animation track.

Track identifier.

Event handle to a specified event after which to search for a following event. If set to null, then the method will return the next scheduled event.

Event handle to the next event scheduled to run on the specified track. null is returned if no new event is scheduled.

This method can be used iteratively to locate a desired event by repeatedly passing in null for hEvent.

Note??Do not iterate further after the method has returned null.

bb205644 unsigned int ID3DXAnimationController::GetUpcomingTrackEvent([In] unsigned int Track,[In] unsigned int hEvent) ID3DXAnimationController::GetUpcomingTrackEvent

Returns an event handle to the next priority blend event scheduled to occur after a specified event.

Event handle to a specified event after which to search for a following priority blend event. If set to null, then the method will return the next scheduled priority blend event.

Event handle to the next scheduled priority blend event. null is returned if no new priority blend event is scheduled.

This method can be used iteratively to locate a desired priority blend event by repeatedly passing in null for hEvent.

Note??Do not iterate further after the method has returned null.

bb205643 unsigned int ID3DXAnimationController::GetUpcomingPriorityBlend([In] unsigned int hEvent) ID3DXAnimationController::GetUpcomingPriorityBlend

Checks whether a specified event handle is valid and the animation event has not yet completed.

Event handle to an animation event.

Returns if the event handle is valid and the event has not yet completed.

Returns E_FAIL if the event handle is invalid and/or the event has completed.

The method will indicate that an event handle is valid even if the event is running but has not yet completed.

bb205665 HRESULT ID3DXAnimationController::ValidateEvent([In] unsigned int hEvent) ID3DXAnimationController::ValidateEvent

Gets a description of a specified animation event.

Event handle to an animation event to describe.

Pointer to a structure that contains a description of the animation event.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb205633 HRESULT ID3DXAnimationController::GetEventDesc([In] unsigned int hEvent,[In] D3DXEVENT_DESC* pDesc) ID3DXAnimationController::GetEventDesc

Clones, or copies, an animation controller.

Maximum number of animation outputs the controller can support.

Maximum number of animation sets the controller can support.

Maximum number of tracks the controller can support.

Maximum number of events the controller can support.

Address of a reference to the cloned animation controller.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

bb205628 HRESULT ID3DXAnimationController::CloneAnimationController([In] unsigned int MaxNumAnimationOutputs,[In] unsigned int MaxNumAnimationSets,[In] unsigned int MaxNumTracks,[In] unsigned int MaxNumEvents,[In] ID3DXAnimationController** ppAnimController) ID3DXAnimationController::CloneAnimationController

This interface encapsulates the minimum functionality required of an animation set by an animation controller. Advanced users might want to implement this interface themselves to suit their specialized needs; for most users, however, the derived and interfaces should suffice.

An animation set consists of animations for many nodes for the same animation.

The LPD3DXANIMATIONSET type is defined as a reference to this interface.

 typedef interface  ;	
            typedef interface  *LPD3DXANIMATIONSET;	
            
bb205667 ID3DXAnimationSet ID3DXAnimationSet
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the animation set name.

bb205671 GetName GetName const char* ID3DXAnimationSet::GetName()

Gets the period of the animation set.

The period is the range of time that the animation key frames are valid. For looping animations, this is the period of the loop. The time units that the key frames are specified in (for example, seconds) is determined by the application.

bb205673 GetPeriod GetPeriod double ID3DXAnimationSet::GetPeriod()

Gets the number of animations in the animation set.

bb205672 GetNumAnimations GetNumAnimations unsigned int ID3DXAnimationSet::GetNumAnimations()

Gets the animation set name.

Name of the animation set.

bb205671 const char* ID3DXAnimationSet::GetName() ID3DXAnimationSet::GetName

Gets the period of the animation set.

Period of the animation set.

The period is the range of time that the animation key frames are valid. For looping animations, this is the period of the loop. The time units that the key frames are specified in (for example, seconds) is determined by the application.

bb205673 double ID3DXAnimationSet::GetPeriod() ID3DXAnimationSet::GetPeriod

Returns time position in the local timeframe of an animation set.

Local time of the animation set.

Time position as measured in the timeframe of the animation set. This value will be bounded by the period of the animation set.

The time position returned by this method can be used as the PeriodicPosition parameter of .

bb205674 double ID3DXAnimationSet::GetPeriodicPosition([In] double Position) ID3DXAnimationSet::GetPeriodicPosition

Gets the number of animations in the animation set.

Number of animations in the animation set.

bb205672 unsigned int ID3DXAnimationSet::GetNumAnimations() ID3DXAnimationSet::GetNumAnimations

Gets the name of an animation, given its index.

Index of the animation.

Address of a reference to a string that receives the animation name.

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR.

bb205669 HRESULT ID3DXAnimationSet::GetAnimationNameByIndex([In] unsigned int Index,[In] const char** ppName) ID3DXAnimationSet::GetAnimationNameByIndex

Gets the index of an animation, given its name.

Name of the animation.

Pointer to the animation index.

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR.

bb205668 HRESULT ID3DXAnimationSet::GetAnimationIndexByName([In] const char* pName,[In] unsigned int* pIndex) ID3DXAnimationSet::GetAnimationIndexByName

Gets the scale, rotation, and translation values of the animation set.

Position of the animation set. The position can be obtained by calling .

Animation index.

Pointer to the vector that describes the scale of the animation set.

Pointer to the quaternion that describes the rotation of the animation set.

Pointer to the vector that describes the translation of the animation set.

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR.

bb205675 HRESULT ID3DXAnimationSet::GetSRT([In] double PeriodicPosition,[In] unsigned int Animation,[Out] D3DXVECTOR3* pScale,[Out] D3DXQUATERNION* pRotation,[Out] D3DXVECTOR3* pTranslation) ID3DXAnimationSet::GetSRT

Gets information about a specific callback in the animation set.

Position from which to find callbacks.

Callback search flags. This parameter can be set to a combination of one or more flags from .

Pointer to the position of the callback.

Address of the callback data reference.

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR.

bb205670 HRESULT ID3DXAnimationSet::GetCallback([In] double Position,[In] unsigned int Flags,[Out] double* pCallbackPosition,[In] void** ppCallbackData) ID3DXAnimationSet::GetCallback

Locks a vertex buffer and obtains a reference to the vertex buffer memory.

When working with vertex buffers, you are allowed to make multiple lock calls; however, you must ensure that the number of lock calls match the number of unlock calls. DrawPrimitive calls will not succeed with any outstanding lock count on any currently set vertex buffer.

bb205749 ID3DXBaseMesh ID3DXBaseMesh
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the fixed function vertex value.

This method can return 0 if the vertex format cannot be mapped directly to an FVF code. This will occur for a mesh created from a vertex declaration that doesn't have the same order and elements supported by the FVF codes.

bb205741 GetFVF GetFVF unsigned int ID3DXBaseMesh::GetFVF()

Gets the number of bytes per vertex.

bb205743 GetNumBytesPerVertex GetNumBytesPerVertex unsigned int ID3DXBaseMesh::GetNumBytesPerVertex()

Retrieves the mesh options enabled for this mesh at creation time.

bb205746 GetOptions GetOptions unsigned int ID3DXBaseMesh::GetOptions()

Retrieves the device associated with the mesh.

Calling this method will increase the internal reference count on the interface. Be sure to call when you are done using this interface or you will have a memory leak.

bb205740 GetDevice GetDevice HRESULT ID3DXBaseMesh::GetDevice([Out] IDirect3DDevice9** ppDevice)

Retrieves the vertex buffer associated with the mesh.

bb205747 GetVertexBuffer GetVertexBuffer HRESULT ID3DXBaseMesh::GetVertexBuffer([Out] IDirect3DVertexBuffer9** ppVB)

Retrieves the data in an index buffer.

bb205742 GetIndexBuffer GetIndexBuffer HRESULT ID3DXBaseMesh::GetIndexBuffer([Out] IDirect3DIndexBuffer9** ppIB)

Draws a subset of a mesh.

DWORD that specifies which subset of the mesh to draw. This value is used to differentiate faces in a mesh as belonging to one or more attribute groups.

If the method succeeds, the return value is . If the method fails, the return value can be .

The subset that is specified by AttribId will be rendered by the method, using the primitive type, so an index buffer must be properly initialized.

An attribute table is used to identify areas of the mesh that need to be drawn with different textures, render states, materials, and so on. In addition, the application can use the attribute table to hide portions of a mesh by not drawing a given attribute identifier (AttribId) when drawing the frame.

bb205736 HRESULT ID3DXBaseMesh::DrawSubset([In] unsigned int AttribId) ID3DXBaseMesh::DrawSubset

Retrieves the number of faces in the mesh.

Returns the number of faces in the mesh.

bb205744 unsigned int ID3DXBaseMesh::GetNumFaces() ID3DXBaseMesh::GetNumFaces

Retrieves the number of vertices in the mesh.

Returns the number of vertices in the mesh.

bb205745 unsigned int ID3DXBaseMesh::GetNumVertices() ID3DXBaseMesh::GetNumVertices

Gets the fixed function vertex value.

Returns the flexible vertex format (FVF) codes.

This method can return 0 if the vertex format cannot be mapped directly to an FVF code. This will occur for a mesh created from a vertex declaration that doesn't have the same order and elements supported by the FVF codes.

bb205741 unsigned int ID3DXBaseMesh::GetFVF() ID3DXBaseMesh::GetFVF

Retrieves a declaration describing the vertices in the mesh.

Array of elements describing the vertex format of the mesh vertices. The upper limit of this declarator array is . The vertex element array ends with the D3DDECL_END macro.

If the method succeeds, the return value is . If the method fails, the return value can be .

The array of elements includes the D3DDECL_END macro, which ends the declaration.

bb205739 HRESULT ID3DXBaseMesh::GetDeclaration([In] D3DVERTEXELEMENT9* Declaration) ID3DXBaseMesh::GetDeclaration

Gets the number of bytes per vertex.

Returns the number of bytes per vertex.

bb205743 unsigned int ID3DXBaseMesh::GetNumBytesPerVertex() ID3DXBaseMesh::GetNumBytesPerVertex

Retrieves the mesh options enabled for this mesh at creation time.

Returns a combination of one or more of the following flags, indicating the options enabled for this mesh at creation time.

ValueDescription
Use 32-bit indices.
Use the usage flag for vertex and index buffers.
Equivalent to specifying both and .
Use the usage flag for vertex and index buffers.
Specifying this flag causes the vertex and index buffer of the mesh to be created with flag. This is required if the mesh object is to be rendered using N-Patch enhancement.
Equivalent to specifying both and .
Use the usage flag for vertex and index buffers.
Use the usage flag for index buffers.
Use the memory class for index buffers.
Use the memory class for index buffers.
Use the usage flag for index buffers.
Equivalent to specifying both and .
Use the usage flag for vertex buffers.
Use the memory class for vertex buffers.
Use the memory class for vertex buffers.
Use the usage flag for vertex buffers.
Equivalent to specifying both and .

?

bb205746 unsigned int ID3DXBaseMesh::GetOptions() ID3DXBaseMesh::GetOptions

Retrieves the device associated with the mesh.

Address of a reference to an interface, representing the Direct3D device object associated with the mesh.

If the method succeeds, the return value is . If the method fails, the return value can be .

Calling this method will increase the internal reference count on the interface. Be sure to call when you are done using this interface or you will have a memory leak.

bb205740 HRESULT ID3DXBaseMesh::GetDevice([Out] IDirect3DDevice9** ppDevice) ID3DXBaseMesh::GetDevice

Clones a mesh using a flexible vertex format (FVF) code.

A combination of one or more D3DXMESH flags specifying creation options for the mesh.

Combination of FVF codes, which specifies the vertex format for the vertices in the output mesh. For the values of the codes, see .

Pointer to an interface representing the device object associated with the mesh.

Address of a reference to an interface, representing the cloned mesh.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

is used to reformat and change the vertex data layout. This is done by creating a new mesh object. For example, use it to to add space for normals, texture coordinates, colors, weights, etc. that were not present before.

updates the vertex declaration with different semantic information without changing the layout of the vertex buffer. This method does not modify the contents of the vertex buffer. For example, use it to relabel a 3D texture coordinate as a binormal or tangent or vice versa.

bb205733 HRESULT ID3DXBaseMesh::CloneMeshFVF([In] unsigned int Options,[In] unsigned int FVF,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXMesh** ppCloneMesh) ID3DXBaseMesh::CloneMeshFVF

Clones a mesh using a declarator.

A combination of one or more D3DXMESH flags specifying creation options for the mesh.

An array of elements, which specify the vertex format for the vertices in the output mesh.

Pointer to an interface, representing the device object associated with the mesh.

Address of a reference to an interface, representing the cloned mesh.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

is used to reformat and change the vertex data layout. This is done by creating a new mesh object. For example, use it to add space for normals, texture coordinates, colors, weights, etc. that were not present before.

updates the vertex declaration with different semantic information without changing the layout of the vertex buffer. This method does not modify the contents of the vertex buffer. For example, use it to relabel a 3D texture coordinate as a binormal or tangent or vice versa.

bb205732 HRESULT ID3DXBaseMesh::CloneMesh([In] unsigned int Options,[In] const D3DVERTEXELEMENT9* pDeclaration,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXMesh** ppCloneMesh) ID3DXBaseMesh::CloneMesh

Retrieves the vertex buffer associated with the mesh.

Address of a reference to an interface, representing the vertex buffer object associated with the mesh.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205747 HRESULT ID3DXBaseMesh::GetVertexBuffer([Out] IDirect3DVertexBuffer9** ppVB) ID3DXBaseMesh::GetVertexBuffer

Retrieves the data in an index buffer.

Address of a reference to an interface, representing the index buffer object associated with the mesh.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205742 HRESULT ID3DXBaseMesh::GetIndexBuffer([Out] IDirect3DIndexBuffer9** ppIB) ID3DXBaseMesh::GetIndexBuffer

Locks a vertex buffer and obtains a reference to the vertex buffer memory.

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

VOID* reference to a buffer containing the vertex data.

If the method succeeds, the return value is . If the method fails, the return value can be .

When working with vertex buffers, you are allowed to make multiple lock calls; however, you must ensure that the number of lock calls match the number of unlock calls. DrawPrimitive calls will not succeed with any outstanding lock count on any currently set vertex buffer.

bb205749 HRESULT ID3DXBaseMesh::LockVertexBuffer([In] unsigned int Flags,[In] void** ppData) ID3DXBaseMesh::LockVertexBuffer

Unlocks a vertex buffer.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205751 HRESULT ID3DXBaseMesh::UnlockVertexBuffer() ID3DXBaseMesh::UnlockVertexBuffer

Locks an index buffer and obtains a reference to the index buffer memory.

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

VOID* reference to a buffer containing the index data. The count of indices in this buffer will be equal to * 3.

If the method succeeds, the return value is . If the method fails, the return value can be .

When working with index buffers, you are allowed to make multiple lock calls. However, you must ensure that the number of lock calls match the number of unlock calls. DrawPrimitive calls will not succeed with any outstanding lock count on any currently set index buffer.

bb205748 HRESULT ID3DXBaseMesh::LockIndexBuffer([In] unsigned int Flags,[In] void** ppData) ID3DXBaseMesh::LockIndexBuffer

Unlocks an index buffer.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205750 HRESULT ID3DXBaseMesh::UnlockIndexBuffer() ID3DXBaseMesh::UnlockIndexBuffer

Retrieves either an attribute table for a mesh, or the number of entries stored in an attribute table for a mesh.

Pointer to an array of structures, representing the entries in the mesh's attribute table. Specify null to retrieve the value for pAttribTableSize.

Pointer to either the number of entries stored in pAttribTable or a value to be filled in with the number of entries stored in the attribute table for the mesh.

If the method succeeds, the return value is . If the method fails, the return value can be .

An attribute table is created by and passing for the Flags parameter.

An attribute table is used to identify areas of the mesh that need to be drawn with different textures, render states, materials, and so on. In addition, the application can use the attribute table to hide portions of a mesh by not drawing a given attribute identifier when drawing the frame.

bb205738 HRESULT ID3DXBaseMesh::GetAttributeTable([Out] D3DXATTRIBUTERANGE* pAttribTable,[Out] unsigned int* pAttribTableSize) ID3DXBaseMesh::GetAttributeTable

Converts point representative data to mesh adjacency information.

Pointer to an array of one DWORD per vertex of the mesh that contains point representative data. This parameter is optional. Supplying a null value will cause this parameter to be interpreted as an "identity" array.

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh. The number of bytes in this array must be at least 3 * * sizeof(DWORD).

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

bb205735 HRESULT ID3DXBaseMesh::ConvertPointRepsToAdjacency([In] const unsigned int* pPRep,[In] unsigned int* pAdjacency) ID3DXBaseMesh::ConvertPointRepsToAdjacency

Converts mesh adjacency information to an array of point representatives.

Pointer to an array of three DWORDs per face that specify the three neighbors for each face in the mesh. The number of bytes in this array must be at least 3 * * sizeof(DWORD).

Pointer to an array of one DWORD per vertex of the mesh that will be filled with point representative data.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

bb205734 HRESULT ID3DXBaseMesh::ConvertAdjacencyToPointReps([In] const unsigned int* pAdjacency,[In] unsigned int* pPRep) ID3DXBaseMesh::ConvertAdjacencyToPointReps

Generate a list of mesh edges, as well as a list of faces that share each edge.

Specifies that vertices that differ in position by less than epsilon should be treated as coincident.

Pointer to an array of three DWORDs per face to be filled with the indices of adjacent faces. The number of bytes in this array must be at least 3 * * sizeof(DWORD).

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

After an application generates adjacency information for a mesh, the mesh data can be optimized for better drawing performance.

The order of the entries in the adjacency buffer is determined by the order of the vertex indices in the index buffer. The adjacent triangle 0 always corresponds to the edge between the indices of the corners 0 and 1. The adjacent triangle 1 always corresponds to the edge between the indices of the corners 1 and 2 while the adjacent triangle 2 corresponds to the edge between the indices of the corners 2 and 0.

bb205737 HRESULT ID3DXBaseMesh::GenerateAdjacency([In] float Epsilon,[In] unsigned int* pAdjacency) ID3DXBaseMesh::GenerateAdjacency

This method allows the user to change the mesh declaration without changing the data layout of the vertex buffer. The call is valid only if the old and new declaration formats have the same vertex size.

An array of elements, describing the vertex format of the mesh vertices. The upper limit of this declarator array is .

If the method succeeds, the return value is . If the method fails, the return value can be .

is used to reformat and change the vertex data layout. For example, use it to to add space for normals, texture coordinates, colors, weights, etc. that were not present before.

is a method for updating the vertex declaration with different semantic information, without changing the layout of the vertex buffer. For example, use it to relabel a 3D texture coordinate as a binormal or tangent, or vice versa.

bb205752 HRESULT ID3DXBaseMesh::UpdateSemantics([In] D3DVERTEXELEMENT9* Declaration) ID3DXBaseMesh::UpdateSemantics

An application uses the methods of this interface to implement a key frame animation set stored in a compressed data format.

Create a compressed-format key frame animation set with .

The LPD3DXCOMPRESSEDANIMATIONSET type is defined as a reference to this interface.

 typedef interface  ;	
            typedef interface  *LPD3DXCOMPRESSEDANIMATIONSET;	
            
bb205756 ID3DXCompressedAnimationSet ID3DXCompressedAnimationSet
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the type of the animation set playback loop.

bb205760 GetPlaybackType GetPlaybackType D3DXPLAYBACK_TYPE ID3DXCompressedAnimationSet::GetPlaybackType()

Gets the number of animation key frame ticks that occur per second.

bb205761 GetSourceTicksPerSecond GetSourceTicksPerSecond double ID3DXCompressedAnimationSet::GetSourceTicksPerSecond()

Gets the data buffer that stores compressed key frame animation data.

bb205758 GetCompressedData GetCompressedData HRESULT ID3DXCompressedAnimationSet::GetCompressedData([Out] ID3DXBuffer** ppCompressedData)

Gets the number of callback keys in the animation set.

bb205759 GetNumCallbackKeys GetNumCallbackKeys unsigned int ID3DXCompressedAnimationSet::GetNumCallbackKeys()

Gets the type of the animation set playback loop.

Type of the animation set playback loop. See .

bb205760 D3DXPLAYBACK_TYPE ID3DXCompressedAnimationSet::GetPlaybackType() ID3DXCompressedAnimationSet::GetPlaybackType

Gets the number of animation key frame ticks that occur per second.

Number of animation key frame ticks that occur per second.

bb205761 double ID3DXCompressedAnimationSet::GetSourceTicksPerSecond() ID3DXCompressedAnimationSet::GetSourceTicksPerSecond

Gets the data buffer that stores compressed key frame animation data.

Address of a reference to the data buffer that receives compressed key frame animation data.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb205758 HRESULT ID3DXCompressedAnimationSet::GetCompressedData([Out] ID3DXBuffer** ppCompressedData) ID3DXCompressedAnimationSet::GetCompressedData

Gets the number of callback keys in the animation set.

Number of callback keys in the animation set.

bb205759 unsigned int ID3DXCompressedAnimationSet::GetNumCallbackKeys() ID3DXCompressedAnimationSet::GetNumCallbackKeys

Fills an array with callback key data used for key frame animation.

Pointer to a user-allocated array of structures that the method is to fill with callback data.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb205757 HRESULT ID3DXCompressedAnimationSet::GetCallbackKeys([In] D3DXKEY_CALLBACK* pCallbackKeys) ID3DXCompressedAnimationSet::GetCallbackKeys

This is a user-implemented interface that allows a user to set the device state from an effect. Each of the methods in this interface must be implemented by the user and will then be used as callbacks to the application when either of the following occur:

  • An effect calls .
  • Effect state is dynamically updated by calling the appropriate state change API. See individual method pages for details.

When an application uses the state manager to implement custom callbacks, an effect no longer automatically saves and restores state when calling and . Because the application has implemented a custom save and restore behavior in the callbacks, this automatic behavior is bypassed.

A user creates an interface by implementing a class that derives from this interface, and implementing all the interface methods. Once the interface is created, you can get or set the state manager within an effect using and .

The LPD3DXEFFECTSTATEMANAGER type is defined as a reference to this interface.

 typedef interface  ;	
            typedef interface  *LPD3DXEFFECTSTATEMANAGER;	
            
bb205795 ID3DXEffectStateManager ID3DXEffectStateManager
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

A callback function that must be implemented by a user to set material state.

bb205799 SetMaterial SetMaterial HRESULT ID3DXEffectStateManager::SetMaterial([In] const D3DMATERIAL9* pMaterial)

A callback function that must be implemented by a user to set the number of subdivision segments for N-patches.

bb205800 SetNPatchMode SetNPatchMode HRESULT ID3DXEffectStateManager::SetNPatchMode([In] float NumSegments)

A callback function that must be implemented by a user to set a FVF code.

bb205797 SetFVF SetFVF HRESULT ID3DXEffectStateManager::SetFVF([In] D3DFVF FVF)

A callback function that must be implemented by a user to set a vertex shader.

bb205810 SetVertexShader SetVertexShader HRESULT ID3DXEffectStateManager::SetVertexShader([In] IDirect3DVertexShader9* pShader)

A callback function that must be implemented by a user to set a pixel shader.

bb205801 SetPixelShader SetPixelShader HRESULT ID3DXEffectStateManager::SetPixelShader([In] IDirect3DPixelShader9* pShader)

A callback function that must be implemented by a user to set a transform.

The type of transform to apply the matrix to. See .

A transformation matrix. See .

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205809 HRESULT ID3DXEffectStateManager::SetTransform([In] D3DTRANSFORMSTATETYPE State,[In] const D3DMATRIX* pMatrix) ID3DXEffectStateManager::SetTransform

A callback function that must be implemented by a user to set material state.

A reference to the material state. See .

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205799 HRESULT ID3DXEffectStateManager::SetMaterial([In] const D3DMATERIAL9* pMaterial) ID3DXEffectStateManager::SetMaterial

A callback function that must be implemented by a user to set a light.

The zero-based index of the light. This is the same index in .

The light object. See .

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205798 HRESULT ID3DXEffectStateManager::SetLight([In] unsigned int Index,[In] const D3DLIGHT9* pLight) ID3DXEffectStateManager::SetLight

A callback function that must be implemented by a user to enable/disable a light.

The zero-based index of the light. This is the same index in .

True to enable the light, false otherwise.

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205796 HRESULT ID3DXEffectStateManager::LightEnable([In] unsigned int Index,[In] BOOL Enable) ID3DXEffectStateManager::LightEnable

A callback function that must be implemented by a user to set render state.

The render state to set.

The render state value. See Effect States (Direct3D 9).

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205805 HRESULT ID3DXEffectStateManager::SetRenderState([In] D3DRENDERSTATETYPE State,[In] unsigned int Value) ID3DXEffectStateManager::SetRenderState

A callback function that must be implemented by a user to set a texture.

The stage to which the texture is assigned. This is the index value in or .

A reference to the texture object. This can be any of the Direct3D texture types (cube, volume, etc.). See .

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205807 HRESULT ID3DXEffectStateManager::SetTexture([In] unsigned int Stage,[In] IDirect3DBaseTexture9* pTexture) ID3DXEffectStateManager::SetTexture

A callback function that must be implemented by a user to set the texture stage state.

The stage that the texture is assigned to. This is the index value in or .

Defines the type of operation that a texture stage will perform. See .

Can be either an operation () or an argument value (), depending on what is chosen for Type.

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205808 HRESULT ID3DXEffectStateManager::SetTextureStageState([In] unsigned int Stage,[In] D3DTEXTURESTAGESTATETYPE Type,[In] unsigned int Value) ID3DXEffectStateManager::SetTextureStageState

A callback function that must be implemented by a user to set a sampler.

The zero-based sampler number.

Identifies sampler state, which can specify the filtering, addressing, or the border color. See .

A value from one of the sampler state types in Type.

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205806 HRESULT ID3DXEffectStateManager::SetSamplerState([In] unsigned int Sampler,[In] D3DSAMPLERSTATETYPE Type,[In] unsigned int Value) ID3DXEffectStateManager::SetSamplerState

A callback function that must be implemented by a user to set the number of subdivision segments for N-patches.

Break the surface into this number of subdivisions. This is the same as the number used by .

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205800 HRESULT ID3DXEffectStateManager::SetNPatchMode([In] float NumSegments) ID3DXEffectStateManager::SetNPatchMode

A callback function that must be implemented by a user to set a FVF code.

The FVF constant, that determines how to interpret vertex data. See .

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205797 HRESULT ID3DXEffectStateManager::SetFVF([In] D3DFVF FVF) ID3DXEffectStateManager::SetFVF

A callback function that must be implemented by a user to set a vertex shader.

A reference to a vertex shader object. See .

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205810 HRESULT ID3DXEffectStateManager::SetVertexShader([In] IDirect3DVertexShader9* pShader) ID3DXEffectStateManager::SetVertexShader

A callback function that must be implemented by a user to set an array of vertex shader floating-point constants.

The zero-based index of the first constant register.

An array of floating-point constants.

The number of registers in pConstantData.

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205812 HRESULT ID3DXEffectStateManager::SetVertexShaderConstantF([In] unsigned int RegisterIndex,[In] const float* pConstantData,[In] unsigned int RegisterCount) ID3DXEffectStateManager::SetVertexShaderConstantF

A callback function that must be implemented by a user to set an array of vertex shader integer constants.

The zero-based index of the first constant register.

An array of integer constants.

The number of registers in pConstantData.

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205813 HRESULT ID3DXEffectStateManager::SetVertexShaderConstantI([In] unsigned int RegisterIndex,[In] const int* pConstantData,[In] unsigned int RegisterCount) ID3DXEffectStateManager::SetVertexShaderConstantI

A callback function that must be implemented by a user to set an array of vertex shader Boolean constants.

The zero-based index of the first constant register.

An array of Boolean constants.

The number of registers in pConstantData.

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205811 HRESULT ID3DXEffectStateManager::SetVertexShaderConstantB([In] unsigned int RegisterIndex,[In] const BOOL* pConstantData,[In] unsigned int RegisterCount) ID3DXEffectStateManager::SetVertexShaderConstantB

A callback function that must be implemented by a user to set a pixel shader.

A reference to a pixel shader object. See .

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205801 HRESULT ID3DXEffectStateManager::SetPixelShader([In] IDirect3DPixelShader9* pShader) ID3DXEffectStateManager::SetPixelShader

A callback function that must be implemented by a user to set an array of vertex shader floating-point constants.

The zero-based index of the first constant register.

An array of floating-point constants.

The number of registers in pConstantData.

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205803 HRESULT ID3DXEffectStateManager::SetPixelShaderConstantF([In] unsigned int RegisterIndex,[In] const float* pConstantData,[In] unsigned int RegisterCount) ID3DXEffectStateManager::SetPixelShaderConstantF

A callback function that must be implemented by a user to set an array of vertex shader integer constants.

The zero-based index of the first constant register.

An array of integer constants.

The number of registers in pConstantData.

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205804 HRESULT ID3DXEffectStateManager::SetPixelShaderConstantI([In] unsigned int RegisterIndex,[In] const int* pConstantData,[In] unsigned int RegisterCount) ID3DXEffectStateManager::SetPixelShaderConstantI

A callback function that must be implemented by a user to set an array of vertex shader Boolean constants.

The zero-based index of the first constant register.

An array of Boolean constants.

The number of registers in pConstantData.

The user-implemented method should return . If the callback fails when setting the device state, either of the following will occur:

  • The effect will fail during .
  • The dynamic effect state call (such as ) will fail.
bb205802 HRESULT ID3DXEffectStateManager::SetPixelShaderConstantB([In] unsigned int RegisterIndex,[In] const BOOL* pConstantData,[In] unsigned int RegisterCount) ID3DXEffectStateManager::SetPixelShaderConstantB

This interface is implemented by the application to allocate or free frame and mesh container objects. Methods on this are called during loading and destroying frame hierarchies.

The LPD3DXALLOCATEHIERARCHY type is defined as a reference to this interface.

 typedef interface  ;	
            typedef interface  *LPD3DXALLOCATEHIERARCHY;	
            
bb205619 ID3DXAllocateHierarchy ID3DXAllocateHierarchy
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Requests allocation of a frame object.

Name of the frame to be created.

Returns the created frame object.

The return values of this method are implemented by an application programmer. In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

bb205620 HRESULT ID3DXAllocateHierarchy::CreateFrame([In] const char* Name,[In] D3DXFRAME** ppNewFrame) ID3DXAllocateHierarchy::CreateFrame

Requests allocation of a mesh container object.

Name of the mesh.

Pointer to the mesh data structure. See .

Array of materials used in the mesh.

Array of effect instances used in the mesh. See .

Number of materials in the materials array.

Adjacency array for the mesh.

Pointer to the skin mesh object if skin data is found. See .

Returns the created mesh container. See .

The return values of this method are implemented by an application programmer. In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

bb205621 HRESULT ID3DXAllocateHierarchy::CreateMeshContainer([In] const char* Name,[In] const D3DXMESHDATA* pMeshData,[In] const D3DXMATERIAL* pMaterials,[In] const D3DXEFFECTINSTANCE* pEffectInstances,[In] unsigned int NumMaterials,[In] const unsigned int* pAdjacency,[In] ID3DXSkinInfo* pSkinInfo,[In] D3DXMESHCONTAINER** ppNewMeshContainer) ID3DXAllocateHierarchy::CreateMeshContainer

Requests deallocation of a frame object.

Pointer to the frame to be deallocated.

The return values of this method are implemented by an application programmer. In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

bb205622 HRESULT ID3DXAllocateHierarchy::DestroyFrame([In] D3DXFRAME* pFrameToFree) ID3DXAllocateHierarchy::DestroyFrame

Requests deallocation of a mesh container object.

Pointer to the mesh container object to be deallocated.

The return values of this method are implemented by an application programmer. In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

bb205623 HRESULT ID3DXAllocateHierarchy::DestroyMeshContainer([In] D3DXMESHCONTAINER* pMeshContainerToFree) ID3DXAllocateHierarchy::DestroyMeshContainer

This interface is implemented by the application to save any additional user data embedded in .x files. An instance of this interface is passed to , and D3DX calls the appropriate method on this interface every time the appropriate data is encountered. For example, for each frame object in the .x file, is called and passed the child data.

The LPD3DXLOADUSERDATA type is defined as a reference to this interface.

 typedef interface  ;	
            typedef interface  *LPD3DXLOADUSERDATA;	
            
bb174034 ID3DXLoadUserData ID3DXLoadUserData
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Load top level data from a .x file.

Pointer to a .x file data structure. This is defined in Dxfile.h.

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

bb174037 HRESULT ID3DXLoadUserData::LoadTopLevelData([In] ID3DXFileData* pXofChildData) ID3DXLoadUserData::LoadTopLevelData

Load frame child data from a .x file.

Pointer to a mesh container. See .

Pointer to a .x file data structure. This is defined in Dxfile.h.

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

bb174035 HRESULT ID3DXLoadUserData::LoadFrameChildData([In] D3DXFRAME* pFrame,[In] ID3DXFileData* pXofChildData) ID3DXLoadUserData::LoadFrameChildData

Load mesh child data from a .x file.

Pointer to a mesh container. See .

Pointer to a .x file data structure. This is defined in Dxfile.h.

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

bb174036 HRESULT ID3DXLoadUserData::LoadMeshChildData([In] D3DXMESHCONTAINER* pMeshContainer,[In] ID3DXFileData* pXofChildData) ID3DXLoadUserData::LoadMeshChildData

is a user-implemented interface to provide callbacks for #include directives during shader compilation. Each of the methods in this interface must be implemented by the user which will then be used as callbacks to the application when one of the following occurs:

  • An HLSL shader that contains a #include is compiled by calling one of the *** functions.
  • An assembly shader #include is assembled by calling any of the *** functions.
  • An effect that contains a #include is compiled by by calling any of the *** or *** functions.

A user creates an interface by implementing a class that derives from this interface, and implementing all the interface methods.

The LPD3DXINCLUDE type is defined as a reference to this interface.

 typedef interface  ;	
            typedef interface  *LPD3DXINCLUDE;	
            
bb173986 ID3DXInclude ID3DXInclude
A user-implemented method for opening and reading the contents of a shader #include file. A -typed value that indicates the location of the #include file. Name of the #include file. Pointer to the container that includes the #include file. Stream that is associated with fileName to be read. This reference remains valid until is called. HRESULT Open([None] D3D_INCLUDE_TYPE IncludeType,[None] const char* pFileName,[None] LPCVOID pParentData,[None] LPCVOID* ppData,[None] UINT* pBytes) A user-implemented method for closing a shader #include file. If was successful, Close is guaranteed to be called before the API using the interface returns. This is a reference that was returned by the corresponding call. HRESULT Close([None] LPCVOID pData)

Applications use the methods of the interface to manipulate an index buffer resource.

The interface is obtained by calling the method.

This interface inherits additional functionality from the interface.

This interface, like all COM interfaces, inherits from the interface.

The LPDIRECT3DINDEXBUFFER9 and PDIRECT3DINDEXBUFFER9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DINDEXBUFFER9, *PDIRECT3DINDEXBUFFER9;	
            
bb205865 IDirect3DIndexBuffer9 IDirect3DIndexBuffer9
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves a description of the index buffer resource.

bb205866 GetDesc GetDesc HRESULT IDirect3DIndexBuffer9::GetDesc([Out] D3DINDEXBUFFER_DESC* pDesc)

Locks a range of index data and obtains a reference to the index buffer memory.

Offset into the index data to lock, in bytes. Lock the entire index buffer by specifying 0 for both parameters, SizeToLock and OffsetToLock.

Size of the index data to lock, in bytes. Lock the entire index buffer by specifying 0 for both parameters, SizeToLock and OffsetToLock.

VOID* reference to a memory buffer containing the returned index data.

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

If the method succeeds, the return value is . If the method fails, the return value can be .

As a general rule, do not hold a lock across more than one frame. When working with index buffers, you are allowed to make multiple lock calls. However, you must ensure that the number of lock calls match the number of unlock calls. calls will not succeed with any outstanding lock count on any currently set index buffer.

The and flags are valid only on buffers created with .

See Programming Tips (Direct3D 9) for information about using or .

bb205867 HRESULT IDirect3DIndexBuffer9::Lock([In] unsigned int OffsetToLock,[In] unsigned int SizeToLock,[Out] void** ppbData,[In] D3DLOCK Flags) IDirect3DIndexBuffer9::Lock

Unlocks index data.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205868 HRESULT IDirect3DIndexBuffer9::Unlock() IDirect3DIndexBuffer9::Unlock

Retrieves a description of the index buffer resource.

Pointer to a structure, describing the returned index buffer.

If the method succeeds, the return value is . is returned if the argument is invalid.

bb205866 HRESULT IDirect3DIndexBuffer9::GetDesc([Out] D3DINDEXBUFFER_DESC* pDesc) IDirect3DIndexBuffer9::GetDesc
Initializes a new instance of the class. The device. The size in bytes. The usage. The pool. if set to true use 16bit index buffer, otherwise, use 32bit index buffer. bb174357 HRESULT IDirect3DDevice9::CreateIndexBuffer([In] unsigned int Length,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DIndexBuffer9** ppIndexBuffer,[In] void** pSharedHandle) IDirect3DDevice9::CreateIndexBuffer Initializes a new instance of the class. The device. The size in bytes. The usage. The pool. if set to true use 16bit index buffer, otherwise, use 32bit index buffer. The shared handle. bb174357 HRESULT IDirect3DDevice9::CreateIndexBuffer([In] unsigned int Length,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DIndexBuffer9** ppIndexBuffer,[In] void** pSharedHandle) IDirect3DDevice9::CreateIndexBuffer Locks the specified index buffer. The offset in the buffer. The size of the buffer to lock. The lock flags. A containing the locked index buffer. bb205867 HRESULT IDirect3DIndexBuffer9::Lock([In] unsigned int OffsetToLock,[In] unsigned int SizeToLock,[Out] void** ppbData,[In] D3DLOCK Flags) IDirect3DIndexBuffer9::Lock Locks the specified index buffer. The offset in the buffer. The size of the buffer to lock. The lock flags. A containing the locked index buffer. bb205867 HRESULT IDirect3DIndexBuffer9::Lock([In] unsigned int OffsetToLock,[In] unsigned int SizeToLock,[Out] void** ppbData,[In] D3DLOCK Flags) IDirect3DIndexBuffer9::Lock

This interface is implemented by the application to save any additional user data embedded in .x files. An instance of this interface is passed to , and D3DX calls the appropriate method on this interface every time the appropriate data is encountered. For example, for each frame object in the .x file, is called and passed the child data.

The LPD3DXSAVEUSERDATA type is defined as a reference to this interface.

 typedef interface  ;	
            typedef interface  *LPD3DXSAVEUSERDATA;	
            
bb174199 ID3DXSaveUserData ID3DXSaveUserData
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Add child data to the frame.

Pointer to a mesh container. See .

Pointer to a .x file save object. Use the reference to call to add a child data object. Do not save the data with .

Pointer to a .x file data node. Use the reference to call to add a child data object.

The return values of this method are implemented by an application programmer. In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

and provide a mechanism for adding a template to a .x file for saving user data.

bb174200 HRESULT ID3DXSaveUserData::AddFrameChildData([In] const D3DXFRAME* pFrame,[In] ID3DXFileSaveObject* pXofSave,[In] ID3DXFileSaveData* pXofFrameData) ID3DXSaveUserData::AddFrameChildData

Add child data to the mesh.

Pointer to a mesh container. See .

Pointer to a .x file save object. Use the reference to call to add a child data object. Do not save the data with .

Pointer to a .x file data node. Use the reference to call to add a child data object.

The return values of this method are implemented by an application programmer. In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

bb174201 HRESULT ID3DXSaveUserData::AddMeshChildData([In] const D3DXMESHCONTAINER* pMeshContainer,[In] ID3DXFileSaveObject* pXofSave,[In] ID3DXFileSaveData* pXofMeshData) ID3DXSaveUserData::AddMeshChildData

Add a top level object before the frame hierarchy.

Pointer to a .x file save object. Use this reference to call IDirectXFileSaveObject::CreateDataObject to create the data object to be saved. Then call IDirectXFileSaveObject::SaveData to save the data.

The return values of this method are implemented by an application programmer. In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

bb174203 HRESULT ID3DXSaveUserData::AddTopLevelDataObjectsPre([In] ID3DXFileSaveObject* pXofSave) ID3DXSaveUserData::AddTopLevelDataObjectsPre

Add a top level object after the frame hierarchy.

Pointer to a .x file save object. Use this reference to call IDirectXFileSaveObject::CreateDataObject to create the data object to be saved. Then call IDirectXFileSaveObject::SaveData to save the data.

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

bb174202 HRESULT ID3DXSaveUserData::AddTopLevelDataObjectsPost([In] ID3DXFileSaveObject* pXofSave) ID3DXSaveUserData::AddTopLevelDataObjectsPost

A callback for the user to register a .x file template.

Use this reference to register user-defined .x file templates. See . Do not use this parameter to add data objects.

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

and provide a mechanism for adding a template to a .x file for saving user data.

bb174204 HRESULT ID3DXSaveUserData::RegisterTemplates([In] ID3DXFile* pXFileApi) ID3DXSaveUserData::RegisterTemplates

A callback for the user to save a .x file template.

Pointer to a .x file save object. Do not use this parameter to add data objects. See .

The return values of this method are implemented by an application programmer.In general, if no error occurs, program the method to return . Otherwise, program the method to return an appropriate error message from D3DERR or D3DXERR, as this will cause to fail also, and return the error.

and provide a mechanism for adding a template to a .x file for saving user data.

bb174205 HRESULT ID3DXSaveUserData::SaveTemplates([In] ID3DXFileSaveObject* pXofSave) ID3DXSaveUserData::SaveTemplates

An application uses the methods of this interface to implement a key frame animation set.

Create a keyframed animation set with .

The LPD3DXKEYFRAMEDANIMATIONSET type is defined as a reference to this interface.

 typedef interface  ;	
            typedef interface  *LPD3DXKEYFRAMEDANIMATIONSET;	
            
bb173989 ID3DXKeyframedAnimationSet ID3DXKeyframedAnimationSet
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the type of the animation set playback loop.

bb173997 GetPlaybackType GetPlaybackType D3DXPLAYBACK_TYPE ID3DXKeyframedAnimationSet::GetPlaybackType()

Gets the number of animation key frame ticks that occur per second.

bb174004 GetSourceTicksPerSecond GetSourceTicksPerSecond double ID3DXKeyframedAnimationSet::GetSourceTicksPerSecond()

Gets the number of callback keys in the animation set.

bb173993 GetNumCallbackKeys GetNumCallbackKeys unsigned int ID3DXKeyframedAnimationSet::GetNumCallbackKeys()

Gets the type of the animation set playback loop.

Type of the animation set playback loop. See .

bb173997 D3DXPLAYBACK_TYPE ID3DXKeyframedAnimationSet::GetPlaybackType() ID3DXKeyframedAnimationSet::GetPlaybackType

Gets the number of animation key frame ticks that occur per second.

Number of animation key frame ticks that occur per second.

bb174004 double ID3DXKeyframedAnimationSet::GetSourceTicksPerSecond() ID3DXKeyframedAnimationSet::GetSourceTicksPerSecond

Gets the number of scale keys in the specified key frame animation.

Animation index.

Number of scale keys in the specified key frame animation.

bb173995 unsigned int ID3DXKeyframedAnimationSet::GetNumScaleKeys([In] unsigned int Animation) ID3DXKeyframedAnimationSet::GetNumScaleKeys

Fills an array with scale key data used for key frame animation.

Animation index.

Pointer to a user-allocated array of vectors that the method is to fill with animation scale data.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb174003 HRESULT ID3DXKeyframedAnimationSet::GetScaleKeys([In] unsigned int Animation,[In] D3DXKEY_VECTOR3* pScaleKeys) ID3DXKeyframedAnimationSet::GetScaleKeys

Get scale information for a specific key frame in the animation set.

Animation index.

Key frame.

Pointer to the scale data. See .

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb174002 HRESULT ID3DXKeyframedAnimationSet::GetScaleKey([In] unsigned int Animation,[In] unsigned int Key,[In] D3DXKEY_VECTOR3* pScaleKey) ID3DXKeyframedAnimationSet::GetScaleKey

Set scale information for a specific key frame in the animation set.

Animation index.

Key frame.

Pointer to the scale data. See .

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb174010 HRESULT ID3DXKeyframedAnimationSet::SetScaleKey([In] unsigned int Animation,[In] unsigned int Key,[In] D3DXKEY_VECTOR3* pScaleKey) ID3DXKeyframedAnimationSet::SetScaleKey

Gets the number of rotation keys in the specified key frame animation.

Animation index.

Number of rotation keys in the specified key frame animation.

bb173994 unsigned int ID3DXKeyframedAnimationSet::GetNumRotationKeys([In] unsigned int Animation) ID3DXKeyframedAnimationSet::GetNumRotationKeys

Fills an array with rotational key data used for key frame animation.

Animation index.

Pointer to a user-allocated array of quaternions that the method is to fill with animation rotation data.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb174001 HRESULT ID3DXKeyframedAnimationSet::GetRotationKeys([In] unsigned int Animation,[In] D3DXKEY_QUATERNION* pRotationKeys) ID3DXKeyframedAnimationSet::GetRotationKeys

Get rotation information for a specific key frame in the animation set.

Animation index.

Key frame.

Pointer to the rotation data. See .

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb173998 HRESULT ID3DXKeyframedAnimationSet::GetRotationKey([In] unsigned int Animation,[In] unsigned int Key,[In] D3DXKEY_QUATERNION* pRotationKey) ID3DXKeyframedAnimationSet::GetRotationKey

Set rotation information for a specific key frame in the animation set.

Animation index.

Key frame.

Pointer to the rotation data. See .

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb174009 HRESULT ID3DXKeyframedAnimationSet::SetRotationKey([In] unsigned int Animation,[In] unsigned int Key,[In] D3DXKEY_QUATERNION* pRotationKey) ID3DXKeyframedAnimationSet::SetRotationKey

Gets the number of translation keys in the specified key frame animation.

Animation index.

Number of translation keys in the specified key frame animation.

bb173996 unsigned int ID3DXKeyframedAnimationSet::GetNumTranslationKeys([In] unsigned int Animation) ID3DXKeyframedAnimationSet::GetNumTranslationKeys

Fills an array with translational key data used for key frame animation.

Animation index.

Pointer to a user-allocated array of vectors that the method is to fill with animation translation data.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb174006 HRESULT ID3DXKeyframedAnimationSet::GetTranslationKeys([In] unsigned int Animation,[In] D3DXKEY_VECTOR3* pTranslationKeys) ID3DXKeyframedAnimationSet::GetTranslationKeys

Get translation information for a specific key frame in the animation set.

Animation index.

Key Frame.

Pointer to the rotation information. See .

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb174005 HRESULT ID3DXKeyframedAnimationSet::GetTranslationKey([In] unsigned int Animation,[In] unsigned int Key,[In] D3DXKEY_VECTOR3* pTranslationKey) ID3DXKeyframedAnimationSet::GetTranslationKey

Set translation information for a specific key frame in the animation set.

Animation index.

Key Frame.

Pointer to the translation data. See .

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb174011 HRESULT ID3DXKeyframedAnimationSet::SetTranslationKey([In] unsigned int Animation,[In] unsigned int Key,[In] D3DXKEY_VECTOR3* pTranslationKey) ID3DXKeyframedAnimationSet::SetTranslationKey

Gets the number of callback keys in the animation set.

Number of callback keys in the animation set.

bb173993 unsigned int ID3DXKeyframedAnimationSet::GetNumCallbackKeys() ID3DXKeyframedAnimationSet::GetNumCallbackKeys

Fills an array with callback key data used for key frame animation.

Pointer to a user-allocated array of structures that the method is to fill with callback data.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb173992 HRESULT ID3DXKeyframedAnimationSet::GetCallbackKeys([In] D3DXKEY_CALLBACK* pCallbackKeys) ID3DXKeyframedAnimationSet::GetCallbackKeys

Gets information about a specific callback in the animation set.

Animation index.

Pointer to the callback function.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb173991 HRESULT ID3DXKeyframedAnimationSet::GetCallbackKey([In] unsigned int Key,[In] D3DXKEY_CALLBACK* pCallbackKey) ID3DXKeyframedAnimationSet::GetCallbackKey

Sets information about a specific callback in the animation set.

Animation index.

Pointer to the callback function.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb174008 HRESULT ID3DXKeyframedAnimationSet::SetCallbackKey([In] unsigned int Key,[In] D3DXKEY_CALLBACK* pCallbackKey) ID3DXKeyframedAnimationSet::SetCallbackKey

Removes the scale data at the specified key frame.

Animation identifier.

Key frame.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

This method is slow and should not be used after an animation has begun to play.

bb174014 HRESULT ID3DXKeyframedAnimationSet::UnregisterScaleKey([In] unsigned int Animation,[In] unsigned int Key) ID3DXKeyframedAnimationSet::UnregisterScaleKey

Removes the rotation data at the specified key frame.

Animation identifier.

Key frame.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

This method is slow and should not be used after an animation has begun to play.

bb174013 HRESULT ID3DXKeyframedAnimationSet::UnregisterRotationKey([In] unsigned int Animation,[In] unsigned int Key) ID3DXKeyframedAnimationSet::UnregisterRotationKey

Removes the translation data at the specified key frame.

Animation identifier.

Key frame.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

This method is slow and should not be used after an animation has begun to play.

bb174015 HRESULT ID3DXKeyframedAnimationSet::UnregisterTranslationKey([In] unsigned int Animation,[In] unsigned int Key) ID3DXKeyframedAnimationSet::UnregisterTranslationKey

Register the scale, rotate, and translate (SRT) key frame data for an animation.

Pointer to the animation name.

Number of scale keys.

Number of rotation keys.

Number of translation keys.

Address of a reference to a user-allocated array of vectors that the method fills with scale data.

Address of a reference to a user-allocated array of quaternions that the method fills with rotation data.

Address of a reference to a user-allocated array of vectors that the method fills with translation data.

Returns the animation index.

If the method succeeds, the return value is . If the method fails, the following value will be returned:

bb174007 HRESULT ID3DXKeyframedAnimationSet::RegisterAnimationSRTKeys([In] const char* pName,[In] unsigned int NumScaleKeys,[In] unsigned int NumRotationKeys,[In] unsigned int NumTranslationKeys,[In] const D3DXKEY_VECTOR3* pScaleKeys,[In] const D3DXKEY_QUATERNION* pRotationKeys,[In] const D3DXKEY_VECTOR3* pTranslationKeys,[In] unsigned int* pAnimationIndex) ID3DXKeyframedAnimationSet::RegisterAnimationSRTKeys

Transforms animations in an animation set into a compressed format and returns a reference to the buffer that stores the compressed data.

One of the values that define the compression mode used for storing compressed animation set data. is the only value currently supported.

Desired compression loss ratio, in the range from 0 to 1.

Pointer to a transformation frame hierarchy. Can be null.

Address of a reference to the compressed animation set.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: , E_OUTOFMEMORY.

bb173990 HRESULT ID3DXKeyframedAnimationSet::Compress([In] unsigned int Flags,[In] float Lossiness,[In] D3DXFRAME* pHierarchy,[In] ID3DXBuffer** ppCompressedData) ID3DXKeyframedAnimationSet::Compress

Remove the animation data from the animation set.

The animation index.

If the method succeeds, the return value is . If the method fails, the following value will be returned: .

bb174012 HRESULT ID3DXKeyframedAnimationSet::UnregisterAnimation([In] unsigned int Index) ID3DXKeyframedAnimationSet::UnregisterAnimation

The interface implements line drawing using textured triangles.

Create a line drawing object with .

The LPD3DXLINE type is defined as a reference to the interface.

 typedef interface  ;	
            typedef interface  *LPD3DXLINE;	
            
bb174016 ID3DXLine ID3DXLine
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the Direct3D device associated with the line object.

bb174022 GetDevice GetDevice HRESULT ID3DXLine::GetDevice([Out] IDirect3DDevice9** ppDevice)

Gets or sets the line stipple pattern.

bb174024 GetPattern / SetPattern GetPattern unsigned int ID3DXLine::GetPattern()

Gets or sets the stipple-pattern scale value.

bb174025 GetPatternScale / SetPatternScale GetPatternScale float ID3DXLine::GetPatternScale()

Gets or sets the thickness of the line.

bb174026 GetWidth / SetWidth GetWidth float ID3DXLine::GetWidth()

Gets or sets the line antialiasing state.

bb174021 GetAntialias / SetAntialias GetAntialias BOOL ID3DXLine::GetAntialias()

Gets or sets the OpenGL-style line-drawing mode.

bb174023 GetGLLines / SetGLLines GetGLLines BOOL ID3DXLine::GetGLLines()

Retrieves the Direct3D device associated with the line object.

Address of a reference to an interface, representing the Direct3D device object associated with the line object.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

bb174022 HRESULT ID3DXLine::GetDevice([Out] IDirect3DDevice9** ppDevice) ID3DXLine::GetDevice

Prepares a device for drawing lines.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

Calling is optional. If called outside of a / sequence, the draw functions will internally call and . To avoid extra overhead, this method should be used if more than one draw function will be called successively.

This method must be called from inside an and sequence.

cannot be used as a substitute for either or .

bb174017 HRESULT ID3DXLine::Begin() ID3DXLine::Begin

Draws a line strip in screen space. Input is in the form of an array that defines points (of ) on the line strip.

No documentation. No documentation. No documentation.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

bb174018 HRESULT ID3DXLine::Draw([In] const void* pVertexList,[In] unsigned int dwVertexListCount,[In] D3DCOLOR Color) ID3DXLine::Draw

Draws a line strip in screen space with a specified input transformation matrix.

Array of vertices that make up the line. See .

Number of vertices in the vertex list.

A scale, rotate, and translate (SRT) matrix for transforming the points. See . If this matrix is a projection matrix, any stippled lines will be drawn with a perspective-correct stippling pattern. Or, you can transform the vertices and use to draw the line with a nonperspective-correct stipple pattern.

Color of the line. See .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

bb174019 HRESULT ID3DXLine::DrawTransform([In] const void* pVertexList,[In] unsigned int dwVertexListCount,[In] const D3DXMATRIX* pTransform,[In] D3DCOLOR Color) ID3DXLine::DrawTransform

Applies a stipple pattern to the line.

Describes the stipple pattern: 1 is opaque, 0 is transparent.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

bb174031 HRESULT ID3DXLine::SetPattern([In] unsigned int dwPattern) ID3DXLine::SetPattern

Gets the line stipple pattern.

Returns the line stipple pattern: 1 is opaque, 0 is transparent.

bb174024 unsigned int ID3DXLine::GetPattern() ID3DXLine::GetPattern

Stretches the stipple pattern along the line direction.

Stipple pattern scaling value. 1.0f is the default value and represents no scaling. A value less than 1.0f shrinks the pattern, and a value greater than 1.0 stretches the pattern.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

bb174032 HRESULT ID3DXLine::SetPatternScale([In] float fPatternScale) ID3DXLine::SetPatternScale

Gets the stipple-pattern scale value.

Returns the value used to scale the stipple-pattern. 1.0f is the default value and represents no scaling. A value less than 1.0f shrinks the pattern, and a value greater than 1.0 stretches the pattern.

bb174025 float ID3DXLine::GetPatternScale() ID3DXLine::GetPatternScale

Specifies the thickness of the line.

Describes the line width.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

bb174033 HRESULT ID3DXLine::SetWidth([In] float fWidth) ID3DXLine::SetWidth

Gets the thickness of the line.

The line thickness.

bb174026 float ID3DXLine::GetWidth() ID3DXLine::GetWidth

Toggles line antialiasing.

Toggles antialiasing on and off. TRUE turns antialiasing on, and turns antialiasing off.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

bb174029 HRESULT ID3DXLine::SetAntialias([In] BOOL bAntialias) ID3DXLine::SetAntialias

Gets the line antialiasing state.

Returns the antialiasing switch value. TRUE means antialiasing is on, and means antialiasing is off.

bb174021 BOOL ID3DXLine::GetAntialias() ID3DXLine::GetAntialias

Toggles the mode to draw OpenGL-style lines.

Toggles OpenGL-style line drawing. TRUE enables OpenGL-style lines, and enables Direct3D-style lines.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

bb174030 HRESULT ID3DXLine::SetGLLines([In] BOOL bGLLines) ID3DXLine::SetGLLines

Gets the OpenGL-style line-drawing mode.

Returns TRUE if OpenGL-style lines are enabled, and if Direct3D-style lines are enabled.

bb174023 BOOL ID3DXLine::GetGLLines() ID3DXLine::GetGLLines

Restores the device state to how it was when was called.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

cannot be used as a substitute for either or .

bb174020 HRESULT ID3DXLine::End() ID3DXLine::End

Use this method to release all references to video memory resources and delete all stateblocks. This method should be called whenever a device is lost, or before resetting a device.

If the method succeeds, the return value is . If the method fails, the return value can be .

This method should be called whenever the device is lost or before the user calls . Even if the device was not actually lost, is responsible for freeing stateblocks and other resources that may need to be released before resetting the device. As a result, the font object cannot be used again before calling and then .

bb174027 HRESULT ID3DXLine::OnLostDevice() ID3DXLine::OnLostDevice

Use this method to re-acquire resources and save initial state.

If the method succeeds, the return value is . If the method fails, the return value can be .

should be called each time the device is reset (using ), before any other methods are called. This is a good place to re-acquire video-memory resources and capture state blocks.

bb174028 HRESULT ID3DXLine::OnResetDevice() ID3DXLine::OnResetDevice
Instantiates a left-handed coordinate system to create a . Pointer to an interface, representing the device associated with the created box mesh. This function creates a mesh with the creation option and | Flexible Vertex Format (FVF). HRESULT D3DXCreateLine([In] IDirect3DDevice9* pDevice,[Out, Fast] ID3DXLine** ppLine) Draws a line strip in screen space. Input is in the form of an array that defines points (of ) on the line strip. No documentation. No documentation. HRESULT ID3DXLine::Draw([In] const void* pVertexList,[In] unsigned int dwVertexListCount,[In] D3DCOLOR Color) Draws a line strip in screen space. Input is in the form of an array that defines points (of ) on the line strip. No documentation. No documentation. HRESULT ID3DXLine::Draw([In] const void* pVertexList,[In] unsigned int dwVertexListCount,[In] D3DCOLOR Color) Draws a line strip in screen space with a specified input transformation matrix. Array of vertices that make up the line. See . A scale, rotate, and translate (SRT) matrix for transforming the points. See . If this matrix is a projection matrix, any stippled lines will be drawn with a perspective-correct stippling pattern. Or, you can transform the vertices and use to draw the line with a nonperspective-correct stipple pattern. Color of the line. See . If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA. HRESULT ID3DXLine::DrawTransform([In] const void* pVertexList,[In] unsigned int dwVertexListCount,[In] const D3DXMATRIX* pTransform,[In] D3DCOLOR Color) Draws a line strip in screen space with a specified input transformation matrix. Array of vertices that make up the line. See . A scale, rotate, and translate (SRT) matrix for transforming the points. See . If this matrix is a projection matrix, any stippled lines will be drawn with a perspective-correct stippling pattern. Or, you can transform the vertices and use to draw the line with a nonperspective-correct stipple pattern. Color of the line. See . If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA. HRESULT ID3DXLine::DrawTransform([In] const void* pVertexList,[In] unsigned int dwVertexListCount,[In] const D3DXMATRIX* pTransform,[In] D3DCOLOR Color)

Applications use the methods of the interface to manipulate mesh objects.

To obtain the interface, call either the or function.

This interface inherits additional functionality from the interface.

The LPD3DXMESH type is defined as a reference to the interface.

 typedef struct  *LPD3DXMESH;	
            
bb174069 ID3DXMesh ID3DXMesh
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Locks the mesh buffer that contains the mesh attribute data, and returns a reference to it.

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

Address of a reference to a buffer containing a DWORD for each face in the mesh.

If the method succeeds, the return value is . If the method fails, the return value can be .

If has been called, the mesh will also have an attribute table that can be accessed using the method.

bb174070 HRESULT ID3DXMesh::LockAttributeBuffer([In] unsigned int Flags,[In] unsigned int** ppData) ID3DXMesh::LockAttributeBuffer

Unlocks an attribute buffer.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174074 HRESULT ID3DXMesh::UnlockAttributeBuffer() ID3DXMesh::UnlockAttributeBuffer

Generates a new mesh with reordered faces and vertices to optimize drawing performance.

Specifies the type of optimization to perform. This parameter can be set to a combination of one or more flags from D3DXMESHOPT and D3DXMESH (except , , and ).

Pointer to an array of three DWORDs per face that specifies the three neighbors for each face in the source mesh. If the edge has no adjacent faces, the value is 0xffffffff. See Remarks.

Pointer to an array of three DWORDs per face that specifies the three neighbors for each face in the optimized mesh. If the edge has no adjacent faces, the value is 0xffffffff.

An array of DWORDs, one per face, that identifies the original mesh face that corresponds to each face in the optimized mesh. If the value supplied for this argument is null, face remap data is not returned.

Address of a reference to an interface, which contains a DWORD for each vertex that specifies how the new vertices map to the old vertices. This remap is useful if you need to alter external data based on the new vertex mapping.

Address of a reference to an interface, representing the optimized mesh.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

This method generates a new mesh. Before running Optimize, an application must generate an adjacency buffer by calling . The adjacency buffer contains adjacency data, such as a list of edges and the faces that are adjacent to each other.

This method is very similar to the method, except that it can perform optimization while generating the new clone of the mesh. The output mesh inherits all of the creation parameters of the input mesh.

bb174071 HRESULT ID3DXMesh::Optimize([In] unsigned int Flags,[In] const unsigned int* pAdjacencyIn,[In] unsigned int* pAdjacencyOut,[In] unsigned int* pFaceRemap,[In] ID3DXBuffer** ppVertexRemap,[In] ID3DXMesh** ppOptMesh) ID3DXMesh::Optimize

Generates a mesh with reordered faces and vertices to optimize drawing performance. This method reorders the existing mesh.

Combination of one or more D3DXMESHOPT flags, specifying the type of optimization to perform.

Pointer to an array of three DWORDs per face that specifies the three neighbors for each face in the source mesh. If the edge has no adjacent faces, the value is 0xffffffff.

Pointer to an array of three DWORDs per face that specifies the three neighbors for each face in the optimized mesh. If the edge has no adjacent faces, the value is 0xffffffff. If the value supplied for this argument is null, adjacency data is not returned.

An array of DWORDs, one per face, that identifies the original mesh face that corresponds to each face in the optimized mesh. If the value supplied for this argument is null, face remap data is not returned.

Address of a reference to an interface, which contains a DWORD for each vertex that specifies how the new vertices map to the old vertices. This remap is useful if you need to alter external data based on the new vertex mapping. If the value supplied for this argument is null, vertex remap data is not returned.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_CANNOTATTRSORT, E_OUTOFMEMORY.

Before running , an application must generate an adjacency buffer by calling . The adjacency buffer contains adjacency data, such as a list of edges and the faces that are adjacent to each other.

Note??This method will fail if the mesh is sharing its vertex buffer with another mesh, unless the is set in Flags.

bb174072 HRESULT ID3DXMesh::OptimizeInplace([In] unsigned int Flags,[In] const unsigned int* pAdjacencyIn,[In] unsigned int* pAdjacencyOut,[In] unsigned int* pFaceRemap,[In] ID3DXBuffer** ppVertexRemap) ID3DXMesh::OptimizeInplace

Sets the attribute table for a mesh and the number of entries stored in the table.

Pointer to an array of structures, representing the entries in the mesh attribute table.

Number of attributes in the mesh attribute table.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

If an application keeps track of the information in an attribute table, and rearranges the table as a result of changes to attributes or faces, this method allows the application to update the attribute tables instead of calling again.

bb174073 HRESULT ID3DXMesh::SetAttributeTable([In] const D3DXATTRIBUTERANGE* pAttribTable,[In] unsigned int cAttribTableSize) ID3DXMesh::SetAttributeTable

This interface encapsulates patch mesh functionality.

A patch mesh is a mesh that consists of a series of patches.

To obtain the interface, call the function.

The LPD3DXPATCHMESH type is defined as a reference to the interface, as follows:

 typedef struct  *LPD3DXPATCHMESH;	
            
bb174075 ID3DXPatchMesh ID3DXPatchMesh
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the number of patches in the mesh.

bb174083 GetNumPatches GetNumPatches unsigned int ID3DXPatchMesh::GetNumPatches()

Gets the number of vertices in the mesh.

bb174084 GetNumVertices GetNumVertices unsigned int ID3DXPatchMesh::GetNumVertices()

Gets the number of control vertices per patch.

bb174078 GetControlVerticesPerPatch GetControlVerticesPerPatch unsigned int ID3DXPatchMesh::GetControlVerticesPerPatch()

Gets the type of patch.

For more information about patch types, see .

bb174085 GetOptions GetOptions unsigned int ID3DXPatchMesh::GetOptions()

Gets the device that created the mesh.

bb174080 GetDevice GetDevice HRESULT ID3DXPatchMesh::GetDevice([Out] IDirect3DDevice9** ppDevice)

Gets the mesh vertex buffer.

This method assumes uniform tessellation.

bb174088 GetVertexBuffer GetVertexBuffer HRESULT ID3DXPatchMesh::GetVertexBuffer([Out] IDirect3DVertexBuffer9** ppVB)

Gets the mesh index buffer.

The index buffer contains the vertex ordering in the vertex buffer. The index buffer is used to access the vertex buffer when the mesh is rendered.

bb174082 GetIndexBuffer GetIndexBuffer HRESULT ID3DXPatchMesh::GetIndexBuffer([Out] IDirect3DIndexBuffer9** ppIB)

Gets the number of patches in the mesh.

The number of patches.

bb174083 unsigned int ID3DXPatchMesh::GetNumPatches() ID3DXPatchMesh::GetNumPatches

Gets the number of vertices in the mesh.

The number of vertices.

bb174084 unsigned int ID3DXPatchMesh::GetNumVertices() ID3DXPatchMesh::GetNumVertices

Gets the vertex declaration.

Array of elements describing the vertex format of the mesh vertices. The dimension of this declarator array is . The vertex element array ends with the D3DDECL_END macro.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

The array of elements includes the D3DDECL_END macro, which ends the declaration.

bb174079 HRESULT ID3DXPatchMesh::GetDeclaration([In] D3DVERTEXELEMENT9* Declaration) ID3DXPatchMesh::GetDeclaration

Gets the number of control vertices per patch.

The number of control vertices per patch.

bb174078 unsigned int ID3DXPatchMesh::GetControlVerticesPerPatch() ID3DXPatchMesh::GetControlVerticesPerPatch

Gets the type of patch.

The patch type.

For more information about patch types, see .

bb174085 unsigned int ID3DXPatchMesh::GetOptions() ID3DXPatchMesh::GetOptions

Gets the device that created the mesh.

Pointer to the device.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

bb174080 HRESULT ID3DXPatchMesh::GetDevice([Out] IDirect3DDevice9** ppDevice) ID3DXPatchMesh::GetDevice

Gets the attributes of the patch.

Pointer to the structures containing the patch attributes. For more information about patch attributes, see .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

bb174086 HRESULT ID3DXPatchMesh::GetPatchInfo([In] D3DXPATCHINFO* PatchInfo) ID3DXPatchMesh::GetPatchInfo

Gets the mesh vertex buffer.

Pointer to the vertex buffer.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

This method assumes uniform tessellation.

bb174088 HRESULT ID3DXPatchMesh::GetVertexBuffer([Out] IDirect3DVertexBuffer9** ppVB) ID3DXPatchMesh::GetVertexBuffer

Gets the mesh index buffer.

Pointer to the index buffer.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

The index buffer contains the vertex ordering in the vertex buffer. The index buffer is used to access the vertex buffer when the mesh is rendered.

bb174082 HRESULT ID3DXPatchMesh::GetIndexBuffer([Out] IDirect3DIndexBuffer9** ppIB) ID3DXPatchMesh::GetIndexBuffer

Lock the vertex buffer.

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

VOID* reference to a memory buffer containing the returned vertex data.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

The vertex buffer is usually locked, written to, and then unlocked for reading.

Patch meshes use 16-bit index buffers.

bb174091 HRESULT ID3DXPatchMesh::LockVertexBuffer([In] unsigned int flags,[In] void** ppData) ID3DXPatchMesh::LockVertexBuffer

Unlock the vertex buffer.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

The vertex buffer is usually locked, written to, and then unlocked for reading.

bb174098 HRESULT ID3DXPatchMesh::UnlockVertexBuffer() ID3DXPatchMesh::UnlockVertexBuffer

Lock the index buffer.

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

VOID* reference to a memory buffer containing the returned index data.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

The index buffer is usually locked, written to, and then unlocked for reading. Patch mesh index buffers are 16-bit buffers.

bb174090 HRESULT ID3DXPatchMesh::LockIndexBuffer([In] unsigned int flags,[In] void** ppData) ID3DXPatchMesh::LockIndexBuffer

Unlock the index buffer.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

The index buffer is usually locked, written to, and then unlocked for reading.

bb174097 HRESULT ID3DXPatchMesh::UnlockIndexBuffer() ID3DXPatchMesh::UnlockIndexBuffer

Locks the attribute buffer.

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

Address of a reference to a buffer containing a DWORD for each face in the mesh.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

The attribute buffer is usually locked, written to, and then unlocked for reading.

bb174089 HRESULT ID3DXPatchMesh::LockAttributeBuffer([In] unsigned int flags,[In] unsigned int** ppData) ID3DXPatchMesh::LockAttributeBuffer

Unlock the attribute buffer.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

The attribute buffer is usually locked, written to, and then unlocked for reading.

bb174096 HRESULT ID3DXPatchMesh::UnlockAttributeBuffer() ID3DXPatchMesh::UnlockAttributeBuffer

Gets the size of the tessellated mesh, given a tessellation level.

Tessellation level.

Adaptive tessellation. For adaptive tessellation, set this value to TRUE and set fTessLevel to the maximum tessellation value. This will result in the maximum mesh size necessary for adaptive tessellation.

Pointer to the number of triangles generated by the tessellated mesh.

Pointer to the number of vertices generated by the tessellated mesh.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

This method assumes uniform tessellation.

bb174087 HRESULT ID3DXPatchMesh::GetTessSize([In] float fTessLevel,[In] unsigned int Adaptive,[Out] unsigned int* NumTriangles,[Out] unsigned int* NumVertices) ID3DXPatchMesh::GetTessSize

Generate a list of mesh edges and the patches that share each edge.

Specifies that vertices that differ in position by less than the tolerance should be treated as coincident.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

After an application generates adjacency information for a mesh, the mesh data can be optimized for better drawing performance. This method determines which patches are adjacent (within the provided tolerance). This information is used internally to optimize tessellation.

bb174077 HRESULT ID3DXPatchMesh::GenerateAdjacency([In] float Tolerance) ID3DXPatchMesh::GenerateAdjacency

Creates a new patch mesh with the specified vertex declaration.

Combination of one or more D3DXMESH flags that specify creation options for the mesh.

Array of elements that specify the vertex format for the vertices in the output mesh.

Address of a reference to an interface that represents the cloned mesh.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

CloneMesh converts the vertex buffer to the new vertex declaration. Entries in the vertex declaration that are new to the original mesh are set to 0. If the current mesh has adjacency, the new mesh will also have adjacency.

bb174076 HRESULT ID3DXPatchMesh::CloneMesh([In] unsigned int Options,[In] const D3DVERTEXELEMENT9* pDecl,[In] ID3DXPatchMesh** pMesh) ID3DXPatchMesh::CloneMesh

Optimizes the patch mesh for efficient tessellation.

Currently unused.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_CANNOTATTRSORT.

After an application generates adjacency information for a mesh, the mesh data can be optimized (reordered) for better drawing performance. This method determines which patches are adjacent (within the provided tolerance).

Adjacency information is also used to optimize tessellation. Generate adjacency information once and tessellate repeatedly by calling . The optimization performed is independent of the actual tessellation level used. However, if the mesh vertices are changed, you must regenerate the adjacency information.

bb174092 HRESULT ID3DXPatchMesh::Optimize([In] unsigned int flags) ID3DXPatchMesh::Optimize

Sets mesh geometry displacement parameters.

Texture containing the displacement data.

Minification level. For more information, see .

Magnification level. For more information, see .

Mip filter level. For more information, see .

Texture address wrap mode. For more information, see

Level of detail bias value.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

Displacement maps can only be 2D textures. Mipmapping is ignored for nonadaptive tessellation.

bb174093 HRESULT ID3DXPatchMesh::SetDisplaceParam([In] IDirect3DBaseTexture9* Texture,[In] D3DTEXTUREFILTERTYPE MinFilter,[In] D3DTEXTUREFILTERTYPE MagFilter,[In] D3DTEXTUREFILTERTYPE MipFilter,[In] D3DTEXTUREADDRESS Wrap,[In] unsigned int dwLODBias) ID3DXPatchMesh::SetDisplaceParam

Gets mesh geometry displacement parameters.

Texture containing the displacement data.

Minification level. For more information, see .

Magnification level. For more information, see .

Mip filter level. For more information, see .

Texture address wrap mode. For more information, see .

Level of detail bias value.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

Displacement maps can only be 2D textures. Mipmapping is ignored for nonadaptive tessellation.

bb174081 HRESULT ID3DXPatchMesh::GetDisplaceParam([Out] IDirect3DBaseTexture9** Texture,[Out] D3DTEXTUREFILTERTYPE* MinFilter,[Out] D3DTEXTUREFILTERTYPE* MagFilter,[Out] D3DTEXTUREFILTERTYPE* MipFilter,[Out] D3DTEXTUREADDRESS* Wrap,[Out] unsigned int* dwLODBias) ID3DXPatchMesh::GetDisplaceParam

Performs uniform tessellation based on the tessellation level.

Tessellation level. This is the number of vertices introduced between existing vertices. The range of this float parameter is 0 < fTessLevel <= 32.

Resulting tessellated mesh. See .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

This function will perform more efficiently if the patch mesh has been optimized using .

bb174094 HRESULT ID3DXPatchMesh::Tessellate([In] float fTessLevel,[In] ID3DXMesh* pMesh) ID3DXPatchMesh::Tessellate

Performs adaptive tessellation based on the z-based adaptive tessellation criterion.

Specifies a 4D vector that is dotted with the vertices to get the per-vertex adaptive tessellation amount. Each edge is tessellated to the average value of the tessellation levels for the two vertices it connects.

Maximum limit for adaptive tessellation. This is the number of vertices introduced between existing vertices. This integer value can range from 1 to 32, inclusive.

Minimum limit for adaptive tessellation. This is the number of vertices introduced between existing vertices. This integer value can range from 1 to 32, inclusive.

Resulting tessellated mesh. See .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

This function will perform more efficiently if the patch mesh has been optimized using .

bb174095 HRESULT ID3DXPatchMesh::TessellateAdaptive([In] const D3DXVECTOR4* pTrans,[In] unsigned int dwMaxTessLevel,[In] unsigned int dwMinTessLevel,[In] ID3DXMesh* pMesh) ID3DXPatchMesh::TessellateAdaptive

Applications use the methods of the interface to encapsulate the functionality of a pixel shader.

The LPDIRECT3DPIXELSHADER9 and PDIRECT3DPIXELSHADER9 types are defined as references to the interface.

typedef struct  *LPDIRECT3DPIXELSHADER9, *PDIRECT3DPIXELSHADER9;
bb205869 IDirect3DPixelShader9 IDirect3DPixelShader9
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. Constant MaxDynamicFlowControlDepth. D3DPS20_MAX_DYNAMICFLOWCONTROLDEPTH Constant MinDynamicFlowControlDepth. D3DPS20_MIN_DYNAMICFLOWCONTROLDEPTH Constant MaxTemps. D3DPS20_MAX_NUMTEMPS Constant MinTemps. D3DPS20_MIN_NUMTEMPS Constant MaxStaticFlowControlDepth. D3DPS20_MAX_STATICFLOWCONTROLDEPTH Constant MinStaticFlowControlDepth. D3DPS20_MIN_STATICFLOWCONTROLDEPTH Constant MaxInstructionSlots. D3DPS20_MAX_NUMINSTRUCTIONSLOTS Constant MinInstructionSlots. D3DPS20_MIN_NUMINSTRUCTIONSLOTS

Gets the device.

bb205870 GetDevice GetDevice HRESULT IDirect3DPixelShader9::GetDevice([Out] IDirect3DDevice9** ppDevice)

Gets the device.

Pointer to the interface that is returned.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205870 HRESULT IDirect3DPixelShader9::GetDevice([Out] IDirect3DDevice9** ppDevice) IDirect3DPixelShader9::GetDevice

Gets a reference to the shader data.

Pointer to a buffer that contains the shader data. The application needs to allocate enough room for this.

Size of the data, in bytes. To get the buffer size that is needed to retrieve the data, set pData = null when calling GetFunction. Then call GetFunction with the returned size, to get the buffer data.

If the method succeeds, the return value is . If the method fails, the return value can be: .

bb205871 HRESULT IDirect3DPixelShader9::GetFunction([In] void* arg0,[InOut] unsigned int* pSizeOfData) IDirect3DPixelShader9::GetFunction
Initializes a new instance of the class. The device. The function. HRESULT IDirect3DDevice9::CreatePixelShader([In] const void* pFunction,[Out, Fast] IDirect3DPixelShader9** ppShader) Gets the bytecode associated to this shader.. No documentation. bb280447 ID3DXPMesh ID3DXPMesh Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. No documentation. GetMaxFaces GetMaxFaces unsigned int ID3DXPMesh::GetMaxFaces() No documentation. GetMinFaces GetMinFaces unsigned int ID3DXPMesh::GetMinFaces() No documentation. GetMaxVertices GetMaxVertices unsigned int ID3DXPMesh::GetMaxVertices() No documentation. GetMinVertices GetMinVertices unsigned int ID3DXPMesh::GetMinVertices() No documentation. GetAdjacency GetAdjacency HRESULT ID3DXPMesh::GetAdjacency([Out] unsigned int* pAdjacency) No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT ID3DXPMesh::ClonePMeshFVF([In] unsigned int Options,[In] unsigned int FVF,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXPMesh** ppCloneMesh) ID3DXPMesh::ClonePMeshFVF No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT ID3DXPMesh::ClonePMesh([In] unsigned int Options,[In] const D3DVERTEXELEMENT9* pDeclaration,[In] IDirect3DDevice9* pD3DDevice,[In] ID3DXPMesh** ppCloneMesh) ID3DXPMesh::ClonePMesh No documentation. No documentation. No documentation. HRESULT ID3DXPMesh::SetNumFaces([In] unsigned int Faces) ID3DXPMesh::SetNumFaces No documentation. No documentation. No documentation. HRESULT ID3DXPMesh::SetNumVertices([In] unsigned int Vertices) ID3DXPMesh::SetNumVertices No documentation. No documentation. unsigned int ID3DXPMesh::GetMaxFaces() ID3DXPMesh::GetMaxFaces No documentation. No documentation. unsigned int ID3DXPMesh::GetMinFaces() ID3DXPMesh::GetMinFaces No documentation. No documentation. unsigned int ID3DXPMesh::GetMaxVertices() ID3DXPMesh::GetMaxVertices No documentation. No documentation. unsigned int ID3DXPMesh::GetMinVertices() ID3DXPMesh::GetMinVertices No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT ID3DXPMesh::Save([In] IStream* pStream,[In] const D3DXMATERIAL* pMaterials,[In] const D3DXEFFECTINSTANCE* pEffectInstances,[In] unsigned int NumMaterials) ID3DXPMesh::Save

Generates a new mesh with reordered faces and vertices to optimize drawing performance.

Specifies the type of optimization to perform. This parameter can be set to a combination of one or more flags from D3DXMESHOPT and D3DXMESH (except , , and ).

Pointer to an array of three DWORDs per face that specifies the three neighbors for each face in the optimized mesh. If the edge has no adjacent faces, the value is 0xffffffff.

An array of DWORDs, one per face, that identifies the original mesh face that corresponds to each face in the optimized mesh. If the value supplied for this argument is null, face remap data is not returned.

Address of a reference to an interface, which contains a DWORD for each vertex that specifies how the new vertices map to the old vertices. This remap is useful if you need to alter external data based on the new vertex mapping.

Address of a reference to an interface, representing the optimized mesh.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

This method generates a new mesh. Before running Optimize, an application must generate an adjacency buffer by calling . The adjacency buffer contains adjacency data, such as a list of edges and the faces that are adjacent to each other.

This method is very similar to the method, except that it can perform optimization while generating the new clone of the mesh. The output mesh inherits all of the creation parameters of the input mesh.

bb174071 HRESULT ID3DXPMesh::Optimize([In] unsigned int Flags,[In] unsigned int* pAdjacencyOut,[In] unsigned int* pFaceRemap,[In] ID3DXBuffer** ppVertexRemap,[In] ID3DXMesh** ppOptMesh) ID3DXPMesh::Optimize
No documentation. No documentation. No documentation. No documentation. HRESULT ID3DXPMesh::OptimizeBaseLOD([In] unsigned int Flags,[In] unsigned int* pFaceRemap) ID3DXPMesh::OptimizeBaseLOD No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT ID3DXPMesh::TrimByFaces([In] unsigned int NewFacesMin,[In] unsigned int NewFacesMax,[In] unsigned int* rgiFaceRemap,[In] unsigned int* rgiVertRemap) ID3DXPMesh::TrimByFaces No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT ID3DXPMesh::TrimByVertices([In] unsigned int NewVerticesMin,[In] unsigned int NewVerticesMax,[In] unsigned int* rgiFaceRemap,[In] unsigned int* rgiVertRemap) ID3DXPMesh::TrimByVertices No documentation. No documentation. No documentation. HRESULT ID3DXPMesh::GetAdjacency([Out] unsigned int* pAdjacency) ID3DXPMesh::GetAdjacency No documentation. No documentation. No documentation. HRESULT ID3DXPMesh::GenerateVertexHistory([In] unsigned int* pVertexHistory) ID3DXPMesh::GenerateVertexHistory

Applications use the methods of the interface to perform asynchronous queries on a driver.

The LPDIRECT3DQUERY9 and PDIRECT3DQUERY9 types are defined as references to the interface.

typedef struct  *LPDIRECT3DQUERY9, *PDIRECT3DQUERY9;
bb205872 IDirect3DQuery9 IDirect3DQuery9
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the device that is being queried.

bb205875 GetDevice GetDevice HRESULT IDirect3DQuery9::GetDevice([Out] IDirect3DDevice9** ppDevice)

Gets the number of bytes in the query data.

bb205874 GetDataSize GetDataSize unsigned int IDirect3DQuery9::GetDataSize()

Gets the device that is being queried.

Pointer to the device being queried. See .

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205875 HRESULT IDirect3DQuery9::GetDevice([Out] IDirect3DDevice9** ppDevice) IDirect3DQuery9::GetDevice

Gets the query type.

Returns the query type. See .

bb205876 D3DQUERYTYPE IDirect3DQuery9::GetType() IDirect3DQuery9::GetType

Gets the number of bytes in the query data.

Returns the number of bytes of query data.

bb205874 unsigned int IDirect3DQuery9::GetDataSize() IDirect3DQuery9::GetDataSize

Issue a query.

Query flags specify the type of state change for the query. See and .

If the method succeeds, the return value is . If the method fails, the return value can be .

A signaled query means the query has completed, the data is available, and will return .

bb205877 HRESULT IDirect3DQuery9::Issue([In] D3DISSUE dwIssueFlags) IDirect3DQuery9::Issue

Polls a queried resource to get the query state or a query result. For more information about queries, see Queries (Direct3D 9).

No documentation. No documentation. No documentation.

The return type identifies the query state (see Queries (Direct3D 9)). The method returns if the query data is available and S_FALSE if it is not. These are considered successful return values. If the method fails when D3DGETDATA_FLUSH is used, the return value can be .

It is possible to lose the device while polling for query status. When D3DGETDATA_FLUSH is specified, this method will return in response to a lost device. This allows an application to prevent threads from endlessly polling due to a lost device (which cannot respond to the query).

An application must never write code that only invokes GetData ( ... , 0 ), expecting that GetData will eventually return by itself over time. This is true, even if the application has used the FLUSH flag with GetData in the past. For example:

// Enables an infinite loop:	
            while( pQuery->GetData( ... , 0 ) == S_FALSE ) ; // Still enables an infinite loop:	
            pQuery->GetData( ... , D3DGETDATA_FLUSH );	
            while( pQuery->GetData( ... , 0 ) == S_FALSE ) ; // Does not enable an infinite loop because eventually the command	
            // buffer will fill up and that will cause a flush to occur.	
            while( pQuery->GetData( ..., 0 ) == S_FALSE ) { pDevice->SetTexture(...); pDevice->Draw(...);	
            }	
            
bb205873 HRESULT IDirect3DQuery9::GetData([In] void* pData,[In] unsigned int dwSize,[In] unsigned int dwGetDataFlags) IDirect3DQuery9::GetData
Initializes a new instance of the class. The device. The type. Gets the type. D3DQUERYTYPE IDirect3DQuery9::GetType()

The interface is used to generalize the process of rendering to environment maps.

An environment map is used to texture-map scene geometry to provide a more sophisticated scene without using complex geometry. This interface supports creating surfaces for the following kinds of geometry: cube, half sphere or hemispheric, parabolic, or sphere.

The interface is obtained by calling the function.

The LPD3DXRenderToEnvMap type is defined as a reference to the interface.

 typedef interface  ;	
            typedef interface  *LPD3DXRenderToEnvMap;	
            
bb174181 ID3DXRenderToEnvMap ID3DXRenderToEnvMap
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the Direct3D device associated with the environment map.

bb174189 GetDevice GetDevice HRESULT ID3DXRenderToEnvMap::GetDevice([Out] IDirect3DDevice9** ppDevice)

Retrieves the description of the render surface.

bb174188 GetDesc GetDesc HRESULT ID3DXRenderToEnvMap::GetDesc([Out] D3DXRTE_DESC* pDesc)

Retrieves the Direct3D device associated with the environment map.

Address of a reference to an interface that represents the Direct3D device object associated with the environment map.

If the method succeeds, the return value is . If the method fails, the return value can be . Calling this method increases the internal reference count on the interface. Be sure to call when you are done using this interface or you will have a memory leak.

bb174189 HRESULT ID3DXRenderToEnvMap::GetDevice([Out] IDirect3DDevice9** ppDevice) ID3DXRenderToEnvMap::GetDevice

Retrieves the description of the render surface.

Pointer to a structure that describes the rendering surface.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174188 HRESULT ID3DXRenderToEnvMap::GetDesc([Out] D3DXRTE_DESC* pDesc) ID3DXRenderToEnvMap::GetDesc

Initiate the rendering of a cubic environment map.

Pointer to an interface that represents the cube texture to which to render.

If the method succeeds, the return value is . If the method fails, the return value can be .

See to draw each of the 6 faces.

bb174182 HRESULT ID3DXRenderToEnvMap::BeginCube([In] IDirect3DCubeTexture9* pCubeTex) ID3DXRenderToEnvMap::BeginCube

Initiate the rendering of a spherical environment map.

Pointer to an interface that represents the texture to which to render.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: .E_FAIL

See to draw the face.

bb174185 HRESULT ID3DXRenderToEnvMap::BeginSphere([In] IDirect3DTexture9* pTex) ID3DXRenderToEnvMap::BeginSphere

Initiate the rendering of a hemispheric environment map.

Pointer to an interface that represents the positive texture render surface.

Pointer to an interface that represents the negative texture render surface.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: .E_FAIL

See to draw the face.

bb174183 HRESULT ID3DXRenderToEnvMap::BeginHemisphere([In] IDirect3DTexture9* pTexZPos,[In] IDirect3DTexture9* pTexZNeg) ID3DXRenderToEnvMap::BeginHemisphere

Initiate the rendering of a parabolic environment map.

Pointer to an interface that represents the positive render texture.

Pointer to an interface that represents the negative render texture.

If the function succeeds, the return value is . If the function fails, the return value can be one of the following: .E_FAIL

See to draw the faces.

bb174184 HRESULT ID3DXRenderToEnvMap::BeginParabolic([In] IDirect3DTexture9* pTexZPos,[In] IDirect3DTexture9* pTexZNeg) ID3DXRenderToEnvMap::BeginParabolic

Initiate the drawing of each face of an environment map.

The first face of the environmental cube map. See .

A valid combination of one or more flags.

If the method succeeds, the return value is . If the method fails, the return value can be .

This method must be called once for each type of environment map. The only exception is a cubic environment map which requires this method to be called six times, once for each face in . For more information, see Environment Mapping (Direct3D 9).

bb174187 HRESULT ID3DXRenderToEnvMap::Face([In] D3DCUBEMAP_FACES Face,[In] unsigned int MipFilter) ID3DXRenderToEnvMap::Face

Restore all render targets and, if needed, compose all the rendered faces into the environment map surface.

A valid combination of one or more flags.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174186 HRESULT ID3DXRenderToEnvMap::End([In] unsigned int MipFilter) ID3DXRenderToEnvMap::End

Use this method to release all references to video memory resources and delete all stateblocks. This method should be called whenever a device is lost, or before resetting a device.

If the method succeeds, the return value is . If the method fails, the return value can be .

This method should be called whenever the device is lost or before the user calls . Even if the device was not actually lost, is responsible for freeing stateblocks and other resources that may need to be released before resetting the device. As a result, the font object cannot be used again before calling and then .

bb174190 HRESULT ID3DXRenderToEnvMap::OnLostDevice() ID3DXRenderToEnvMap::OnLostDevice

Use this method to re-acquire resources and save initial state.

If the method succeeds, the return value is . If the method fails, the return value can be .

should be called each time the device is reset (using ), before any other methods are called. This is a good place to re-acquire video-memory resources and capture state blocks.

bb174191 HRESULT ID3DXRenderToEnvMap::OnResetDevice() ID3DXRenderToEnvMap::OnResetDevice

The interface is used to generalize the process of rendering to surfaces.

Surfaces can be used in a variety of ways including render targets, off-screen rendering, or rendering to textures.

A surface can be configured using a separate viewport using the method, to provide a custom render view. If the surface is not a render target, a compatible render target is used, and the result is copied to the surface at the end of the scene.

The interface is obtained by calling the function.

The LPD3DXRENDERTOSURFACE type is defined as a reference to the interface.

 typedef interface  ;	
            typedef interface  *LPD3DXRENDERTOSURFACE;	
            
bb174192 ID3DXRenderToSurface ID3DXRenderToSurface
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the Direct3D device associated with the render surface.

bb174196 GetDevice GetDevice HRESULT ID3DXRenderToSurface::GetDevice([Out] IDirect3DDevice9** ppDevice)

Retrieves the parameters of the render surface.

bb174195 GetDesc GetDesc HRESULT ID3DXRenderToSurface::GetDesc([Out] D3DXRTS_DESC* pDesc)

Retrieves the Direct3D device associated with the render surface.

Address of a reference to an interface, representing the Direct3D device object associated with the render surface.

If the method succeeds, the return value is . If the method fails, the return value can be . Calling this method will increase the internal reference count on the interface. Be sure to call when you are done using this interface or you will have a memory leak.

bb174196 HRESULT ID3DXRenderToSurface::GetDevice([Out] IDirect3DDevice9** ppDevice) ID3DXRenderToSurface::GetDevice

Retrieves the parameters of the render surface.

Pointer to a structure, describing the parameters of the render surface.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174195 HRESULT ID3DXRenderToSurface::GetDesc([Out] D3DXRTS_DESC* pDesc) ID3DXRenderToSurface::GetDesc

Begins a scene.

Pointer to an interface, representing the render surface.

Pointer to a structure, describing the viewport for the scene.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: . D3DXERR_INVALIDDATA E_OUTOFMEMORY

bb174193 HRESULT ID3DXRenderToSurface::BeginScene([In] IDirect3DSurface9* pSurface,[In] const D3DVIEWPORT9* pViewport) ID3DXRenderToSurface::BeginScene

Ends a scene.

Filter options, enumerated in .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

bb174194 HRESULT ID3DXRenderToSurface::EndScene([In] D3DX_FILTER MipFilter) ID3DXRenderToSurface::EndScene

Use this method to release all references to video memory resources and delete all stateblocks. This method should be called whenever a device is lost or before resetting a device.

If the method succeeds, the return value is . If the method fails, the return value can be .

This method should be called whenever the device is lost or before the user calls . Even if the device was not actually lost, is responsible for freeing stateblocks and other resources that may need to be released before resetting the device. As a result, the font object cannot be used again before calling and then .

bb174197 HRESULT ID3DXRenderToSurface::OnLostDevice() ID3DXRenderToSurface::OnLostDevice

Use this method to re-acquire resources and save initial state.

If the method succeeds, the return value is . If the method fails, the return value can be .

should be called each time the device is reset (using ), before any other methods are called. This is a good place to re-acquire video-memory resources and capture state blocks.

bb174198 HRESULT ID3DXRenderToSurface::OnResetDevice() ID3DXRenderToSurface::OnResetDevice
Creates a render surface.

Pointer to an interface, the device to be associated with the render surface.

Width of the render surface, in pixels.

Height of the render surface, in pixels.

Member of the enumerated type, describing the pixel format of the render surface.

If TRUE, the render surface supports a depth-stencil surface. Otherwise, this member is set to . This function will create a new depth buffer.

If DepthStencil is set to TRUE, this parameter is a member of the enumerated type, describing the depth-stencil format of the render surface.

bb172791 HRESULT D3DXCreateRenderToSurface([In] IDirect3DDevice9* pDevice,[In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] BOOL DepthStencil,[In] D3DFORMAT DepthStencilFormat,[In] ID3DXRenderToSurface** ppRenderToSurface) D3DXCreateRenderToSurface

Applications use the methods of the interface to query and prepare resources.

To create a texture resource, you can call one of the following methods.

To create a geometry-oriented resource, you can call one of the following methods.

This interface, like all COM interfaces, inherits from the interface.

The LPDIRECT3DRESOURCE9 and PDIRECT3DRESOURCE9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DRESOURCE9, *PDIRECT3DRESOURCE9;	
            
bb205878 IDirect3DResource9 IDirect3DResource9
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the device associated with a resource.

This method allows navigation to the owning device object.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb205880 GetDevice GetDevice HRESULT IDirect3DResource9::GetDevice([Out] IDirect3DDevice9** ppDevice)

Retrieves the priority for this resource.

is used for priority control of managed resources. This method returns 0 on nonmanaged resources.

Priorities are used to determine when managed resources are to be removed from memory. A resource assigned a low priority is removed before a resource with a high priority. If two resources have the same priority, the resource that was used more recently is kept in memory; the other resource is removed. Managed resources have a default priority of 0.

bb205881 GetPriority GetPriority unsigned int IDirect3DResource9::GetPriority()

Returns the type of the resource.

bb205883 GetType GetType D3DRESOURCETYPE IDirect3DResource9::GetType()

Retrieves the device associated with a resource.

Address of a reference to an interface to fill with the device reference, if the query succeeds.

If the method succeeds, the return value is . If the method fails, the return value can be .

This method allows navigation to the owning device object.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb205880 HRESULT IDirect3DResource9::GetDevice([Out] IDirect3DDevice9** ppDevice) IDirect3DResource9::GetDevice

Associates data with the resource that is intended for use by the application, not by Direct3D. Data is passed by value, and multiple sets of data can be associated with a single resource.

Reference to the globally unique identifier that identifies the private data to set.

Pointer to a buffer that contains the data to be associated with the resource.

Size of the buffer at pData, in bytes.

Value that describes the type of data being passed, or indicates to the application that the data should be invalidated when the resource changes.

ItemDescription

(none)

If no flags are specified, Direct3D allocates memory to hold the data within the buffer and copies the data into the new buffer. The buffer allocated by Direct3D is automatically freed, as appropriate.

D3DSPD_IUNKNOWN

The data at pData is a reference to an interface. SizeOfData must be set to the size of a reference to , that is, sizeof(*). Direct3D automatically callsIUnknown through pData when the private data is destroyed. Private data will be destroyed by a subsequent call to with the same , a subsequent call to , or when the object is released. For more information, see Remarks.

?

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

Direct3D does not manage the memory at pData. If this buffer was dynamically allocated, it is the calling application's responsibility to free the memory.

bb205886 HRESULT IDirect3DResource9::SetPrivateData([In] const GUID& refguid,[In] const void* pData,[In] unsigned int SizeOfData,[In] unsigned int Flags) IDirect3DResource9::SetPrivateData

Copies the private data associated with the resource to a provided buffer.

The globally unique identifier that identifies the private data to retrieve.

Pointer to a previously allocated buffer to fill with the requested private data if the call succeeds. The application calling this method is responsible for allocating and releasing this buffer. If this parameter is null, this method will return the buffer size in pSizeOfData.

Pointer to the size of the buffer at pData, in bytes. If this value is less than the actual size of the private data (such as 0), the method sets this parameter to the required buffer size and the method returns .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , .

This method is inherited by the following interfaces: , , , , , , .

bb205882 HRESULT IDirect3DResource9::GetPrivateData([In] const GUID& refguid,[In] void* pData,[InOut] unsigned int* pSizeOfData) IDirect3DResource9::GetPrivateData

Frees the specified private data associated with this resource.

Reference to the globally unique identifier that identifies the private data to free.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , .

Direct3D calls this method automatically when a resource is released.

bb205879 HRESULT IDirect3DResource9::FreePrivateData([In] const GUID& refguid) IDirect3DResource9::FreePrivateData

Assigns the priority of a resource for scheduling purposes.

Priority to assign to a resource.

Differences between Direct3D 9 and Direct3D 9 for Windows Vista

The priority can be any DWORD value; Direct3D 9 for Windows Vista also supports any of these pre-defined values D3D9_RESOURCE_PRIORITY.

?

Returns the previous priority value for the resource.

This method is used to change the priority of managed resources (resources created with the flag). This method returns 0 on non-managed resources.

Priorities are used to determine when managed resources are to be removed from memory. A resource assigned a low priority is removed before a resource with a high priority. If two resources have the same priority, the resource that was used more recently is kept in memory; the other resource is removed. Managed resources have a default priority of 0.

Windows Vista only - When this method is called using an interface, only resources created with the flag will be affected.

bb205885 unsigned int IDirect3DResource9::SetPriority([In] unsigned int PriorityNew) IDirect3DResource9::SetPriority

Retrieves the priority for this resource.

Returns a DWORD value, indicating the priority of the resource.

is used for priority control of managed resources. This method returns 0 on nonmanaged resources.

Priorities are used to determine when managed resources are to be removed from memory. A resource assigned a low priority is removed before a resource with a high priority. If two resources have the same priority, the resource that was used more recently is kept in memory; the other resource is removed. Managed resources have a default priority of 0.

bb205881 unsigned int IDirect3DResource9::GetPriority() IDirect3DResource9::GetPriority

Preloads a managed resource.

Calling this method indicates that the application will need this managed resource shortly. This method has no effect on nonmanaged resources.

detects "thrashing" conditions where more resources are being used in each frame than can fit in video memory simultaneously. Under such circumstances silently does nothing.

bb205884 void IDirect3DResource9::PreLoad() IDirect3DResource9::PreLoad

Returns the type of the resource.

Returns a member of the enumerated type, identifying the type of the resource.

bb205883 D3DRESOURCETYPE IDirect3DResource9::GetType() IDirect3DResource9::GetType
Gets or sets the debug-name for this object. The debug name. No documentation. bb280438 ID3DXSPMesh ID3DXSPMesh Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. No documentation. GetNumFaces GetNumFaces unsigned int ID3DXSPMesh::GetNumFaces() No documentation. GetNumVertices GetNumVertices unsigned int ID3DXSPMesh::GetNumVertices() No documentation. GetFVF GetFVF unsigned int ID3DXSPMesh::GetFVF() No documentation. GetOptions GetOptions unsigned int ID3DXSPMesh::GetOptions() No documentation. GetDevice GetDevice HRESULT ID3DXSPMesh::GetDevice([Out] IDirect3DDevice9** ppDevice) No documentation. GetMaxFaces GetMaxFaces unsigned int ID3DXSPMesh::GetMaxFaces() No documentation. GetMaxVertices GetMaxVertices unsigned int ID3DXSPMesh::GetMaxVertices() No documentation. GetVertexWeights GetVertexWeights HRESULT ID3DXSPMesh::GetVertexWeights([Out] float* pVertexWeights) No documentation. No documentation. unsigned int ID3DXSPMesh::GetNumFaces() ID3DXSPMesh::GetNumFaces No documentation. No documentation. unsigned int ID3DXSPMesh::GetNumVertices() ID3DXSPMesh::GetNumVertices No documentation. No documentation. unsigned int ID3DXSPMesh::GetFVF() ID3DXSPMesh::GetFVF No documentation. No documentation. No documentation. HRESULT ID3DXSPMesh::GetDeclaration([In] D3DVERTEXELEMENT9* Declaration) ID3DXSPMesh::GetDeclaration No documentation. No documentation. unsigned int ID3DXSPMesh::GetOptions() ID3DXSPMesh::GetOptions No documentation. No documentation. No documentation. HRESULT ID3DXSPMesh::GetDevice([Out] IDirect3DDevice9** ppDevice) ID3DXSPMesh::GetDevice No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT ID3DXSPMesh::CloneMeshFVF([In] unsigned int Options,[In] unsigned int FVF,[In] IDirect3DDevice9* pD3DDevice,[In] unsigned int* pAdjacencyOut,[In] unsigned int* pVertexRemapOut,[In] ID3DXMesh** ppCloneMesh) ID3DXSPMesh::CloneMeshFVF No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT ID3DXSPMesh::CloneMesh([In] unsigned int Options,[In] const D3DVERTEXELEMENT9* pDeclaration,[In] IDirect3DDevice9* pD3DDevice,[In] unsigned int* pAdjacencyOut,[In] unsigned int* pVertexRemapOut,[In] ID3DXMesh** ppCloneMesh) ID3DXSPMesh::CloneMesh No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT ID3DXSPMesh::ClonePMeshFVF([In] unsigned int Options,[In] unsigned int FVF,[In] IDirect3DDevice9* pD3DDevice,[In] unsigned int* pVertexRemapOut,[In] float* pErrorsByFace,[In] ID3DXPMesh** ppCloneMesh) ID3DXSPMesh::ClonePMeshFVF No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. No documentation. HRESULT ID3DXSPMesh::ClonePMesh([In] unsigned int Options,[In] const D3DVERTEXELEMENT9* pDeclaration,[In] IDirect3DDevice9* pD3DDevice,[In] unsigned int* pVertexRemapOut,[In] float* pErrorsbyFace,[In] ID3DXPMesh** ppCloneMesh) ID3DXSPMesh::ClonePMesh No documentation. No documentation. No documentation. HRESULT ID3DXSPMesh::ReduceFaces([In] unsigned int Faces) ID3DXSPMesh::ReduceFaces No documentation. No documentation. No documentation. HRESULT ID3DXSPMesh::ReduceVertices([In] unsigned int Vertices) ID3DXSPMesh::ReduceVertices No documentation. No documentation. unsigned int ID3DXSPMesh::GetMaxFaces() ID3DXSPMesh::GetMaxFaces No documentation. No documentation. unsigned int ID3DXSPMesh::GetMaxVertices() ID3DXSPMesh::GetMaxVertices No documentation. No documentation. No documentation. HRESULT ID3DXSPMesh::GetVertexAttributeWeights([In] D3DXATTRIBUTEWEIGHTS* pVertexAttributeWeights) ID3DXSPMesh::GetVertexAttributeWeights No documentation. No documentation. No documentation. HRESULT ID3DXSPMesh::GetVertexWeights([Out] float* pVertexWeights) ID3DXSPMesh::GetVertexWeights No documentation. bb280439 ID3DXSkinInfo ID3DXSkinInfo Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the maximum number of influences for any vertex in the mesh.

bb174218 GetMaxVertexInfluences GetMaxVertexInfluences HRESULT ID3DXSkinInfo::GetMaxVertexInfluences([Out] unsigned int* maxVertexInfluences)

Gets the number of bones.

bb174221 GetNumBones GetNumBones unsigned int ID3DXSkinInfo::GetNumBones()

Gets or sets the minimum bone influence. Influence values smaller than this are ignored.

bb174219 GetMinBoneInfluence / SetMinBoneInfluence GetMinBoneInfluence float ID3DXSkinInfo::GetMinBoneInfluence()

Gets or sets the fixed function vertex value.

This method can return 0 if the vertex format cannot be mapped directly to an FVF code. This will occur for a mesh created from a vertex declaration that doesn't have the same order and elements supported by the FVF codes.

bb174216 GetFVF / SetFVF GetFVF unsigned int ID3DXSkinInfo::GetFVF()

Sets the influence value for a bone.

Bone number.

Number of influences.

The array of vertices influenced by a bone.

The array of weights influenced by a bone.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174224 HRESULT ID3DXSkinInfo::SetBoneInfluence([In] unsigned int bone,[In] unsigned int numInfluences,[In] const unsigned int* vertices,[In] const float* weights) ID3DXSkinInfo::SetBoneInfluence

Sets an influence value of a bone on a single vertex.

Index of the bone. Must be between 0 and the number of bones.

Index of the influence array of the specified bone.

Blend factor of the specified bone influence.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174227 HRESULT ID3DXSkinInfo::SetBoneVertexInfluence([In] unsigned int boneNum,[In] unsigned int influenceNum,[In] float weight) ID3DXSkinInfo::SetBoneVertexInfluence

Gets the number of influences for a bone.

Bone number.

Returns the number of influences for a bone.

bb174220 unsigned int ID3DXSkinInfo::GetNumBoneInfluences([In] unsigned int bone) ID3DXSkinInfo::GetNumBoneInfluences

Gets the vertices and weights that a bone influences.

Bone number.

Get the array of vertices influenced by a bone.

Get the array of weights influenced by a bone.

If the method succeeds, the return value is . If the method fails, the return value can be .

Use to find out how many vertices the bone influences.

bb174211 HRESULT ID3DXSkinInfo::GetBoneInfluence([In] unsigned int bone,[Out] unsigned int* vertices,[Out] float* weights) ID3DXSkinInfo::GetBoneInfluence

Retrieves the blend factor and vertex affected by a specified bone influence.

Index of the bone. Must be between 0 and the number of bones.

Index of the influence array of the specified bone.

Pointer to the blend factor influenced by influenceNum.

Pointer to the vertex influenced by influenceNum.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174214 HRESULT ID3DXSkinInfo::GetBoneVertexInfluence([In] unsigned int boneNum,[In] unsigned int influenceNum,[Out] float* pWeight,[Out] unsigned int* pVertexNum) ID3DXSkinInfo::GetBoneVertexInfluence

Gets the maximum number of influences for any vertex in the mesh.

Pointer to the maximum vertex influence.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174218 HRESULT ID3DXSkinInfo::GetMaxVertexInfluences([Out] unsigned int* maxVertexInfluences) ID3DXSkinInfo::GetMaxVertexInfluences

Gets the number of bones.

Returns the number of bones.

bb174221 unsigned int ID3DXSkinInfo::GetNumBones() ID3DXSkinInfo::GetNumBones

Retrieves the index of the bone influence affecting a single vertex.

Index of the bone. Must be between 0 and the number of bones.

Index of the vertex for which the bone influence is to be found. Must be between 0 and the number of vertices in the mesh.

Pointer to the index of the bone influence that affects vertexNum.

If the method succeeds, the return value is . If the specified bone does not influence the given vertex, S_FALSE is returned. If the method fails, the return value can be .

bb174210 HRESULT ID3DXSkinInfo::FindBoneVertexInfluenceIndex([In] unsigned int boneNum,[In] unsigned int vertexNum,[In] unsigned int* pInfluenceIndex) ID3DXSkinInfo::FindBoneVertexInfluenceIndex

Gets the maximum face influences in a triangle mesh with the specified index buffer.

Pointer to the index buffer that contains the mesh index data.

Number of faces in the mesh.

Pointer to the maximum face influences.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174217 HRESULT ID3DXSkinInfo::GetMaxFaceInfluences([In] IDirect3DIndexBuffer9* pIB,[In] unsigned int NumFaces,[Out] unsigned int* maxFaceInfluences) ID3DXSkinInfo::GetMaxFaceInfluences

Sets the minimum bone influence. Influence values smaller than this are ignored.

Minimum influence value. Influence values smaller than this are ignored.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174230 HRESULT ID3DXSkinInfo::SetMinBoneInfluence([In] float MinInfl) ID3DXSkinInfo::SetMinBoneInfluence

Gets the minimum bone influence. Influence values smaller than this are ignored.

Returns the minimum bone influence value.

bb174219 float ID3DXSkinInfo::GetMinBoneInfluence() ID3DXSkinInfo::GetMinBoneInfluence

Sets the bone name.

Bone number

Bone name

If the method succeeds, the return value is . If the method fails, the return value can be .

Bone names are returned by .

bb174225 HRESULT ID3DXSkinInfo::SetBoneName([In] unsigned int Bone,[In] const char* pName) ID3DXSkinInfo::SetBoneName

Gets the bone name, from the bone index.

Bone number.

Returns the bone name. Do not free this string.

bb174212 const char* ID3DXSkinInfo::GetBoneName([In] unsigned int Bone) ID3DXSkinInfo::GetBoneName

Sets the bone offset matrix.

Bone number.

Pointer to the bone offset matrix.

If the method succeeds, the return value is . If the method fails, the return value can be .

Bone names are returned by .

bb174226 HRESULT ID3DXSkinInfo::SetBoneOffsetMatrix([In] unsigned int Bone,[In] const D3DXMATRIX* pBoneTransform) ID3DXSkinInfo::SetBoneOffsetMatrix

Gets the bone offset matrix.

Bone number.

Returns a reference to the bone offset matrix. Do not free this reference.

bb174213 D3DXMATRIX* ID3DXSkinInfo::GetBoneOffsetMatrix([In] unsigned int Bone) ID3DXSkinInfo::GetBoneOffsetMatrix

Clones a skin info object.

Address of a reference to an object, which will contain the cloned object if the method is successful.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174207 HRESULT ID3DXSkinInfo::Clone([In] ID3DXSkinInfo** ppSkinInfo) ID3DXSkinInfo::Clone

Updates bone influence information to match vertices after they are reordered. This method should be called if the target vertex buffer has been reordered externally.

Number of vertices to remap.

Array of DWORDS whose length is specified by NumVertices.

If the method succeeds, the return value is . If the method fails, the return value can be .

Each element in pVertexRemap specifies the previous vertex index for that position. For example, if a vertex was in position 3 but has been remapped to position 5, then the fifth element of pVertexRemap should contain 3. The vertex remap array returned by can be used.

bb174223 HRESULT ID3DXSkinInfo::Remap([In] unsigned int NumVertices,[In] unsigned int* pVertexRemap) ID3DXSkinInfo::Remap

Sets the flexible vertex format (FVF) type.

Flexible vertex format. See .

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174229 HRESULT ID3DXSkinInfo::SetFVF([In] unsigned int FVF) ID3DXSkinInfo::SetFVF

Sets the vertex declaration.

Pointer to an array of elements.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174228 HRESULT ID3DXSkinInfo::SetDeclaration([In] const D3DVERTEXELEMENT9* pDeclaration) ID3DXSkinInfo::SetDeclaration

Gets the fixed function vertex value.

Returns the flexible vertex format (FVF) codes.

This method can return 0 if the vertex format cannot be mapped directly to an FVF code. This will occur for a mesh created from a vertex declaration that doesn't have the same order and elements supported by the FVF codes.

bb174216 unsigned int ID3DXSkinInfo::GetFVF() ID3DXSkinInfo::GetFVF

Gets the vertex declaration.

Array of elements describing the vertex format of the mesh vertices. The upper limit of this declarator array is . The vertex element array ends with the D3DDECL_END macro.

If the method succeeds, the return value is . If the method fails, the return value can be .

The array of elements includes the D3DDECL_END macro, which ends the declaration.

bb174215 HRESULT ID3DXSkinInfo::GetDeclaration([In] D3DVERTEXELEMENT9* Declaration) ID3DXSkinInfo::GetDeclaration

Applies software skinning to the target vertices based on the current matrices.

Bone transform matrix.

Inverse transpose of the bone transform matrix.

Pointer to the buffer containing the source vertices.

Pointer to the buffer containing the destination vertices.

If the method succeeds, the return value is . If the method fails, the return value can be .

When used to skin vertices with two position elements, this method skins the second position element with the inverse of the bone instead of the bone itself.

bb174231 HRESULT ID3DXSkinInfo::UpdateSkinnedMesh([In] const D3DXMATRIX* pBoneTransforms,[In] const D3DXMATRIX* pBoneInvTransposeTransforms,[In] const void* pVerticesSrc,[In] void* pVerticesDst) ID3DXSkinInfo::UpdateSkinnedMesh

Takes a mesh and returns a new mesh with per-vertex blend weights and a bone combination table. The table describes which bones affect which subsets of the mesh.

Input mesh. See .

Currently unused.

Input mesh adjacency information.

Output mesh adjacency information.

An array of DWORDs, one per face, that identifies the original mesh face that corresponds to each face in the blended mesh. If the value supplied for this argument is null, face remap data is not returned.

Address of a reference to an interface, which contains a DWORD for each vertex that specifies how the new vertices map to the old vertices. This remap is useful if you need to alter external data based on the new vertex mapping. This parameter is optional; null may be used.

Pointer to a DWORD that will contain the maximum number of bone influences required per vertex for this skinning method.

Pointer to the number of bones in the bone combination table.

Pointer to the bone combination table. The data is organized in a structure.

Pointer to the new mesh.

If the method succeeds, the return value is . If the method fails, the return value can be .

Each element in the remap array specifies the previous index for that position. For example, if a vertex was in position 3 but has been remapped to position 5, then the fifth element of pVertexRemap will contain 3.

This method does not run on hardware that does not support fixed-function vertex blending.

bb174208 HRESULT ID3DXSkinInfo::ConvertToBlendedMesh([In] ID3DXMesh* pMesh,[In] unsigned int Options,[In] const unsigned int* pAdjacencyIn,[In] unsigned int* pAdjacencyOut,[In] unsigned int* pFaceRemap,[In] ID3DXBuffer** ppVertexRemap,[In] unsigned int* pMaxFaceInfl,[In] unsigned int* pNumBoneCombinations,[In] ID3DXBuffer** ppBoneCombinationTable,[In] ID3DXMesh** ppMesh) ID3DXSkinInfo::ConvertToBlendedMesh

Takes a mesh and returns a new mesh with per-vertex blend weights, indices, and a bone combination table. The table describes which bone palettes affect which subsets of the mesh.

The input mesh. See .

Currently unused.

Number of bone matrices available for matrix palette skinning.

Input mesh adjacency information.

Output mesh adjacency information.

An array of DWORDs, one per face, that identifies the original mesh face that corresponds to each face in the blended mesh. If the value supplied for this argument is null, face remap data is not returned.

Address of a reference to an interface, which contains a DWORD for each vertex that specifies how the new vertices map to the old vertices. This remap is useful if you need to alter external data based on the new vertex mapping. This parameter is optional; null may be used.

Pointer to a DWORD that will contain the maximum number of bone influences required per vertex for this skinning method.

Pointer to the number of bones in the bone combination table.

Pointer to the bone combination table. The data is organized in a structure.

Pointer to the new mesh.

If the method succeeds, the return value is . If the method fails, the return value can be .

Each element in the remap arrays specifies the previous index for that position. For example, if a vertex was in position 3 but has been remapped to position 5, then the fifth element of pVertexRemap will contain 3.

This method does not run on hardware that does not support fixed-function vertex blending.

bb174209 HRESULT ID3DXSkinInfo::ConvertToIndexedBlendedMesh([In] ID3DXMesh* pMesh,[In] unsigned int Options,[In] unsigned int paletteSize,[In] const unsigned int* pAdjacencyIn,[In] unsigned int* pAdjacencyOut,[In] unsigned int* pFaceRemap,[In] ID3DXBuffer** ppVertexRemap,[In] unsigned int* pMaxVertexInfl,[In] unsigned int* pNumBoneCombinations,[In] ID3DXBuffer** ppBoneCombinationTable,[In] ID3DXMesh** ppMesh) ID3DXSkinInfo::ConvertToIndexedBlendedMesh

The interface provides a set of methods that simplify the process of drawing sprites using Microsoft Direct3D.

The interface is obtained by calling the function.

The application typically first calls , which allows control over the device render state, alpha blending, and sprite transformation and sorting. Then for each sprite to be displayed, call . can be called repeatedly to store any number of sprites. To display the batched sprites to the device, call or .

The LPD3DXSPRITE type is defined as a reference to the interface.

 typedef interface  ;	
            typedef interface  *LPD3DXSPRITE;	
            
bb174249 ID3DXSprite ID3DXSprite
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the device associated with the sprite object.

Calling this method will increase the internal reference count on the interface.

bb174254 GetDevice GetDevice HRESULT ID3DXSprite::GetDevice([Out] IDirect3DDevice9** ppDevice)

Gets or sets the sprite transform.

bb174255 GetTransform / SetTransform GetTransform HRESULT ID3DXSprite::GetTransform([Out] D3DXMATRIX* pTransform)

Retrieves the device associated with the sprite object.

Address of a reference to an interface, representing the Direct3D device object associated with the sprite object.

If the method succeeds, the return value is . If the method fails, the following value will be returned.

Calling this method will increase the internal reference count on the interface.

bb174254 HRESULT ID3DXSprite::GetDevice([Out] IDirect3DDevice9** ppDevice) ID3DXSprite::GetDevice

Gets the sprite transform.

Pointer to a that contains a transform of the sprite from the original world space.

If the method succeeds, the return value is . If the method fails, the following value will be returned.

bb174255 HRESULT ID3DXSprite::GetTransform([Out] D3DXMATRIX* pTransform) ID3DXSprite::GetTransform

Sets the sprite transform.

Pointer to a that contains a transform of the sprite from the original world space. Use this transform to scale, rotate, or transform the sprite.

If the method succeeds, the return value is . If the method fails, the following value will be returned.

bb174258 HRESULT ID3DXSprite::SetTransform([In] const D3DXMATRIX* pTransform) ID3DXSprite::SetTransform

Sets the right-handed world-view transform for a sprite. A call to this method is required before billboarding or sorting sprites.

Pointer to a that contains a world transform. If null, the identity matrix is used for the world transform.

Pointer to a that contains a view transform. If null, the identity matrix is used for the view transform.

If the method succeeds, the return value is . If the method fails, the following value will be returned.

A call to this method (or to ) is required if the sprite will be rendered with the D3DXSprite__BILLBOARD, D3DXSprite__SORT_DEPTH_FRONTTOBACK, or D3DXSprite__SORT_DEPTH_BACKTOFRONT flag value in .

bb174260 HRESULT ID3DXSprite::SetWorldViewRH([In] const D3DXMATRIX* pWorld,[In] const D3DXMATRIX* pView) ID3DXSprite::SetWorldViewRH

Sets the left-handed world-view transform for a sprite. A call to this method is required before billboarding or sorting sprites.

Pointer to a that contains a world transform. If null, the identity matrix is used for the world transform.

Pointer to a that contains a view transform. If null, the identity matrix is used for the view transform.

If the method succeeds, the return value is . If the method fails, the following value will be returned.

A call to this method (or to ) is required if the sprite will be rendered with the D3DXSprite__BILLBOARD, D3DXSprite__SORT_DEPTH_FRONTTOBACK, or D3DXSprite__SORT_DEPTH_BACKTOFRONT flag value in .

bb174259 HRESULT ID3DXSprite::SetWorldViewLH([In] const D3DXMATRIX* pWorld,[In] const D3DXMATRIX* pView) ID3DXSprite::SetWorldViewLH

Prepares a device for drawing sprites.

Combination of zero or more flags that describe sprite rendering options. For this method, the valid flags are:

  • D3DXSPRITE__BILLBOARD
  • D3DXSPRITE__SORT_DEPTH_BACKTOFRONT
  • D3DXSPRITE__SORT_DEPTH_FRONTTOBACK
  • D3DXSPRITE__SORT_TEXTURE

For a description of the flags and for information on how to control device state capture and device view transforms, see .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , D3DXERR_INVALIDDATA, E_OUTOFMEMORY.

This method must be called from inside a . . . sequence. cannot be used as a substitute for either or .

This method will set the following states on the device.

Render States:

Type ()Value
TRUE
0x00
AlphaCmpCaps
TRUE
| | |
0

?

Texture Stage States:

Stage IdentifierType ()Value
0
0
0
0
0
0
00
0
1
1

?

Sampler States:

Sampler Stage IndexType ()Value
0
0
0 if TextureFilterCaps includes ; otherwise
00
0MaxAnisotropy
0 if TextureFilterCaps includes ; otherwise
0 if TextureFilterCaps includes ; otherwise
00
00

?

Note??This method disables N-patches.

bb174250 HRESULT ID3DXSprite::Begin([In] D3DXSPRITE Flags) ID3DXSprite::Begin

Adds a sprite to the list of batched sprites.

Pointer to an interface that represents the sprite texture.

Pointer to a structure that indicates the portion of the source texture to use for the sprite. If this parameter is null, then the entire source image is used for the sprite.

Pointer to a vector that identifies the center of the sprite. If this argument is null, the point (0,0,0) is used, which is the upper-left corner.

Pointer to a vector that identifies the position of the sprite. If this argument is null, the point (0,0,0) is used, which is the upper-left corner.

type. The color and alpha channels are modulated by this value. A value of 0xFFFFFFFF maintains the original source color and alpha data. Use the D3DCOLOR_RGBA macro to help generate this color.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

To scale, rotate, or translate a sprite, call with a matrix that contains the scale, rotate, and translate (SRT) values, before calling . For information about setting SRT values in a matrix, see Matrix Transforms.

bb174251 HRESULT ID3DXSprite::Draw([In] IDirect3DTexture9* pTexture,[In] const void* pSrcRect,[In] const void* pCenter,[In] const void* pPosition,[In] D3DCOLOR Color) ID3DXSprite::Draw

Forces all batched sprites to be submitted to the device. Device states remain as they were after the last call to . The list of batched sprites is then cleared.

If the method succeeds, the return value is . If the method fails, the following value will be returned.

bb174253 HRESULT ID3DXSprite::Flush() ID3DXSprite::Flush

Calls and restores the device state to how it was before was called.

If the method succeeds, the return value is . If the method fails, the following value will be returned.

cannot be used as a substitute for either or .

bb174252 HRESULT ID3DXSprite::End() ID3DXSprite::End

Use this method to release all references to video memory resources and delete all stateblocks. This method should be called whenever a device is lost or before resetting a device.

If the method succeeds, the return value is . If the method fails, the return value can be .

This method should be called whenever the device is lost or before the user calls . Even if the device was not actually lost, is responsible for freeing stateblocks and other resources that may need to be released before resetting the device. As a result, the font object cannot be used again before calling and then .

bb174256 HRESULT ID3DXSprite::OnLostDevice() ID3DXSprite::OnLostDevice

Use this method to re-acquire resources and save initial state.

If the method succeeds, the return value is . If the method fails, the return value can be .

should be called each time the device is reset (using ), before any other methods are called. This is a good place to re-acquire video-memory resources and capture state blocks.

bb174257 HRESULT ID3DXSprite::OnResetDevice() ID3DXSprite::OnResetDevice
Creates a sprite object which is associated with a particular device. Sprite objects are used to draw 2D images to the screen. A reference to the device (see ) that will draw the sprite. This interface can be used to draw two dimensional images in screen space of the associated device. HRESULT D3DXCreateSprite([In] IDirect3DDevice9* pDevice,[Out, Fast] ID3DXSprite** ppSprite)

Adds a sprite to the list of batched sprites.

Pointer to an interface that represents the sprite texture.

type. The color and alpha channels are modulated by this value. A value of 0xFFFFFFFF maintains the original source color and alpha data. Use the D3DCOLOR_RGBA macro to help generate this color.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

To scale, rotate, or translate a sprite, call with a matrix that contains the scale, rotate, and translate (SRT) values, before calling . For information about setting SRT values in a matrix, see Matrix Transforms.

bb174251 HRESULT ID3DXSprite::Draw([In] IDirect3DTexture9* pTexture,[In] const RECT* pSrcRect,[In] const D3DXVECTOR3* pCenter,[In] const D3DXVECTOR3* pPosition,[In] D3DCOLOR Color) ID3DXSprite::Draw

Adds a sprite to the list of batched sprites.

Pointer to an interface that represents the sprite texture.

Pointer to a structure that indicates the portion of the source texture to use for the sprite. If this parameter is null, then the entire source image is used for the sprite.

Pointer to a vector that identifies the center of the sprite. If this argument is null, the point (0,0,0) is used, which is the upper-left corner.

Pointer to a vector that identifies the position of the sprite. If this argument is null, the point (0,0,0) is used, which is the upper-left corner.

type. The color and alpha channels are modulated by this value. A value of 0xFFFFFFFF maintains the original source color and alpha data. Use the D3DCOLOR_RGBA macro to help generate this color.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

To scale, rotate, or translate a sprite, call with a matrix that contains the scale, rotate, and translate (SRT) values, before calling . For information about setting SRT values in a matrix, see Matrix Transforms.

bb174251 HRESULT ID3DXSprite::Draw([In] IDirect3DTexture9* pTexture,[In] const RECT* pSrcRect,[In] const D3DXVECTOR3* pCenter,[In] const D3DXVECTOR3* pPosition,[In] D3DCOLOR Color) ID3DXSprite::Draw

Applications use the methods of the interface to encapsulate render states.

This interface can be used to save and restore pipeline state. It can also be used to capture the current state.

The LPDIRECT3DSTATEBLOCK9 and PDIRECT3DSTATEBLOCK9 types are defined as references to the interface.

typedef struct  *LPDIRECT3DSTATEBLOCK9, *PDIRECT3DSTATEBLOCK9;
bb205887 IDirect3DStateBlock9 IDirect3DStateBlock9
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the device.

bb205891 GetDevice GetDevice HRESULT IDirect3DStateBlock9::GetDevice([Out] IDirect3DDevice9** ppDevice)

Gets the device.

Pointer to the interface that is returned.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205891 HRESULT IDirect3DStateBlock9::GetDevice([Out] IDirect3DDevice9** ppDevice) IDirect3DStateBlock9::GetDevice

Capture the current value of states that are included in a stateblock.

If the method succeeds, the return value is . If the method fails because capture cannot be done while in record mode, the return value is .

The Capture method captures current values for states within an existing state block. It does not capture the entire state of the device. For example:

 * pStateBlock = null; pd3dDevice->BeginStateBlock();	
            // Add the ZENABLE state to the stateblock 	
            pd3dDevice->SetRenderState ( ,  );	
            pd3dDevice->EndStateBlock ( &pStateBlock ); // Change the current value that is stored in the state block	
            pd3dDevice->SetRenderState ( ,  );	
            pStateBlock->Capture();			 pStateBlock->Release();	
            

Creating an empty stateblock and calling the Capture method does nothing if no states have been set.

The Capture method will not capture information for lights that are explicitly or implicitly created after the stateblock is created.

bb205890 HRESULT IDirect3DStateBlock9::Capture() IDirect3DStateBlock9::Capture

Apply the state block to the current device state.

If the method succeeds, the return value is . If the method fails while in record mode, the return value is .

bb205889 HRESULT IDirect3DStateBlock9::Apply() IDirect3DStateBlock9::Apply
Initializes a new instance of the class. The device. The type.

Applications use the methods of the interface to query and prepare surfaces.

The LPDIRECT3DSURFACE9 and PDIRECT3DSURFACE9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DSURFACE9, *PDIRECT3DSURFACE9;	
            
bb205892 IDirect3DSurface9 IDirect3DSurface9
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves a description of the surface.

bb205895 GetDesc GetDesc HRESULT IDirect3DSurface9::GetDesc([Out] D3DSURFACE_DESC* pDesc)

Provides access to the parent cube texture or texture (mipmap) object, if this surface is a child level of a cube texture or a mipmap. This method can also provide access to the parent swap chain if the surface is a back-buffer child.

Reference identifier of the container being requested.

Address of a reference to fill with the container reference if the query succeeds. See Remarks.

If the method succeeds, the return value is . If the method fails, the return value can be .

If the surface is created using CreateRenderTarget or CreateOffscreenPlainSurface or CreateDepthStencilSurface, the surface is considered stand alone. In this case, GetContainer will return the Direct3D device used to create the surface.

If the call succeeds, the reference count of the container is increased by one.

Here's an example getting the parent texture of a mip surface.

 // Assumes pSurface is a valid  reference	
            void *pContainer = null;	
             *pTexture = null;	
             hr = pSurface->GetContainer(IID_IDirect3DTexture9, &pContainer);	
            if (SUCCEEDED(hr) && pContainer)	
            { pTexture = ( *)pContainer;	
            }	
            
bb205893 HRESULT IDirect3DSurface9::GetContainer([In] const GUID& riid,[Out] void** ppContainer) IDirect3DSurface9::GetContainer

Retrieves a description of the surface.

Pointer to a structure, describing the surface.

If the method succeeds, the return value is .

is returned if the argument is invalid.

bb205895 HRESULT IDirect3DSurface9::GetDesc([Out] D3DSURFACE_DESC* pDesc) IDirect3DSurface9::GetDesc

Locks a rectangle on a surface.

Pointer to a structure that describes the locked region.

Pointer to a rectangle to lock. Specified by a reference to a structure. Specifying null for this parameter expands the dirty region to cover the entire surface.

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

You may not specify a subrect when using . For a description of the flags, see .

If the method succeeds, the return value is .

If the method fails, the return value can be or .

If the flag is specified and the driver cannot lock the surface immediately, will return so that an application can use the CPU cycles while waiting for the driver to lock the surface.

The only lockable format for a depth-stencil surface is . See .

For performance reasons, dirty regions are recorded only for level zero of a texture. Dirty regions are automatically recorded when is called without or . See for more information.

A multisample back buffer cannot be locked.

This method cannot retrieve data from a surface that is is contained by a texture resource created with because such a texture must be assigned to memory and is therefore not lockable. In this case, use instead to copy texture data from device memory to system memory.

bb205896 HRESULT IDirect3DSurface9::LockRect([Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) IDirect3DSurface9::LockRect

Unlocks a rectangle on a surface.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205898 HRESULT IDirect3DSurface9::UnlockRect() IDirect3DSurface9::UnlockRect

Retrieves a device context.

Pointer to the device context for the surface.

The following restrictions apply.

  • is valid on the following formats only: , , , and . Formats that contain Alpha are not supported because the GDI implementations don't have a well-defined behavior on the alpha channel. For more information about formats, see .
  • Only one device context per surface can be returned at a time.
  • will fail if the surface is already locked. If the surface is a member of a mipmap or cubemap, fails if any other mipmap or cubemap member is locked.
  • fails on render targets unless they were created lockable (or, in the case of back buffers, with the flag).
  • For surfaces not created with , will fail on default pool () surfaces unless they are dynamic () or are lockable render targets.
  • will fail on surfaces.

When a device context is outstanding on a surface, the application may not call these methods:

*

?

* (on a swap chain that contains the surface)

causes an implicit lock; do not retain the device context for later use. Call to release it.

It is valid to call / on levels of a mipmap or cubemap, however, these calls will be slow to all miplevels except the topmost level, and GDI operations to these miplevels will not be accelerated.

The hdc provides access to Win32 and GDI functionality.

bb205894 HRESULT IDirect3DSurface9::GetDC([Out] HDC* phdc) IDirect3DSurface9::GetDC

Release a device context handle.

Handle to a device context.

If the method succeeds, the return value is . is returned if the argument is invalid.

An hdc is a Windows resource. It must be released after use so Windows can return it to the pool of available resources.

This method will release only the device context returned by . Otherwise, this method will fail.

bb205897 HRESULT IDirect3DSurface9::ReleaseDC([In] HDC hdc) IDirect3DSurface9::ReleaseDC
Creates a depth-stencil surface. The device. The width. The height. The format. Type of the multisample. The multisample quality. if set to true [discard]. A reference to a , representing the created depth-stencil surface resource. HRESULT IDirect3DDevice9::CreateDepthStencilSurface([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Discard,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) Creates a depth-stencil surface. The device. The width. The height. The format. Type of the multisample. The multisample quality. if set to true [discard]. The shared handle. A reference to a , representing the created depth-stencil surface resource. HRESULT IDirect3DDevice9::CreateDepthStencilSurface([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Discard,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) Creates a depth-stencil surface. The device. The width. The height. The format. Type of the multisample. The multisample quality. if set to true [discard]. The usage. A reference to a , representing the created depth-stencil surface resource. HRESULT IDirect3DDevice9Ex::CreateDepthStencilSurfaceEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Discard,[Out, Fast] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) Creates a depth-stencil surface. The device. The width. The height. The format. Type of the multisample. The multisample quality. if set to true [discard]. The usage. The shared handle. A reference to a , representing the created depth-stencil surface resource. HRESULT IDirect3DDevice9Ex::CreateDepthStencilSurfaceEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Discard,[Out, Fast] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) Create an off-screen surface. The device. The width. The height. The format. The pool. A created. HRESULT IDirect3DDevice9::CreateOffscreenPlainSurface([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) Create an off-screen surface. The device. The width. The height. The format. The pool. The shared handle. A created. HRESULT IDirect3DDevice9::CreateOffscreenPlainSurface([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) Create an off-screen surface. The device. The width. The height. The format. The pool. The usage. A created. HRESULT IDirect3DDevice9Ex::CreateOffscreenPlainSurfaceEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) Create an off-screen surface. The device. The width. The height. The format. The pool. The usage. The shared handle. A created. HRESULT IDirect3DDevice9Ex::CreateOffscreenPlainSurfaceEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) Creates a render-target surface. The device. The width. The height. The format. Type of the multisample. The multisample quality. if set to true [lockable]. A render-target . HRESULT IDirect3DDevice9::CreateRenderTarget([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Lockable,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) Creates a render-target surface. The device. The width. The height. The format. Type of the multisample. The multisample quality. if set to true [lockable]. The shared handle. A render-target . HRESULT IDirect3DDevice9::CreateRenderTarget([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Lockable,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle) Creates a render-target surface. The device. The width. The height. The format. Type of the multisample. The multisample quality. if set to true [lockable]. The usage. A render-target . HRESULT IDirect3DDevice9Ex::CreateRenderTargetEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Lockable,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) Creates a render-target surface. The device. The width. The height. The format. Type of the multisample. The multisample quality. if set to true [lockable]. The usage. The shared handle. A render-target . HRESULT IDirect3DDevice9Ex::CreateRenderTargetEx([In] unsigned int Width,[In] unsigned int Height,[In] D3DFORMAT Format,[In] D3DMULTISAMPLE_TYPE MultiSample,[In] unsigned int MultisampleQuality,[In] BOOL Lockable,[Out] IDirect3DSurface9** ppSurface,[In] void** pSharedHandle,[In] unsigned int Usage) Loads a surface from a file. The surface. Name of the file. The filter. The color key. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromFileW([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const wchar_t* pSrcFile,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a surface from a file. The surface. Name of the file. The filter. The color key. The source rectangle. The destination rectangle. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromFileW([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const wchar_t* pSrcFile,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a surface from a file. The surface. Name of the file. The filter. The color key. The source rectangle. The destination rectangle. The image information. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromFileW([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const wchar_t* pSrcFile,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a surface from a file. The surface. Name of the file. The filter. The color key. The source rectangle. The destination rectangle. The palette. The image information. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromFileW([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const wchar_t* pSrcFile,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a surface from a file in memory. The surface. The memory. The filter. The color key. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a surface from a file in memory. The surface. The memory. The filter. The color key. The source rectangle. The destination rectangle. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a surface from a file in memory. The surface. The memory. The filter. The color key. The source rectangle. The destination rectangle. The image information. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a surface from a file in memory. The surface. The memory. The filter. The color key. The source rectangle. The destination rectangle. The palette. The image information. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a surface from a file in memory. The surface. The stream. The filter. The color key. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a surface from a file in memory. The surface. The stream. The filter. The color key. The source rectangle. The destination rectangle. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a surface from a file in memory. The surface. The stream. The filter. The color key. The source rectangle. The destination rectangle. The image information. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a surface from a file in memory. The surface. The stream. The filter. The color key. The source rectangle. The destination rectangle. The palette. The image information. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a surface from a file in memory. The surface. The stream. The filter. The color key. The source rectangle. The destination rectangle. The palette. The image information. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromFileInMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a surface from memory. The surface. The data. The filter. The color key. The source format. The source pitch. The source rectangle. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) Loads a surface from memory. The surface. The data. The filter. The color key. The source format. The source pitch. The source rectangle. The destination rectangle. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) Loads a surface from memory. The surface. The data. The filter. The color key. The source format. The source pitch. The source rectangle. The source palette. The destination palette. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) Loads a surface from memory. The surface. The data. The filter. The color key. The source format. The source pitch. The source rectangle. The destination rectangle. The source palette. The destination palette. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) Loads a surface from memory. The surface. The stream. The filter. The color key. The source format. The source pitch. The source rectangle. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) Loads a surface from memory. The surface. The stream. The filter. The color key. The source format. The source pitch. The source rectangle. The destination rectangle. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) Loads a surface from memory. The surface. The stream. The filter. The color key. The source format. The source pitch. The source rectangle. The source palette. The destination palette. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) Loads a surface from memory. The surface. The stream. The filter. The color key. The source format. The source pitch. The source rectangle. The destination rectangle. The source palette. The destination palette. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromMemory([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcPitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) Loads a surface from a source surface. The destination surface. The source surface. The filter. The color key. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromSurface([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) Loads a surface from a source surface. The destination surface. The source surface. The filter. The color key. The source rectangle. The destination rectangle. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromSurface([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) Loads a surface from a source surface. The destination surface. The source surface. The filter. The color key. The source rectangle. The destination rectangle. The destination palette. The source palette. A object describing the result of the operation. HRESULT D3DXLoadSurfaceFromSurface([In] IDirect3DSurface9* pDestSurface,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestRect,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect,[In] D3DX_FILTER Filter,[In] int ColorKey) Gets the parent cube texture or texture (mipmap) object, if this surface is a child level of a cube texture or a mipmap. This method can also provide access to the parent swap chain if the surface is a back-buffer child. The GUID. The parent container texture. Locks a rectangle on a surface. The type of lock to perform. A pointer to the locked region HRESULT IDirect3DSurface9::LockRect([Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) Locks a rectangle on a surface. The rectangle to lock. The type of lock to perform. A pointer to the locked region HRESULT IDirect3DSurface9::LockRect([Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) Locks a rectangle on a surface. The type of lock to perform. The stream pointing to the locked region. A pointer to the locked region HRESULT IDirect3DSurface9::LockRect([Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) Locks a rectangle on a surface. The rectangle to lock. The type of lock to perform. The stream pointing to the locked region. A pointer to the locked region HRESULT IDirect3DSurface9::LockRect([Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) Saves a surface to a file. The surface. Name of the file. The format. A object describing the result of the operation. HRESULT D3DXSaveSurfaceToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect) Saves a surface to a file. The surface. Name of the file. The format. The rectangle. A object describing the result of the operation. HRESULT D3DXSaveSurfaceToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect) Saves a surface to a file. The surface. Name of the file. The format. The rectangle. The palette. A object describing the result of the operation. HRESULT D3DXSaveSurfaceToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect) Saves a surface to a stream. The surface. The format. A object describing the result of the operation. HRESULT D3DXSaveSurfaceToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect) Saves a surface to a stream. The surface. The format. The rectangle. A object describing the result of the operation. HRESULT D3DXSaveSurfaceToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect) Saves a surface to a stream. The surface. The format. The rectangle. The palette. A object describing the result of the operation. HRESULT D3DXSaveSurfaceToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DSurface9* pSrcSurface,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcRect)

Presents the contents of the next buffer in the sequence of back buffers owned by the swap chain.

The Present method is a shortcut to Present. Present has been updated to take a flag allowing the application to request that the method return immediately when the driver reports that it cannot schedule a presentation.

If necessary, a stretch operation is applied to transfer the pixels within the source rectangle to the destination rectangle in the client area of the target window.

Present will fail if called between BeginScene and EndScene pairs unless the render target is not the current render target (such as the back buffer you get from creating an additional swap chain). This is a new behavior for Direct3D 9.

bb205908 IDirect3DSwapChain9 IDirect3DSwapChain9
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Returns information describing the raster of the monitor on which the swap chain is presented.

bb205907 GetRasterStatus GetRasterStatus HRESULT IDirect3DSwapChain9::GetRasterStatus([Out] D3DRASTER_STATUS* pRasterStatus)

Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.

bb205904 GetDisplayMode GetDisplayMode HRESULT IDirect3DSwapChain9::GetDisplayMode([Out] D3DDISPLAYMODE* pMode)

Retrieves the device associated with the swap chain.

This method allows navigation to the owning device object.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb205903 GetDevice GetDevice HRESULT IDirect3DSwapChain9::GetDevice([Out] IDirect3DDevice9** ppDevice)

Retrieves the presentation parameters associated with a swap chain.

This method can be used to see the presentation parameters of the parent swap chain of a surface (a back buffer, for instance). The parent swap chain can be retrieved with .

bb205906 GetPresentParameters GetPresentParameters HRESULT IDirect3DSwapChain9::GetPresentParameters([Out] D3DPRESENT_PARAMETERS* pPresentationParameters)

Presents the contents of the next buffer in the sequence of back buffers owned by the swap chain.

Pointer to the source rectangle (see ). Use null to present the entire surface. This value must be null unless the swap chain was created with . If the rectangle exceeds the source surface, the rectangle is clipped to the source surface.

Pointer to the destination rectangle in client coordinates (see ). This value must be null unless the swap chain was created with . Use null to fill the entire client area. If the rectangle exceeds the destination client area, the rectangle is clipped to the destination client area.

Destination window whose client area is taken as the target for this presentation. If this value is null, the runtime uses the hDeviceWindow member of for the presentation.

This value must be null unless the swap chain was created with . See Flipping Surfaces (Direct3D 9). If this value is non-null, the contained region is expressed in back buffer coordinates. The rectangles within the region are the minimal set of pixels that need to be updated. This method takes these rectangles into account when optimizing the presentation by copying only the pixels within the region, or some suitably expanded set of rectangles. This is an aid to optimization only, and the application should not rely on the region being copied exactly. The implementation may choose to copy the whole source rectangle.

Allows the application to request that the method return immediately when the driver reports that it cannot schedule a presentation. Valid values are 0, or any combination of or .

  • If dwFlags = 0, this method behaves as it did prior to Direct3D 9. Present will spin until the hardware is free, without returning an error.
  • If dwFlags = , and the hardware is busy processing or waiting for a vertical sync interval, the method will return .
  • If dwFlags = , gamma correction is performed from linear space to sRGB for windowed swap chains. This flag will take effect only when the driver exposes (see Gamma (Direct3D 9)). Appliations should specify this flag if the backbuffer format is 16-bit floating point in order to match windowed mode present to fullscreen gamma behavior.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , , , E_OUTOFMEMORY.

The Present method is a shortcut to Present. Present has been updated to take a flag allowing the application to request that the method return immediately when the driver reports that it cannot schedule a presentation.

If necessary, a stretch operation is applied to transfer the pixels within the source rectangle to the destination rectangle in the client area of the target window.

Present will fail if called between BeginScene and EndScene pairs unless the render target is not the current render target (such as the back buffer you get from creating an additional swap chain). This is a new behavior for Direct3D 9.

bb205908 HRESULT IDirect3DSwapChain9::Present([In, Optional] const void* pSourceRect,[InOut, Optional] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) IDirect3DSwapChain9::Present

Generates a copy of the swapchain's front buffer and places that copy in a system memory buffer provided by the application.

Pointer to an interface that will receive a copy of the swapchain's front buffer. The data is returned in successive rows with no intervening space, starting from the vertically highest row to the lowest. For windowed mode, the size of the destination surface should be the size of the desktop. For full screen mode, the size of the destination surface should be the screen size.

If the method succeeds, the return value is . If BackBuffer exceeds or equals the total number of back buffers, the function fails and returns .

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb205905 HRESULT IDirect3DSwapChain9::GetFrontBufferData([In] IDirect3DSurface9* pDestSurface) IDirect3DSwapChain9::GetFrontBufferData

Retrieves a back buffer from the swap chain of the device.

Index of the back buffer object to return. Back buffers are numbered from 0 to the total number of back buffers - 1. A value of 0 returns the first back buffer, not the front buffer. The front buffer is not accessible through this method. Use to retrieve a copy of the front buffer.

Stereo view is not supported in Direct3D 9, so the only valid value for this parameter is .

Address of a reference to an interface, representing the returned back buffer surface.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak. You must release any surfaces obtained through this method before releasing the swap chain it belongs to.

bb205902 HRESULT IDirect3DSwapChain9::GetBackBuffer([In] unsigned int iBackBuffer,[In] D3DBACKBUFFER_TYPE Type,[Out] IDirect3DSurface9** ppBackBuffer) IDirect3DSwapChain9::GetBackBuffer

Returns information describing the raster of the monitor on which the swap chain is presented.

Pointer to a structure filled with information about the position or other status of the raster on the monitor driven by this adapter.

If the method succeeds, the return value is . is returned if pRasterStatus is invalid or if the device does not support reading the current scan line. To determine if the device supports reading the scan line, check for the flag in the Caps member of .

bb205907 HRESULT IDirect3DSwapChain9::GetRasterStatus([Out] D3DRASTER_STATUS* pRasterStatus) IDirect3DSwapChain9::GetRasterStatus

Retrieves the display mode's spatial resolution, color resolution, and refresh frequency.

Pointer to a structure containing data about the display mode of the adapter. As opposed to the display mode of the device, which may not be active if the device does not own full-screen mode.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205904 HRESULT IDirect3DSwapChain9::GetDisplayMode([Out] D3DDISPLAYMODE* pMode) IDirect3DSwapChain9::GetDisplayMode

Retrieves the device associated with the swap chain.

Address of a reference to an interface to fill with the device reference, if the query succeeds.

If the method succeeds, the return value is . If the method fails, the return value can be .

This method allows navigation to the owning device object.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb205903 HRESULT IDirect3DSwapChain9::GetDevice([Out] IDirect3DDevice9** ppDevice) IDirect3DSwapChain9::GetDevice

Retrieves the presentation parameters associated with a swap chain.

Pointer to the presentation parameters. See .

If the method succeeds, the return value is . If the method fails, the return value can be .

This method can be used to see the presentation parameters of the parent swap chain of a surface (a back buffer, for instance). The parent swap chain can be retrieved with .

bb205906 HRESULT IDirect3DSwapChain9::GetPresentParameters([Out] D3DPRESENT_PARAMETERS* pPresentationParameters) IDirect3DSwapChain9::GetPresentParameters
Initializes a new instance of the class. The device. The present parameters. HRESULT IDirect3DDevice9::CreateAdditionalSwapChain([In] D3DPRESENT_PARAMETERS* pPresentationParameters,[In] IDirect3DSwapChain9** pSwapChain) Retrieves a back buffer from the swap chain of the device. The i back buffer. The back buffer from the swap chain of the device. HRESULT IDirect3DSwapChain9::GetBackBuffer([In] unsigned int iBackBuffer,[In] D3DBACKBUFFER_TYPE Type,[Out] IDirect3DSurface9** ppBackBuffer) Presents the contents of the next buffer in the sequence of back buffers to the screen. The present flags. HRESULT IDirect3DSwapChain9::Present([In, Optional] const void* pSourceRect,[InOut, Optional] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) Presents the contents of the next buffer in the sequence of back buffers to the screen. The present flags. The area of the back buffer that should be presented. The area of the front buffer that should receive the result of the presentation. HRESULT IDirect3DSwapChain9::Present([In, Optional] const void* pSourceRect,[InOut, Optional] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) Presents the contents of the next buffer in the sequence of back buffers to the screen. The present flags. The area of the back buffer that should be presented. The area of the front buffer that should receive the result of the presentation. The destination window whose client area is taken as the target for this presentation. HRESULT IDirect3DSwapChain9::Present([In, Optional] const void* pSourceRect,[InOut, Optional] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags) Presents the contents of the next buffer in the sequence of back buffers to the screen. The flags. The area of the back buffer that should be presented. The area of the front buffer that should receive the result of the presentation. The destination window whose client area is taken as the target for this presentation. Specifies a region on the back buffer that contains the minimal amount of pixels that need to be updated. HRESULT IDirect3DSwapChain9::Present([In, Optional] const void* pSourceRect,[InOut, Optional] const void* pDestRect,[In] HWND hDestWindowOverride,[In] const RGNDATA* pDirtyRegion,[In] unsigned int dwFlags)

Applications use the methods of the interface to manipulate a swap chain.

There is always at least one swap chain for each device, known as the implicit swap chain. However, an additional swap chain for rendering multiple views from the same device can be created by calling the CreateAdditionalSwapChain method.

This interface, like all COM interfaces, inherits from the interface.

The LPDIRECT3DSWAPCHAIN9 and PDIRECT3DSWAPCHAIN9 types are defined as references to the interface.

objects are returned as a reference to an object when GetSwapChain is called on an instance of . The interface is obtained by calling QueryInterface on the instance of that was returned by GetSwapChain.

bb172503 IDirect3DSwapChain9Ex IDirect3DSwapChain9Ex
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Returns the number of times the swapchain has been processed.

bb205900 GetLastPresentCount GetLastPresentCount HRESULT IDirect3DSwapChain9Ex::GetLastPresentCount([Out] unsigned int* pLastPresentCount)
No documentation. GetPresentStats GetPresentStats HRESULT IDirect3DSwapChain9Ex::GetPresentStats([Out] D3DPRESENTSTATS* pPresentationStatistics)

Returns the number of times the swapchain has been processed.

Pointer to a UINT to be filled with the number of times the method has been called. The count will also be incremented by calling some other APIs such as .

the method was successful.

bb205900 HRESULT IDirect3DSwapChain9Ex::GetLastPresentCount([Out] unsigned int* pLastPresentCount) IDirect3DSwapChain9Ex::GetLastPresentCount
No documentation. No documentation. No documentation. HRESULT IDirect3DSwapChain9Ex::GetPresentStats([Out] D3DPRESENTSTATS* pPresentationStatistics) IDirect3DSwapChain9Ex::GetPresentStats

Retrieves the display mode's spatial resolution, color resolution, refresh frequency, and rotation settings.

Pointer to a structure containing data about the display mode of the adapter. As opposed to the display mode of the device, which may not be active if the device does not own full-screen mode.

Pointer to a indicating the type of screen rotation the application will do. The value returned through this reference is important when the flag is used; otherwise, it can be set to null.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb509715 HRESULT IDirect3DSwapChain9Ex::GetDisplayModeEx([Out] D3DDISPLAYMODEEX* pMode,[Out] D3DDISPLAYROTATION* pRotation) IDirect3DSwapChain9Ex::GetDisplayModeEx

Applications use the methods of the interface to manipulate a texture resource.

The interface can be obtained by calling the method or one of the xxx functions.

This interface inherits additional functionality from the interface.

This interface, like all COM interfaces, inherits from the interface.

The LPDIRECT3DTEXTURE9 and PDIRECT3DTEXTURE9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DTEXTURE9, *PDIRECT3DTEXTURE9;	
            
bb205909 IDirect3DTexture9 IDirect3DTexture9
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves a level description of a texture resource.

Identifies a level of the texture resource. This method returns a surface description for the level specified by this parameter.

Pointer to a structure, describing the returned level.

bb205911 HRESULT IDirect3DTexture9::GetLevelDesc([In] unsigned int Level,[Out] D3DSURFACE_DESC* pDesc) IDirect3DTexture9::GetLevelDesc

Retrieves the specified texture surface level.

Identifies a level of the texture resource. This method returns a surface for the level specified by this parameter. The top-level surface is denoted by 0.

Address of a reference to an interface, representing the returned surface.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb205912 HRESULT IDirect3DTexture9::GetSurfaceLevel([In] unsigned int Level,[Out] IDirect3DSurface9** ppSurfaceLevel) IDirect3DTexture9::GetSurfaceLevel

Locks a rectangle on a texture resource.

Specifies the level of the texture resource to lock.

Pointer to a structure, describing the locked region.

Pointer to a rectangle to lock. Specified by a reference to a structure. Specifying null for this parameter expands the dirty region to cover the entire texture.

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

You may not specify a subrect when using . For a description of the flags, see .

If the method succeeds, the return value is . If the method fails, the return value can be .

Textures created with are not lockable. Textures created in video memory are lockable when created with USAGE_DYNAMIC.

For performance reasons, dirty regions are recorded only for level zero of a texture. Dirty regions are automatically recorded when is called without or . See for more information.

The only lockable format for a depth-stencil texture is D3DLOCK_D16_LOCKABLE.

Video memory textures cannot be locked, but must be modified by calling or . There are exceptions for some proprietary driver pixel formats that Direct3D 9 does not recognize. These can be locked.

This method cannot retrieve data from a texture resource created with because such a texture must be assigned to memory and is therefore not lockable. In this case, use instead to copy texture data from device memory to system memory.

bb205913 HRESULT IDirect3DTexture9::LockRect([In] unsigned int Level,[Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) IDirect3DTexture9::LockRect

Unlocks a rectangle on a texture resource.

Specifies the level of the texture resource to unlock.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205914 HRESULT IDirect3DTexture9::UnlockRect([In] unsigned int Level) IDirect3DTexture9::UnlockRect

Adds a dirty region to a texture resource.

Pointer to a structure, specifying the dirty region to add. Specifying null expands the dirty region to cover the entire texture.

If the method succeeds, the return value is . If the method fails, the return value can be .

For performance reasons, dirty regions are only recorded for level zero of a texture. For sublevels, it is assumed that the corresponding (scaled) rectangle or box is also dirty. Dirty regions are automatically recorded when is called without or . The destination surface of is also marked dirty automatically.

Using and explicitly specifying dirty regions can be used to increase the efficiency of . Using this method, applications can optimize what subset of a resource is copied by specifying dirty regions on the resource. However, the dirty regions may be expanded to optimize alignment.

bb205910 HRESULT IDirect3DTexture9::AddDirtyRect([In] const void* pDirtyRect) IDirect3DTexture9::AddDirtyRect
Initializes a new instance of the class. The device. The width. The height. The level count. The usage. The format. The pool. HRESULT IDirect3DDevice9::CreateTexture([In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Levels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DTexture9** ppTexture,[In] void** pSharedHandle) Initializes a new instance of the class. The device. The width. The height. The level count. The usage. The format. The pool. The shared handle. HRESULT IDirect3DDevice9::CreateTexture([In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Levels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DTexture9** ppTexture,[In] void** pSharedHandle) Checks texture-creation parameters. Device associated with the texture. The width. The height. Requested number of mipmap levels for the texture. The requested usage for the texture. Requested format for the texture. Memory class where the resource will be placed. A value type containing the proposed values to pass to the texture creation functions. HRESULT D3DXCheckTextureRequirements([In] IDirect3DDevice9* pDevice,[InOut] unsigned int* pWidth,[InOut] unsigned int* pHeight,[InOut] unsigned int* pNumMipLevels,[In] unsigned int Usage,[InOut] D3DFORMAT* pFormat,[In] D3DPOOL Pool) Computes the normal map. The texture. The source texture. The flags. The channel. The amplitude. A object describing the result of the operation. HRESULT D3DXComputeNormalMap([In] IDirect3DTexture9* pTexture,[In] IDirect3DTexture9* pSrcTexture,[Out, Buffer] const PALETTEENTRY* pSrcPalette,[In] unsigned int Flags,[In] unsigned int Channel,[In] float Amplitude) Computes the normal map. The texture. The source texture. The palette. The flags. The channel. The amplitude. A object describing the result of the operation. HRESULT D3DXComputeNormalMap([In] IDirect3DTexture9* pTexture,[In] IDirect3DTexture9* pSrcTexture,[Out, Buffer] const PALETTEENTRY* pSrcPalette,[In] unsigned int Flags,[In] unsigned int Channel,[In] float Amplitude) Uses a user-provided function to fill each texel of each mip level of a given texture. A function that is used to fill the texture. A object describing the result of the operation. HRESULT D3DXFillTexture([In] IDirect3DTexture9* pTexture,[In] __function__stdcall* pFunction,[In] void* pData) Uses a compiled high-level shader language (HLSL) function to fill each texel of each mipmap level of a texture. A texture shader object that is used to fill the texture. A object describing the result of the operation. HRESULT D3DXFillTextureTX([In] IDirect3DTexture9* pTexture,[In] ID3DXTextureShader* pTextureShader) Locks a rectangle on a texture resource. The level. The flags. A describing the region locked. HRESULT IDirect3DTexture9::LockRect([In] unsigned int Level,[Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) Locks a rectangle on a texture resource. The level. The flags. The stream pointing to the locked region. A describing the region locked. HRESULT IDirect3DTexture9::LockRect([In] unsigned int Level,[Out] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) Locks a rectangle on a texture resource. The level. The rectangle. The flags. A describing the region locked. HRESULT IDirect3DTexture9::LockRect([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level,[In] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) Locks a rectangle on a texture resource. The level. The rectangle. The flags. The stream pointing to the locked region. A describing the region locked. HRESULT IDirect3DTexture9::LockRect([In] D3DCUBEMAP_FACES FaceType,[In] unsigned int Level,[In] D3DLOCKED_RECT* pLockedRect,[In] const void* pRect,[In] D3DLOCK Flags) Adds a dirty region to a texture resource. A object describing the result of the operation. HRESULT IDirect3DTexture9::AddDirtyRect([In] const void* pDirtyRect) Adds a dirty region to a texture resource. The dirty rect ref. A object describing the result of the operation. HRESULT IDirect3DTexture9::AddDirtyRect([In] const void* pDirtyRect) Creates a from a file The device. The filename. A HRESULT D3DXCreateTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a file The device. The filename. The usage. The pool. A HRESULT D3DXCreateTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a file The device. The filename. The width. The height. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. A HRESULT D3DXCreateTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a file The device. The filename. The width. The height. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. A HRESULT D3DXCreateTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a file The device. The filename. The width. The height. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a memory buffer. The device. The buffer. A HRESULT D3DXCreateTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DTexture9** ppTexture) Creates a from a memory buffer. The device. The buffer. The usage. The pool. A HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a memory buffer. The device. The buffer. The width. The height. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. A HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a memory buffer. The device. The buffer. The width. The height. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. A HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a memory buffer. The device. The buffer. The width. The height. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a stream. The device. The stream. A HRESULT D3DXCreateTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DTexture9** ppTexture) Creates a from a stream. The device. The stream. The usage. The pool. A HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a stream. The device. The stream. The width. The height. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. A HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a stream. The device. The stream. The size bytes. The width. The height. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. A HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a stream. The device. The stream. The size bytes. The width. The height The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. A HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a stream. The device. The stream. The size bytes. The width. The height. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a stream. The device. The buffer. The width. The height. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a stream. The device. The stream. The size bytes. The width. The height The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a stream. The device. The pointer. The size in bytes. The width. The height. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture) Creates a from a stream. The device. Name of the file. The width. The height. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DTexture9** ppTexture)

The interface.

The interface is obtained by calling the function.

The interface, like all COM interfaces, inherits the interface.

The LPD3DXTEXTURESHADER type is defined as a reference to the interface.

 typedef interface  *LPD3DXTEXTURESHADER;	
            
bb174276 ID3DXTextureShader ID3DXTextureShader
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets a reference to the function DWORD stream.

bb174283 GetFunction GetFunction HRESULT ID3DXTextureShader::GetFunction([Out] ID3DXBuffer** ppFunction)

Get a reference to the constant table.

bb174278 GetConstantBuffer GetConstantBuffer HRESULT ID3DXTextureShader::GetConstantBuffer([Out] ID3DXBuffer** ppConstantBuffer)

Gets a description of the constant table.

bb174282 GetDesc GetDesc HRESULT ID3DXTextureShader::GetDesc([Out] D3DXCONSTANTTABLE_DESC* pDesc)

Gets a reference to the function DWORD stream.

A reference to the function DWORD stream. See .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

bb174283 HRESULT ID3DXTextureShader::GetFunction([Out] ID3DXBuffer** ppFunction) ID3DXTextureShader::GetFunction

Get a reference to the constant table.

Pointer to an interface, which contains the constants.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

bb174278 HRESULT ID3DXTextureShader::GetConstantBuffer([Out] ID3DXBuffer** ppConstantBuffer) ID3DXTextureShader::GetConstantBuffer

Gets a description of the constant table.

The attributes of the constant table. See .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

bb174282 HRESULT ID3DXTextureShader::GetDesc([Out] D3DXCONSTANTTABLE_DESC* pDesc) ID3DXTextureShader::GetDesc

Gets a reference to the array of constants in the constant table.

Unique identifier to a constant. See .

Returns a reference to an array of descriptions. See .

The input supplied must be the maximum size of the array. The output is the number of elements that are filled in the array when the function returns.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , D3DXERR_INVALIDDATA.

Samplers can appear more than once in a constant table, therefore, this method can return an array of descriptions each with a different register index.

bb174280 HRESULT ID3DXTextureShader::GetConstantDesc([In] D3DXHANDLE hConstant,[Out, Buffer] D3DXCONSTANT_DESC* pConstantDesc,[InOut] unsigned int* pCount) ID3DXTextureShader::GetConstantDesc

Gets a constant by looking up its index.

A handle to the parent data structure. If the constant is a top-level parameter (there is no parent data structure), use null.

Zero-based index of the constant.

Returns a unique identifier to the constant.

To get a constant from an array of constants, use .

bb174277 D3DXHANDLE ID3DXTextureShader::GetConstant([In] D3DXHANDLE hConstant,[In] unsigned int Index) ID3DXTextureShader::GetConstant

Gets a constant by looking up its name.

A handle to the parent data structure. If the constant is a top-level parameter (there is no parent data structure), use null.

A string containing the name of the constant.

Returns a unique identifier to the constant.

bb174279 D3DXHANDLE ID3DXTextureShader::GetConstantByName([In] D3DXHANDLE hConstant,[In] const char* pName) ID3DXTextureShader::GetConstantByName

Get a constant from the constant table.

A handle to the array of constants. This value may not be null.

Zero-based index of the element in the constant table.

Returns a unique identifier to the constant.

To get a constant that is not part of an array, use or .

bb174281 D3DXHANDLE ID3DXTextureShader::GetConstantElement([In] D3DXHANDLE hConstant,[In] unsigned int Index) ID3DXTextureShader::GetConstantElement

Sets the constants to the default values declared in the shader.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174286 HRESULT ID3DXTextureShader::SetDefaults() ID3DXTextureShader::SetDefaults

Sets the constant table with the data in the buffer.

Unique identifier to a constant. See .

A reference to a buffer containing the constant data.

Size of the buffer, in bytes.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174297 HRESULT ID3DXTextureShader::SetValue([In] D3DXHANDLE hConstant,[In] const void* pData,[In] unsigned int Bytes) ID3DXTextureShader::SetValue

Sets a value.

Unique identifier to the constant. See .

value.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174284 HRESULT ID3DXTextureShader::SetBool([In] D3DXHANDLE hConstant,[In] BOOL b) ID3DXTextureShader::SetBool

Sets an array of values.

Unique identifier to the array of constants. See .

Array of values.

Number of values in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174285 HRESULT ID3DXTextureShader::SetBoolArray([In] D3DXHANDLE hConstant,[In] const BOOL* pb,[In] unsigned int Count) ID3DXTextureShader::SetBoolArray

Sets an integer value.

Unique identifier to the constant. See .

Integer value.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174289 HRESULT ID3DXTextureShader::SetInt([In] D3DXHANDLE hConstant,[In] int n) ID3DXTextureShader::SetInt

Sets an array of integers.

Unique identifier to the array of constants. See .

Array of integers.

Number of integers in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174290 HRESULT ID3DXTextureShader::SetIntArray([In] D3DXHANDLE hConstant,[In] const int* pn,[In] unsigned int Count) ID3DXTextureShader::SetIntArray

Sets a floating-point number.

Unique identifier to the constant. See .

Floating-point number.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174287 HRESULT ID3DXTextureShader::SetFloat([In] D3DXHANDLE hConstant,[In] float f) ID3DXTextureShader::SetFloat

Sets an array of floating-point numbers.

Unique identifier to the array of constants. See .

Array of floating-point numbers.

Number of floating-point values in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174288 HRESULT ID3DXTextureShader::SetFloatArray([In] D3DXHANDLE hConstant,[In] const float* pf,[In] unsigned int Count) ID3DXTextureShader::SetFloatArray

Sets a 4D vector.

Unique identifier to the vector constant. See .

Pointer to a 4D vector. See .

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174298 HRESULT ID3DXTextureShader::SetVector([In] D3DXHANDLE hConstant,[In] const D3DXVECTOR4* pVector) ID3DXTextureShader::SetVector

Sets an array of 4D vectors.

Unique identifier to the array of vector constants. See .

Array of 4D vectors. See .

Number of vectors in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb174299 HRESULT ID3DXTextureShader::SetVectorArray([In] D3DXHANDLE hConstant,[In] const D3DXVECTOR4* pVector,[In] unsigned int Count) ID3DXTextureShader::SetVectorArray

Sets a non-transposed matrix.

Unique identifier to the matrix of constants. See .

Pointer to a non-transposed matrix. See .

If the method succeeds, the return value is . If the method fails, the return value can be .

A non-transposed matrix contains row-major data; that is, each vector is contained in a row.

bb174291 HRESULT ID3DXTextureShader::SetMatrix([In] D3DXHANDLE hConstant,[In] const D3DXMATRIX* pMatrix) ID3DXTextureShader::SetMatrix

Sets an array of non-transposed matrices.

Unique identifier to the array of constant matrices. See .

Array of non-transposed matrices. See .

Number of matrices in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

A non-transposed matrix contains row-major data; that is, each vector is contained in a row.

bb174292 HRESULT ID3DXTextureShader::SetMatrixArray([In] D3DXHANDLE hConstant,[In] const D3DXMATRIX* pMatrix,[In] unsigned int Count) ID3DXTextureShader::SetMatrixArray

Sets an array of references to non-transposed matrices.

Unique identifier to an array of constant matrices. See .

Array of references to non-transposed matrices. See .

Number of matrices in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

A non-transposed matrix contains row-major data; that is, each vector is contained in a row.

bb174293 HRESULT ID3DXTextureShader::SetMatrixPointerArray([In] D3DXHANDLE hConstant,[In] const D3DXMATRIX** ppMatrix,[In] unsigned int Count) ID3DXTextureShader::SetMatrixPointerArray

Sets a transposed matrix.

Unique identifier to the matrix of constants. See .

Pointer to a transposed matrix. See .

If the method succeeds, the return value is . If the method fails, the return value can be .

A transposed matrix contains column-major data; that is, each vector is contained in a column.

bb174294 HRESULT ID3DXTextureShader::SetMatrixTranspose([In] D3DXHANDLE hConstant,[In] const D3DXMATRIX* pMatrix) ID3DXTextureShader::SetMatrixTranspose

Sets an array of transposed matrices.

Unique identifier to the array of matrix constants. See .

Array of transposed matrices. See .

Number of matrices in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

A transposed matrix contains column-major data; that is, each vector is contained in a column.

bb174295 HRESULT ID3DXTextureShader::SetMatrixTransposeArray([In] D3DXHANDLE hConstant,[In] const D3DXMATRIX* pMatrix,[In] unsigned int Count) ID3DXTextureShader::SetMatrixTransposeArray

Sets an array of references to transposed matrices.

Unique identifier to the array of matrix constants. See .

Array of references to transposed matrices. See .

Number of matrices in the array.

If the method succeeds, the return value is . If the method fails, the return value can be .

A transposed matrix contains column-major data; that is, each vector is contained in a column.

bb174296 HRESULT ID3DXTextureShader::SetMatrixTransposePointerArray([In] D3DXHANDLE hConstant,[In] const D3DXMATRIX** ppMatrix,[In] unsigned int Count) ID3DXTextureShader::SetMatrixTransposePointerArray

Applications use the methods of the interface to manipulate vertex buffer resources.

The interface is obtained by calling the method.

This interface inherits additional functionality from the interface.

This interface, like all COM interfaces, inherits from the interface.

The LPDIRECT3DVERTEXBUFFER9 and PDIRECT3DVERTEXBUFFER9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DVERTEXBUFFER9, *PDIRECT3DVERTEXBUFFER9;	
            
bb205915 IDirect3DVertexBuffer9 IDirect3DVertexBuffer9
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves a description of the vertex buffer resource.

bb205916 GetDesc GetDesc HRESULT IDirect3DVertexBuffer9::GetDesc([Out] D3DVERTEXBUFFER_DESC* pDesc)

Locks a range of vertex data and obtains a reference to the vertex buffer memory.

Offset into the vertex data to lock, in bytes. To lock the entire vertex buffer, specify 0 for both parameters, SizeToLock and OffsetToLock.

Size of the vertex data to lock, in bytes. To lock the entire vertex buffer, specify 0 for both parameters, SizeToLock and OffsetToLock.

VOID* reference to a memory buffer containing the returned vertex data.

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

If the method succeeds, the return value is . If the method fails, the return value can be .

As a general rule, do not hold a lock across more than one frame. When working with vertex buffers, you are allowed to make multiple lock calls; however, you must ensure that the number of lock calls match the number of unlock calls. DrawPrimitive calls will not succeed with any outstanding lock count on any currently set vertex buffer.

The and flags are valid only on buffers created with .

For information about using or with , see Using Dynamic Vertex and Index Buffers.

bb205917 HRESULT IDirect3DVertexBuffer9::Lock([In] unsigned int OffsetToLock,[In] unsigned int SizeToLock,[Out] void** ppbData,[In] D3DLOCK Flags) IDirect3DVertexBuffer9::Lock

Unlocks vertex data.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205918 HRESULT IDirect3DVertexBuffer9::Unlock() IDirect3DVertexBuffer9::Unlock

Retrieves a description of the vertex buffer resource.

Pointer to a structure, describing the returned vertex buffer.

If the method succeeds, the return value is . is returned if the argument is invalid.

bb205916 HRESULT IDirect3DVertexBuffer9::GetDesc([Out] D3DVERTEXBUFFER_DESC* pDesc) IDirect3DVertexBuffer9::GetDesc
Initializes a new instance of the class. The device that will be used to create the buffer. Size of the buffer, in bytes. The requested usage of the buffer. The vertex format of the vertices in the buffer. If set to .None, the buffer will be a non-FVF buffer. The memory class into which the resource will be placed. bb174364 HRESULT IDirect3DDevice9::CreateVertexBuffer([In] unsigned int Length,[In] D3DUSAGE Usage,[In] D3DFVF FVF,[In] D3DPOOL Pool,[Out, Fast] IDirect3DVertexBuffer9** ppVertexBuffer,[In] void** pSharedHandle) IDirect3DDevice9::CreateVertexBuffer Initializes a new instance of the class. The device that will be used to create the buffer. Size of the buffer, in bytes. The requested usage of the buffer. The vertex format of the vertices in the buffer. If set to .None, the buffer will be a non-FVF buffer. The memory class into which the resource will be placed. The variable that will receive the shared handle for this resource. This method is only available in Direct3D9 Ex. bb174364 HRESULT IDirect3DDevice9::CreateVertexBuffer([In] unsigned int Length,[In] D3DUSAGE Usage,[In] D3DFVF FVF,[In] D3DPOOL Pool,[Out, Fast] IDirect3DVertexBuffer9** ppVertexBuffer,[In] void** pSharedHandle) IDirect3DDevice9::CreateVertexBuffer Locks a range of vertex data and obtains a pointer to the vertex buffer memory. As a general rule, do not hold a lock across more than one frame. When working with vertex buffers, you are allowed to make multiple lock calls; however, you must ensure that the number of lock calls match the number of unlock calls. DrawPrimitive calls will not succeed with any outstanding lock count on any currently set vertex buffer. The D3DLOCK_DISCARD and D3DLOCK_NOOVERWRITE flags are valid only on buffers created with D3DUSAGE_DYNAMIC. For information about using D3DLOCK_DISCARD or D3DLOCK_NOOVERWRITE with IDirect3DVertexBuffer9::Lock, see {{Using Dynamic Vertex and Index Buffers}}. Offset into the vertex data to lock, in bytes. To lock the entire vertex buffer, specify 0 for both parameters, SizeToLock and OffsetToLock. Size of the vertex data to lock, in bytes. To lock the entire vertex buffer, specify 0 for both parameters, SizeToLock and OffsetToLock. Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are: D3DLOCK_DISCARD D3DLOCK_NO_DIRTY_UPDATE D3DLOCK_NOSYSLOCK D3DLOCK_READONLY D3DLOCK_NOOVERWRITE For a description of the flags, see . A if the method succeeds. bb205917 HRESULT IDirect3DVertexBuffer9::Lock([In] unsigned int OffsetToLock,[In] unsigned int SizeToLock,[Out] void** ppbData,[In] D3DLOCK Flags) IDirect3DVertexBuffer9::Lock Locks a range of vertex data and obtains a pointer to the vertex buffer memory. As a general rule, do not hold a lock across more than one frame. When working with vertex buffers, you are allowed to make multiple lock calls; however, you must ensure that the number of lock calls match the number of unlock calls. DrawPrimitive calls will not succeed with any outstanding lock count on any currently set vertex buffer. The D3DLOCK_DISCARD and D3DLOCK_NOOVERWRITE flags are valid only on buffers created with D3DUSAGE_DYNAMIC. For information about using D3DLOCK_DISCARD or D3DLOCK_NOOVERWRITE with IDirect3DVertexBuffer9::Lock, see {{Using Dynamic Vertex and Index Buffers}}. Offset into the vertex data to lock, in bytes. To lock the entire vertex buffer, specify 0 for both parameters, SizeToLock and OffsetToLock. Size of the vertex data to lock, in bytes. To lock the entire vertex buffer, specify 0 for both parameters, SizeToLock and OffsetToLock. Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are: D3DLOCK_DISCARD D3DLOCK_NO_DIRTY_UPDATE D3DLOCK_NOSYSLOCK D3DLOCK_READONLY D3DLOCK_NOOVERWRITE For a description of the flags, see . A if the method succeeds. bb205917 HRESULT IDirect3DVertexBuffer9::Lock([In] unsigned int OffsetToLock,[In] unsigned int SizeToLock,[Out] void** ppbData,[In] D3DLOCK Flags) IDirect3DVertexBuffer9::Lock

Applications use the methods of the interface to encapsulate the vertex shader declaration.

A vertex shader declaration is made up of an array of vertex elements.

The LPDIRECT3DVERTEXDECLARATION9 and PDIRECT3DVERTEXDECLARATION9 types are defined as references to the interface.

typedef struct  *LPDIRECT3DVERTEXDECLARATION9, *PDIRECT3DVERTEXDECLARATION9;
bb205919 IDirect3DVertexDeclaration9 IDirect3DVertexDeclaration9
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the current device.

bb205921 GetDevice GetDevice HRESULT IDirect3DVertexDeclaration9::GetDevice([Out] IDirect3DDevice9** ppDevice)

Gets the current device.

Pointer to the interface that is returned.

If the method succeeds, the return value is . If the method fails, the return value can be: .

bb205921 HRESULT IDirect3DVertexDeclaration9::GetDevice([Out] IDirect3DDevice9** ppDevice) IDirect3DVertexDeclaration9::GetDevice

Gets the vertex shader declaration.

Array of vertex elements (see ) that make up a vertex shader declaration. The application needs to allocate enough room for this. The vertex element array ends with the D3DDECL_END macro.

Number of elements in the array. The application needs to allocate enough room for this.

If the method succeeds, the return value is . If the method fails, the return value can be: .

The number of elements, pNumElements, includes the D3DDECL_END macro, which ends the declaration. So the element count is actually one higher than the number of valid vertex elements.

Here's an example that will return the vertex declaration array of up to 256 elements:

  decl[MAXD3DDECLLENGTH];	
            UINT numElements;	
             hr = m_pVertexDeclaration->GetDeclaration( decl, &numElements);	
            

Specify null for pDeclto get the number of elements in the declaration.

bb205920 HRESULT IDirect3DVertexDeclaration9::GetDeclaration([Out, Buffer] D3DVERTEXELEMENT9* pElement,[InOut] unsigned int* pNumElements) IDirect3DVertexDeclaration9::GetDeclaration
Create a vertex shader declaration from the device and the vertex elements. See the {{Vertex Declaration (Direct3D 9)}} page for a detailed description of how to map vertex declarations between different versions of DirectX. The device. An array of vertex elements. If the method succeeds HRESULT IDirect3DDevice9::CreateVertexDeclaration([In, Buffer] const D3DVERTEXELEMENT9* pVertexElements,[None] IDirect3DVertexDeclaration9** ppDecl) Gets the elements. HRESULT IDirect3DVertexDeclaration9::GetDeclaration([Out, Buffer] D3DVERTEXELEMENT9* pElement,[InOut] unsigned int* pNumElements)

Applications use the methods of the interface to encapsulate the functionality of a vertex shader.

The LPDIRECT3DVERTEXSHADER9 and PDIRECT3DVERTEXSHADER9 types are defined as references to the interface.

typedef struct  *LPDIRECT3DVERTEXSHADER9, *PDIRECT3DVERTEXSHADER9;
bb205922 IDirect3DVertexShader9 IDirect3DVertexShader9
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion. Constant MaxDynamicFlowControlDepth. D3DVS20_MAX_DYNAMICFLOWCONTROLDEPTH Constant MinDynamicFlowControlDepth. D3DVS20_MIN_DYNAMICFLOWCONTROLDEPTH Constant MaxTemps. D3DVS20_MAX_NUMTEMPS Constant MinTemps. D3DVS20_MIN_NUMTEMPS Constant MaxStaticFlowControlDepth. D3DVS20_MAX_STATICFLOWCONTROLDEPTH Constant MinStaticFlowControlDepth. D3DVS20_MIN_STATICFLOWCONTROLDEPTH

Gets the device.

bb205923 GetDevice GetDevice HRESULT IDirect3DVertexShader9::GetDevice([Out] IDirect3DDevice9** ppDevice)

Gets the device.

Pointer to the interface that is returned.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205923 HRESULT IDirect3DVertexShader9::GetDevice([Out] IDirect3DDevice9** ppDevice) IDirect3DVertexShader9::GetDevice

Gets a reference to the shader data.

Pointer to a buffer that contains the shader data. The application needs to allocate enough room for this.

Size of the data, in bytes. To get the buffer size that is needed to retrieve the data, set pData = null when calling GetFunction. Then call GetFunction with the returned size, to get the buffer data.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205924 HRESULT IDirect3DVertexShader9::GetFunction([In] void* arg0,[InOut] unsigned int* pSizeOfData) IDirect3DVertexShader9::GetFunction
Initializes a new instance of the class. The device. The function. HRESULT IDirect3DDevice9::CreateVertexShader([In] const void* pFunction,[Out, Fast] IDirect3DVertexShader9** ppShader) Gets the bytecode associated to this shader..

Applications use the methods of the interface to manipulate volume resources.

The interface is obtained by calling the method.

This interface, like all COM interfaces, inherits from the interface.

The LPDIRECT3DVOLUME9 and PDIRECT3DVOLUME9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DVOLUME9, *PDIRECT3DVOLUME9;	
            
bb205932 IDirect3DVolume9 IDirect3DVolume9
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the device associated with a volume.

This method allows navigation to the owning device object.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb205936 GetDevice GetDevice HRESULT IDirect3DVolume9::GetDevice([Out] IDirect3DDevice9** ppDevice)

Retrieves a description of the volume.

bb205935 GetDesc GetDesc HRESULT IDirect3DVolume9::GetDesc([Out] D3DVOLUME_DESC* pDesc)

Retrieves the device associated with a volume.

Address of a reference to an interface to fill with the device reference, if the query succeeds.

If the method succeeds, the return value is . If the method fails, the return value can be .

This method allows navigation to the owning device object.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb205936 HRESULT IDirect3DVolume9::GetDevice([Out] IDirect3DDevice9** ppDevice) IDirect3DVolume9::GetDevice

Associates data with the volume that is intended for use by the application, not by Direct3D.

Reference to the globally unique identifier that identifies the private data to set.

Pointer to a buffer that contains the data to associate with the volume.

Size of the buffer at pData in bytes.

Value that describes the type of data being passed, or indicates to the application that the data should be invalidated when the resource changes.

ItemDescription

(none)

If no flags are specified, Direct3D allocates memory to hold the data within the buffer and copies the data into the new buffer. The buffer allocated by Direct3D is automatically freed, as appropriate.

D3DSPD_IUNKNOWN

The data at pData is a reference to an interface. SizeOfData must be set to the size of a reference to an interface, sizeof(*). Direct3D automatically calls through pData and when the private data is destroyed. Private data will be destroyed by a subsequent call to with the same , a subsequent call to , or when the object is released. For more information, see Remarks.

?

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , E_OUTOFMEMORY.

Direct3D does not manage the memory at pData. If this buffer was dynamically allocated, it is the calling application's responsibility to free the memory.

Data is passed by value, and multiple sets of data can be associated with a single volume.

bb205939 HRESULT IDirect3DVolume9::SetPrivateData([In] const GUID& refguid,[In] const void* pData,[In] unsigned int SizeOfData,[In] unsigned int Flags) IDirect3DVolume9::SetPrivateData

Copies the private data associated with the volume to a provided buffer.

Reference to (C++) or address of (C) the globally unique identifier that identifies the private data to retrieve.

Pointer to a previously allocated buffer to fill with the requested private data if the call succeeds. The application calling this method is responsible for allocating and releasing this buffer. If this parameter is null, this method will return the buffer size in pSizeOfData.

Pointer to the size of the buffer at pData, in bytes. If this value is less than the actual size of the private data, such as 0, the method sets this parameter to the required buffer size, and the method returns .

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , , .

bb205937 HRESULT IDirect3DVolume9::GetPrivateData([In] const GUID& refguid,[In] void* pData,[Out] unsigned int* pSizeOfData) IDirect3DVolume9::GetPrivateData

Frees the specified private data associated with this volume.

Reference to the globally unique identifier that identifies the private data to free.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: , .

Direct3D calls this method automatically when a volume is released.

bb205933 HRESULT IDirect3DVolume9::FreePrivateData([In] const GUID& refguid) IDirect3DVolume9::FreePrivateData

Provides access to the parent volume texture object, if this surface is a child level of a volume texture.

Reference identifier of the volume being requested.

Address of a reference to fill with the container reference, if the query succeeds.

If the method succeeds, the return value is . If the method fails, the return value can be .

If the call succeeds, the reference count of the container is increased by one.

Here's an example getting the parent volume texture of a volume texture.

 // Assumes pSurface is a valid  reference	
            void *pContainer = null;	
             *pVolumeTexture = null;	
             hr = pVolume->GetContainer(IID_IDirect3DVolumeTexture9, &pContainer);	
            if (SUCCEEDED(hr) && pContainer)	
            { pVolumeTexture = ( *)pContainer;	
            
bb205934 HRESULT IDirect3DVolume9::GetContainer([In] const GUID& riid,[In] void** ppContainer) IDirect3DVolume9::GetContainer

Retrieves a description of the volume.

Pointer to a structure, describing the volume.

If the method succeeds, the return value is . is returned if the argument is invalid.

bb205935 HRESULT IDirect3DVolume9::GetDesc([Out] D3DVOLUME_DESC* pDesc) IDirect3DVolume9::GetDesc

Locks a box on a volume resource.

Pointer to a structure, describing the locked region.

Pointer to a box to lock. Specified by a reference to a structure. Specifying null for this parameter locks the entire volume.

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

If the method succeeds, the return value is . If the method fails, the return value can be .

For performance reasons, dirty regions are only recorded for level zero of a texture. Dirty regions are automatically recorded when is called without or . See for more information.

bb205938 HRESULT IDirect3DVolume9::LockBox([Out] D3DLOCKED_BOX* pLockedVolume,[In] const void* pBox,[In] D3DLOCK Flags) IDirect3DVolume9::LockBox

Unlocks a box on a volume resource.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205940 HRESULT IDirect3DVolume9::UnlockBox() IDirect3DVolume9::UnlockBox
Loads a volume from memory. Pointer to a structure, the destination palette of 256 colors or null. Pointer to a structure. Specifies the destination box. Set this parameter to null to specify the entire volume. Pointer to the top-left corner of the source volume in memory. Member of the enumerated type, the pixel format of the source volume. Pitch of source image, in bytes. For DXT formats (compressed texture formats), this number should represent the size of one row of cells, in bytes. Pitch of source image, in bytes. For DXT formats (compressed texture formats), this number should represent the size of one slice of cells, in bytes. Pointer to a structure, the source palette of 256 colors or null. Pointer to a structure. Specifies the source box. null is not a valid value for this parameter. A combination of one or more controlling how the image is filtered. Specifying D3DX_DEFAULT for this parameter is the equivalent of specifying | . value to replace with transparent black, or 0 to disable the color key. 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 color keys. Thus, for opaque black, the value would be equal to 0xFF000000. If the function succeeds, the return value is . If the function fails, the return value can be one of the following values: , D3DXERR_INVALIDDATA. Writing to a non-level-zero surface of the volume texture will not cause the dirty rectangle to be updated. If is called and the texture was not already dirty (this is unlikely under normal usage scenarios), the application needs to explicitly call on the volume texture. HRESULT D3DXLoadVolumeFromMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcMemory,[In] D3DFORMAT SrcFormat,[In] unsigned int SrcRowPitch,[In] unsigned int SrcSlicePitch,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey) Loads a volume from a file on the disk. The volume. Name of the file. The filter. The color key. A object describing the result of the operation. HRESULT D3DXLoadVolumeFromFileW([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] const wchar_t* pSrcFile,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo) Loads a volume from a file on the disk. The volume. Name of the file. The filter. The color key. The source box. The destination box. A object describing the result of the operation. HRESULT D3DXLoadVolumeFromFileW([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] const wchar_t* pSrcFile,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo) Loads a volume from a file on the disk. The volume. Name of the file. The filter. The color key. The source box. The destination box. The image information. A object describing the result of the operation. HRESULT D3DXLoadVolumeFromFileW([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] const wchar_t* pSrcFile,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo) Loads a volume from a file on the disk. The volume. Name of the file. The filter. The color key. The source box. The destination box. The palette. The image information. A object describing the result of the operation. HRESULT D3DXLoadVolumeFromFileW([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] const wchar_t* pSrcFile,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey,[In] D3DXIMAGE_INFO* pSrcInfo) Loads a volume from a file in memory. The volume. The memory. The filter. The color key. A object describing the result of the operation. HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a volume from a file in memory. The volume. The memory. The filter. The color key. The source box. The destination box. A object describing the result of the operation. HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a volume from a file in memory. The volume. The memory. The filter. The color key. The source box. The destination box. The image information. A object describing the result of the operation. HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a volume from a file in memory. The volume. The memory. The filter. The color key. The source box. The destination box. The palette. The image information. A object describing the result of the operation. HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a volume from a file in a stream. The volume. The stream. The filter. The color key. A object describing the result of the operation. HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a volume from a file in a stream. The volume. The stream. The filter. The color key. The source box. The destination box. A object describing the result of the operation. HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a volume from a file in a stream. The volume. The stream. The filter. The color key. The source box. The destination box. The image information. A object describing the result of the operation. HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a volume from a file in a stream. The volume. The stream. The filter. The color key. The source box. The destination box. The palette. The image information. A object describing the result of the operation. HRESULT D3DXLoadVolumeFromFileInMemory([In] IDirect3DVolume9* pDestVolume,[Out, Buffer] const PALETTEENTRY* pDestPalette,[In] const void* pDestBox,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] const void* pSrcBox,[In] D3DX_FILTER Filter,[In] int ColorKey,[In] void* pSrcInfo) Loads a volume from a source volume. The destination volume. The source volume. The filter. The color key. A object describing the result of the operation. HRESULT D3DXLoadVolumeFromVolume([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] IDirect3DVolume9* pSrcVolume,[In] const PALETTEENTRY* pSrcPalette,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey) Loads a volume from a source volume. The destination volume. The source volume. The filter. The color key. The source box. The destination box. A object describing the result of the operation. HRESULT D3DXLoadVolumeFromVolume([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] IDirect3DVolume9* pSrcVolume,[In] const PALETTEENTRY* pSrcPalette,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey) Loads a volume from a source volume. The destination volume. The source volume. The filter. The color key. The source box. The destination box. The destination palette. The source palette. A object describing the result of the operation. HRESULT D3DXLoadVolumeFromVolume([In] IDirect3DVolume9* pDestVolume,[In] const PALETTEENTRY* pDestPalette,[In] const D3DBOX* pDestBox,[In] IDirect3DVolume9* pSrcVolume,[In] const PALETTEENTRY* pSrcPalette,[In] const D3DBOX* pSrcBox,[In] unsigned int Filter,[In] D3DCOLOR ColorKey) Locks a box on a volume resource. The flags. The locked region of this resource HRESULT IDirect3DVolume9::LockBox([Out] D3DLOCKED_BOX* pLockedVolume,[In] const void* pBox,[In] D3DLOCK Flags) Locks a box on a volume resource. The box. The flags. The locked region of this resource HRESULT IDirect3DVolume9::LockBox([Out] D3DLOCKED_BOX* pLockedVolume,[In] const void* pBox,[In] D3DLOCK Flags) Saves a volume to a file on disk. The volume. Name of the file. The format. A object describing the result of the operation. HRESULT D3DXSaveVolumeToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In] const PALETTEENTRY* pSrcPalette,[In] const D3DBOX* pSrcBox) Saves a volume to a file on disk. The volume. Name of the file. The format. The box. A object describing the result of the operation. HRESULT D3DXSaveVolumeToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In] const PALETTEENTRY* pSrcPalette,[In] const D3DBOX* pSrcBox) Saves a volume to a file on disk. The volume. Name of the file. The format. The box. The palette. A object describing the result of the operation. HRESULT D3DXSaveVolumeToFileW([In] const wchar_t* pDestFile,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In] const PALETTEENTRY* pSrcPalette,[In] const D3DBOX* pSrcBox) Saves a volume to a . The volume. The format. A object describing the result of the operation. HRESULT D3DXSaveVolumeToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox) Saves a volume to a . The volume. The format. The box. A object describing the result of the operation. HRESULT D3DXSaveVolumeToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox) Saves a volume to a . The volume. The format. The box. The palette. A object describing the result of the operation. HRESULT D3DXSaveVolumeToFileInMemory([In] ID3DXBuffer** ppDestBuf,[In] D3DXIMAGE_FILEFORMAT DestFormat,[In] IDirect3DVolume9* pSrcVolume,[In, Buffer] const PALETTEENTRY* pSrcPalette,[In] const void* pSrcBox)

Applications use the methods of the interface to manipulate a volume texture resource.

The interface can be obtained by calling the CreateVolumeTexture method or one of the xxx functions.

This interface inherits additional functionality from the interface.

This interface, like all COM interfaces, inherits from the interface.

The LPDIRECT3DVOLUMETEXTURE9 and PDIRECT3DVOLUMETEXTURE9 types are defined as references to the interface.

 typedef struct  *LPDIRECT3DVOLUMETEXTURE9, *PDIRECT3DVOLUMETEXTURE9;	
            
bb205941 IDirect3DVolumeTexture9 IDirect3DVolumeTexture9
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves a level description of a volume texture resource.

Identifies a level of the volume texture resource. This method returns a volume description for the level specified by this parameter.

Pointer to a structure, describing the returned volume texture level.

bb205943 HRESULT IDirect3DVolumeTexture9::GetLevelDesc([In] unsigned int Level,[Out] D3DVOLUME_DESC* pDesc) IDirect3DVolumeTexture9::GetLevelDesc

Retrieves the specified volume texture level.

Identifies a level of the volume texture resource. This method returns a volume for the level specified by this parameter.

Address of a reference to an interface, representing the returned volume level.

Calling this method will increase the internal reference count on the interface. Failure to call IUnknown::Release when finished using this interface results in a memory leak.

bb205944 HRESULT IDirect3DVolumeTexture9::GetVolumeLevel([In] unsigned int Level,[Out] IDirect3DVolume9** ppVolumeLevel) IDirect3DVolumeTexture9::GetVolumeLevel

Locks a box on a volume texture resource.

Specifies the level of the volume texture resource to lock.

Pointer to a structure, describing the locked region.

Pointer to the volume to lock. This parameter is specified by a reference to a structure. Specifying null for this parameter locks the entire volume level.

Combination of zero or more locking flags that describe the type of lock to perform. For this method, the valid flags are:

For a description of the flags, see .

If the method succeeds, the return value is . If the method fails, the return value can be .

For performance reasons, dirty regions are only recorded for level zero of a texture. Dirty regions are automatically recorded when LockBox is called without or . For more information, see UpdateTexture.

bb205945 HRESULT IDirect3DVolumeTexture9::LockBox([In] unsigned int Level,[Out] D3DLOCKED_BOX* pLockedVolume,[In] const void* pBox,[In] D3DLOCK Flags) IDirect3DVolumeTexture9::LockBox

Unlocks a box on a volume texture resource.

Specifies the level of the volume texture resource to unlock.

If the method succeeds, the return value is . If the method fails, the return value can be .

bb205946 HRESULT IDirect3DVolumeTexture9::UnlockBox([In] unsigned int Level) IDirect3DVolumeTexture9::UnlockBox

Adds a dirty region to a volume texture resource.

Pointer to a structure, specifying the dirty region to add. Specifying null expands the dirty region to cover the entire volume texture.

If the method succeeds, the return value is . If the method fails, the return value can be .

For performance reasons, dirty regions are only recorded for level zero of a texture. For sublevels, it is assumed that the corresponding (scaled) box is also dirty. Dirty regions are automatically recorded when LockBox is called without or .

Using and explicitly specifying dirty regions can be used to increase the efficiency of UpdateTexture. Using this method, applications can optimize what subset of a resource is copied by specifying dirty boxes on the resource. However, the dirty regions may be expanded to optimize alignment.

bb205942 HRESULT IDirect3DVolumeTexture9::AddDirtyBox([In] const void* pDirtyBox) IDirect3DVolumeTexture9::AddDirtyBox
Initializes a new instance of the class. The device. The width. The height. The depth. The level count. The usage. The format. The pool. HRESULT IDirect3DDevice9::CreateVolumeTexture([In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Levels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DVolumeTexture9** ppVolumeTexture,[In] void** pSharedHandle) Initializes a new instance of the class. The device. The width. The height. The depth. The level count. The usage. The format. The pool. The shared handle. HRESULT IDirect3DDevice9::CreateVolumeTexture([In] unsigned int Width,[In] unsigned int Height,[In] unsigned int Levels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[Out, Fast] IDirect3DVolumeTexture9** ppVolumeTexture,[In] void** pSharedHandle) Checks texture-creation parameters. Device associated with the texture. The width. The height. The depth. Requested number of mipmap levels for the texture. The requested usage for the texture. Requested format for the texture. Memory class where the resource will be placed. A value type containing the proposed values to pass to the texture creation functions. HRESULT D3DXCheckVolumeTextureRequirements([In] IDirect3DDevice9* pDevice,[InOut] unsigned int* pWidth,[InOut] unsigned int* pHeight,[InOut] unsigned int* pDepth,[InOut] unsigned int* pNumMipLevels,[In] unsigned int Usage,[InOut] D3DFORMAT* pFormat,[In] D3DPOOL Pool) Uses a user-provided function to fill each texel of each mip level of a given texture. A function that is used to fill the texture. A object describing the result of the operation. HRESULT D3DXFillVolumeTexture([In] IDirect3DVolumeTexture9* pVolumeTexture,[In] __function__stdcall* pFunction,[In] void* pData) Uses a compiled high-level shader language (HLSL) function to fill each texel of each mipmap level of a texture. A texture shader object that is used to fill the texture. A object describing the result of the operation. HRESULT D3DXFillVolumeTextureTX([In] IDirect3DVolumeTexture9* pVolumeTexture,[In] ID3DXVolumeTextureShader* pVolumeTextureShader) Locks a box on a volume texture resource. The level. The flags. A describing the region locked. HRESULT IDirect3DVolumeTexture9::LockBox([In] unsigned int Level,[Out] D3DLOCKED_BOX* pLockedVolume,[In] const void* pBox,[In] D3DLOCK Flags) Locks a box on a volume texture resource. The level. The box. The flags. A describing the region locked. HRESULT IDirect3DVolumeTexture9::LockBox([In] unsigned int Level,[Out] D3DLOCKED_BOX* pLockedVolume,[In] const void* pBox,[In] D3DLOCK Flags) Adds a dirty region to a texture resource. A object describing the result of the operation. HRESULT IDirect3DVolumeTexture9::AddDirtyBox([In] const void* pDirtyBox) Adds a dirty region to a texture resource. The direct box ref. A object describing the result of the operation. HRESULT IDirect3DVolumeTexture9::AddDirtyBox([In] const void* pDirtyBox) Creates a from a file The device. The filename. A HRESULT D3DXCreateVolumeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a file The device. The filename. The usage. The pool. A HRESULT D3DXCreateVolumeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a file The device. The filename. The width. The height. The depth. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. A HRESULT D3DXCreateVolumeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a file The device. The filename. The width. The height. The depth. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. A HRESULT D3DXCreateVolumeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a file The device. The filename. The width. The height. The depth. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateVolumeTextureFromFileExW([In] IDirect3DDevice9* pDevice,[In] const wchar_t* pSrcFile,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[In] void* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a memory buffer. The device. The buffer. A HRESULT D3DXCreateVolumeTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a memory buffer. The device. The buffer. The usage. The pool. A HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a memory buffer. The device. The buffer. The width. The height. The depth. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. A HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a memory buffer. The device. The buffer. The width. The height. The depth. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. A HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a memory buffer. The device. The buffer. The width. The height. The depth. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a stream. The device. The stream. A HRESULT D3DXCreateVolumeTextureFromFileInMemory([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a stream. The device. The stream. The usage. The pool. A HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a stream. The device. The stream. The width. The height. The depth. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. A HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a stream. The device. The stream. The size bytes. The width. The height. The depth. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. A HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a stream. The device. The stream. The size bytes. The width. The height. The depth. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. A HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a stream. The device. The stream. The size bytes. The width. The height. The depth. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a stream. The device. The buffer. The width. The height. The depth. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a stream. The device. The stream. The size bytes. The width. The height. The depth. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a stream. The device. The pointer. The size in bytes. The width. The height. The depth. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture) Creates a from a stream. The device. Name of the file. The width. The height. The depth. The level count. The usage. The format. The pool. The filter. The mip filter. The color key. The image information. The palette. A HRESULT D3DXCreateVolumeTextureFromFileInMemoryEx([In] IDirect3DDevice9* pDevice,[In] const void* pSrcData,[In] unsigned int SrcDataSize,[In] unsigned int Size,[In] unsigned int MipLevels,[In] unsigned int Usage,[In] D3DFORMAT Format,[In] D3DPOOL Pool,[In] unsigned int Filter,[In] unsigned int MipFilter,[In] D3DCOLOR ColorKey,[Out] D3DXIMAGE_INFO* pSrcInfo,[Out, Buffer] PALETTEENTRY* pPalette,[In] IDirect3DVolumeTexture9** ppVolumeTexture)

Applications use the methods of the interface to create instances of the and interfaces, and to register templates.

An object also contains a local template store. This local storage may be added to only with the and methods.

and objects created with and also utilize the template store of the parent object.

The interface is obtained by calling the function.

The globally unique identifier () for the interface is IID_ID3DXFile.

The LPD3DXFILE type is defined as a reference to the interface.

 typedef interface  *LPD3DXFILE;	
            
bb205836 ID3DXFile ID3DXFile
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Creates an enumerator object that will read a .x file.

The data source. Either:

  • A file name
  • A D3DXF_FILELOADMEMORY structure
  • A D3DXF_FILELOADRESOURCE structure

Depending on the value of loadflags.

Value that specifies the source of the data. This value can be one of the D3DXF_FILELOADOPTIONS flags.

Address of a reference to an interface, representing the created enumerator object.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADVALUE, D3DXFERR_PARSEERROR.

After using this method, use one of the methods to retrieve a data object.

bb173957 HRESULT ID3DXFile::CreateEnumObject([In] const void* arg0,[In] unsigned int arg1,[In] ID3DXFileEnumObject** arg2) ID3DXFile::CreateEnumObject

Creates a save object that will be used to save data to a .x file.

Pointer to the name of the file to use for saving data.

Value that specifies the name of the file to which data is to be saved. This value can be one of the File Save Options flags.

Indicates the format to use when saving the .x file. This value can be one of the File Formats flags. For more information, see Remarks.

Address of a reference to an interface, representing the created save object.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADVALUE, D3DXFERR_PARSEERROR.

After using this method, use methods of the interface to create data objects and to save templates or data.

For the saved file format dwFileFormat, one of the binary, legacy binary, or text flags in File Formats must be specified. The file can be compressed by using the optional flag.

The file format values can be combined in a logical OR to create compressed text or compressed binary files. If you indicate that the file format should be text and compressed, the file will be written out first as text and then compressed. However, compressed text files are not as efficient as binary text files; in most cases, therefore, you will want to indicate binary and compressed.

bb173958 HRESULT ID3DXFile::CreateSaveObject([In] const void* arg0,[In] unsigned int arg1,[In] unsigned int arg2,[In] ID3DXFileSaveObject** arg3) ID3DXFile::CreateSaveObject

Registers custom templates.

Pointer to a buffer consisting of a .x file in text or binary format that contains templates.

Size of the buffer pointed to by pvData, in bytes.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADVALUE, D3DXFERR_PARSEERROR.

The following code fragment provides an example call to RegisterTemplates And example contents for the buffer to which pvData points.

 #define XSKINEXP_TEMPLATES \ "xof 0303txt 0032\ template XSkinMeshHeader \ { \ <3CF169CE-FF7C-44ab-93C0-F78F62D172E2> \ WORD nMaxSkinWeightsPerVertex; \ WORD nMaxSkinWeightsPerFace; \ WORD nBones; \ } \ template VertexDuplicationIndices \ { \ <B8D65549-D7C9-4995-89CF-53A9A8B031E3> \ DWORD nIndices; \ DWORD nOriginalVertices; \ array DWORD indices[nIndices]; \ } \ template SkinWeights \ { \ <6F0D123B-BAD2-4167-A0D0-80224F25FABB> \ STRING transformNodeName;\ DWORD nWeights; \ array DWORD vertexIndices[nWeights]; \ array float weights[nWeights]; \ Matrix4x4 matrixOffset; \ }"	
            .	
            .	
            . LPD3DXFILE pD3DXFile = null; if ( FAILED  (hr = pD3DXFile->RegisterTemplates(  (LPVOID)XSKINEXP_TEMPLATES, sizeof( XSKINEXP_TEMPLATES ) - 1 ) ) )	
            goto End;	
            

All templates must specify a name and a UUID.

This method calls the RegisterEnumTemplates method, obtaining an interface reference by calling CreateEnumObject with pvData as the first parameter.

bb173960 HRESULT ID3DXFile::RegisterTemplates([In] const void* arg0,[In] SIZE_T arg1) ID3DXFile::RegisterTemplates

Registers custom templates, given an enumeration object.

No documentation.

If the method succeeds, the return value is .

If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

When this method is called, it copies templates stored with the , representing the file, to the local template store of the object.

If an reference is not available, call the RegisterTemplates method instead.

bb173959 HRESULT ID3DXFile::RegisterEnumTemplates([In] ID3DXFileEnumObject* arg0) ID3DXFile::RegisterEnumTemplates

Applications use the methods of the interface to build or to access the immediate hierarchy of the data object. Template restrictions determine the hierarchy.

Data types allowed by the template are called optional members. The optional members are not required, but an object might miss important information without them. These optional members are saved as children of the data object. A child can be another data object or a reference to an earlier data object.

The for the interface is IID_ID3DXFileData.

The LPD3DXFILEDATA type is defined as a reference to this interface.

 typedef interface  *LPD3DXFILEDATA;	
            
bb205837 ID3DXFileData ID3DXFileData
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the enumeration object in this file data object.

bb205840 GetEnum GetEnum HRESULT ID3DXFileData::GetEnum([Out] ID3DXFileEnumObject** arg0)

Retrieves the template ID in this file data object.

bb205843 GetType GetType HRESULT ID3DXFileData::GetType([Out] GUID* arg0)

Indicates whether this file data object is a reference object that points to another child data object.

bb205844 IsReference IsReference BOOL ID3DXFileData::IsReference()

Retrieves the number of children in this file data object.

bb205839 GetChildren GetChildren HRESULT ID3DXFileData::GetChildren([Out] SIZE_T* arg0)

Retrieves the enumeration object in this file data object.

Address of a reference to receive the enumeration object in this file data object.

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

bb205840 HRESULT ID3DXFileData::GetEnum([Out] ID3DXFileEnumObject** arg0) ID3DXFileData::GetEnum

Retrieves the name of this file data object.

Address of a reference to receive the name of this file data object. If this parameter is null, then puiSize will return the size of the string. If szName points to valid memory, the name of this file data object will be copied into szName up to the number of characters given by puiSize.

Pointer to the size of the string that represents the name of this file data object. This parameter can be null if szName provides a reference to the name. This parameter will return the size of the string if szName is null.

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

For this method to succeed, either szName or puiSize must be non-null.

bb205842 HRESULT ID3DXFileData::GetName([In] char* arg0,[Out] SIZE_T* arg1) ID3DXFileData::GetName

Retrieves the of this file data object.

Pointer to a to receive the ID of this file data object. If the file data object has no ID, the returned parameter value will be GUID_NULL.

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

bb205841 HRESULT ID3DXFileData::GetId([In] GUID* arg0) ID3DXFileData::GetId

Accesses the .x file data.

Pointer to the size of the .x file data.

Address of a reference to receive the file data object's interface reference. See Remarks.

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

The ppData reference is only valid during a ... sequence. You can make multiple lock calls. However, you must ensure that the number of lock calls matches the number of unlock calls.

Because file data is not guaranteed to be aligned properly with byte boundaries, you should access ppData with UNALIGNED references.

Returned parameter values are not guaranteed to be valid due to possible file corruption; therefore, your code should verify the returned parameter values.

bb205845 HRESULT ID3DXFileData::Lock([In] SIZE_T* arg0,[In] const void** arg1) ID3DXFileData::Lock

Ends the lifespan of the ppData reference returned by .

The return value is .

You must ensure that the number of calls matches the number of calls. After calling Unlock, the ppData reference returned by should no longer be used.

bb205846 HRESULT ID3DXFileData::Unlock() ID3DXFileData::Unlock

Retrieves the template ID in this file data object.

Pointer to the representing the template in this file data object.

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

bb205843 HRESULT ID3DXFileData::GetType([Out] GUID* arg0) ID3DXFileData::GetType

Indicates whether this file data object is a reference object that points to another child data object.

Returns TRUE if the file data object is a reference object; returns otherwise.

bb205844 BOOL ID3DXFileData::IsReference() ID3DXFileData::IsReference

Retrieves the number of children in this file data object.

Address of a reference to receive the number of children in this file data object.

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

bb205839 HRESULT ID3DXFileData::GetChildren([Out] SIZE_T* arg0) ID3DXFileData::GetChildren

Retrieves a child object in this file data object.

ID of the child object to retrieve.

Address of a reference to receive the child object's interface reference.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following values: D3DXFERR_BADVALUE, D3DXFERR_NOMOREOBJECTS.

bb205838 HRESULT ID3DXFileData::GetChild([In] SIZE_T arg0,[Out] ID3DXFileData** arg1) ID3DXFileData::GetChild

Applications use the methods of the interface to cycle through the child file data objects in the file and to retrieve a child object by its globally unique identifier () or by its name.

The for the interface is IID_ID3DXFileEnumObject.

The LPD3DXFILEENUMOBJECT type is defined as a reference to this interface.

 typedef interface  *LPD3DXFILEENUMOBJECT;	
            
bb205847 ID3DXFileEnumObject ID3DXFileEnumObject
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves the object.

bb205852 GetFile GetFile HRESULT ID3DXFileEnumObject::GetFile([Out] ID3DXFile** arg0)

Retrieves the number of child objects in this file data object.

bb205849 GetChildren GetChildren HRESULT ID3DXFileEnumObject::GetChildren([Out] SIZE_T* arg0)

Retrieves the object.

No documentation.

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

bb205852 HRESULT ID3DXFileEnumObject::GetFile([Out] ID3DXFile** arg0) ID3DXFileEnumObject::GetFile

Retrieves the number of child objects in this file data object.

Address of a reference to receive the number of child objects in this file data object.

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

bb205849 HRESULT ID3DXFileEnumObject::GetChildren([Out] SIZE_T* arg0) ID3DXFileEnumObject::GetChildren

Retrieves a child object in this file data object.

ID of the child object to retrieve.

Address of a reference to receive the child object's interface reference.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADVALUE, D3DXFERR_NOMOREOBJECTS.

bb205848 HRESULT ID3DXFileEnumObject::GetChild([In] SIZE_T arg0,[Out] ID3DXFileData** arg1) ID3DXFileEnumObject::GetChild

Retrieves the data object that has the specified .

Reference to the requested .

Address of a reference to an interface, representing the returned file data object.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following:DXFILEERR_BADVALUE, DXFILEERR_NOTFOUND.

Obtain the rguid of the current file data object with the method.

bb205850 HRESULT ID3DXFileEnumObject::GetDataObjectById([In] const GUID& arg0,[In] ID3DXFileData** arg1) ID3DXFileEnumObject::GetDataObjectById

Retrieves the data object that has the specified name.

Pointer to the requested name.

Address of a reference to an interface, representing the returned file data object.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following:DXFILEERR_BADVALUE, DXFILEERR_NOTFOUND.

Obtain the name szName of the current file data object with the method.

bb205851 HRESULT ID3DXFileEnumObject::GetDataObjectByName([In] const char* arg0,[In] ID3DXFileData** arg1) ID3DXFileEnumObject::GetDataObjectByName

Applications use the methods of the interface to add data objects as children of a .x file data node.

The for the interface is IID_ID3DXFileSaveObject.

The LPD3DXFileSaveData type is defined as a reference to this interface.

 typedef interface  *LPD3DXFILESAVEDATA;	
            
bb205853 ID3DXFileSaveData ID3DXFileSaveData
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Retrieves a reference to this file data node.

bb173951 GetSave GetSave HRESULT ID3DXFileSaveData::GetSave([Out] ID3DXFileSaveObject** arg0)

Retrieves the template ID of this file data node.

bb173952 GetType GetType HRESULT ID3DXFileSaveData::GetType([Out] GUID* arg0)

Retrieves a reference to this file data node.

No documentation.

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

bb173951 HRESULT ID3DXFileSaveData::GetSave([Out] ID3DXFileSaveObject** arg0) ID3DXFileSaveData::GetSave

Retrieves the name of this file data node.

No documentation. No documentation.

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

For this method to succeed, either szName or puiSize must be non-null.

bb173950 HRESULT ID3DXFileSaveData::GetName([In] char* arg0,[Out] SIZE_T* arg1) ID3DXFileSaveData::GetName

Retrieves the of this file data node.

No documentation.

If the method succeeds, the return value is . If the method fails, the following value will be returned: D3DXFERR_BADVALUE.

bb205856 HRESULT ID3DXFileSaveData::GetId([In] GUID* arg0) ID3DXFileSaveData::GetId

Retrieves the template ID of this file data node.

Pointer to the representing the template in this file data node.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADOBJECT, D3DXFERR_BADVALUE.

bb173952 HRESULT ID3DXFileSaveData::GetType([Out] GUID* arg0) ID3DXFileSaveData::GetType

Adds a data object as a child of the file data node.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADOBJECT, D3DXFERR_BADVALUE, E_OUTOFMEMORY.

bb205854 HRESULT ID3DXFileSaveData::AddDataObject([In] const GUID& arg0,[In] const char* arg1,[In] const GUID* arg2,[In] SIZE_T arg3,[In] const void* arg4,[In] ID3DXFileSaveData** arg5) ID3DXFileSaveData::AddDataObject

Adds a data reference as a child of this file data node. The data reference points to a file data object.

No documentation. No documentation.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADOBJECT, D3DXFERR_BADVALUE, E_OUTOFMEMORY.

The file data object being referenced must have either a name or a . The file data object must also derive from a different parent object.

bb205855 HRESULT ID3DXFileSaveData::AddDataReference([In] const char* arg0,[In] const GUID* arg1) ID3DXFileSaveData::AddDataReference

Applications use the methods of the interface to write a .x file to disk, and to add and save data objects and templates.

Templates are not required in every file. For example, you could put all templates into a single .x file rather than duplicating them in every .x file.

The interface is obtained by calling the method.

The globally unique identifier () for the interface is IID_ID3DXFileSaveObject.

The LPD3DXFILESAVEOBJECT type is defined as a reference to this interface.

 typedef interface  *LPD3DXFILESAVEOBJECT;	
            
bb173953 ID3DXFileSaveObject ID3DXFileSaveObject
Initializes a new instance of the class. The native pointer. Performs an explicit conversion from to . (This method is a shortcut to ) The native pointer. The result of the conversion.

Gets the interface of the object that created this object.

bb173955 GetFile GetFile HRESULT ID3DXFileSaveObject::GetFile([Out] ID3DXFile** arg0)

Gets the interface of the object that created this object.

No documentation.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADVALUE, E_NOINTERFACE, E_POINTER.

bb173955 HRESULT ID3DXFileSaveObject::GetFile([Out] ID3DXFile** arg0) ID3DXFileSaveObject::GetFile

Adds a data object as a child of the object.

No documentation. No documentation. No documentation. No documentation. No documentation. No documentation.

If the method succeeds, the return value is . If the method fails, the return value can be one of the following: D3DXFERR_BADOBJECT, DXFILEERR_BADVALUE, E_OUTOFMEMORY.

If a data reference object will reference the data object, either the szName or pId parameter must be non-null.

Save the created data to disk by using the method.

bb173954 HRESULT ID3DXFileSaveObject::AddDataObject([In] const GUID& arg0,[In] const char* arg1,[In] const GUID* arg2,[In] SIZE_T arg3,[In] const void* arg4,[In] ID3DXFileSaveData** arg5) ID3DXFileSaveObject::AddDataObject

Saves a data object and its children to a .x file on disk.

If the method succeeds, the return value is . If the method fails, the return value can be the following: D3DXFERR_BADOBJECT.

After this method succeeds, , and can no longer be called until a new object is created.

bb173956 HRESULT ID3DXFileSaveObject::Save() ID3DXFileSaveObject::Save

Stores an attribute table entry.

An attribute table is used to identify areas of the mesh that need to be drawn with different textures, render states, materials, and so on. In addition, the application can use the attribute table to hide portions of a mesh by not drawing a given attribute identifier (AttribId) when drawing the frame.

The LPD3DXATTRIBUTERANGE type is defined as a reference to the structure.

 typedef * LPD3DXATTRIBUTERANGE;	
            
bb172710 D3DXATTRIBUTERANGE D3DXATTRIBUTERANGE

Attribute table identifier.

bb172710 unsigned int AttribId unsigned int AttribId

Starting face.

bb172710 unsigned int FaceStart unsigned int FaceStart

Face count.

bb172710 unsigned int FaceCount unsigned int FaceCount

Starting vertex.

bb172710 unsigned int VertexStart unsigned int VertexStart

Vertex count.

bb172710 unsigned int VertexCount unsigned int VertexCount

Specifies mesh weight attributes.

This structure describes how a simplification operation will consider vertex data when calculating relative costs between collapsing edges. For example, if the Normal field is 0.0, the simplification operation will ignore the vertex normal component when calculating the error for the collapse. However, if the Normal field is 1.0, the simplification operation will use the vertex normal component. If the Normal field is 2.0, double the amount of errors; if the Normal field is 4.0, then quadruple the number of errors, and so on.

The LPD3DXATTRIBUTEWEIGHTS type is defined as a reference to the structure.

 typedef * LPD3DXATTRIBUTEWEIGHTS;	
            
bb172711 D3DXATTRIBUTEWEIGHTS D3DXATTRIBUTEWEIGHTS

Position.

bb172711 float Position float Position

Blend weight.

bb172711 float Boundary float Boundary

Normal.

bb172711 float Normal float Normal

Diffuse lighting value.

bb172711 float Diffuse float Diffuse

Specular lighting value.

bb172711 float Specular float Specular

Eight texture coordinates.

bb172711 float Texcoord[8] float Texcoord

Tangent.

bb172711 float Tangent float Tangent

Binormal.

bb172711 float Binormal float Binormal

Throughput metrics for help in understanding the performance of an application.

bb172539 D3DDEVINFO_D3D9BANDWIDTHTIMINGS D3DDEVINFO_D3D9BANDWIDTHTIMINGS

The bandwidth or maximum data transfer rate from the host CPU to the GPU. This is typically the bandwidth of the PCI or AGP bus which connects the CPU and the GPU.

bb172539 float MaxBandwidthUtilized float MaxBandwidthUtilized

Memory utilized percentage when uploading data from the host CPU to the GPU.

bb172539 float FrontEndUploadMemoryUtilizedPercent float FrontEndUploadMemoryUtilizedPercent

Vertex throughput percentage. This is the number of vertices processed compared to the theoretical maximum vertex processing rate.

bb172539 float VertexRateUtilizedPercent float VertexRateUtilizedPercent

Triangle set-up throughput percentage. This is the number of triangles that are set up for rasterization compared to the theoretical maximum triangle set-up rate.

bb172539 float TriangleSetupRateUtilizedPercent float TriangleSetupRateUtilizedPercent

Pixel fill throughput percentage. This is the number of pixels that are filled compared to the theoretical pixel fill.

bb172539 float FillRateUtilizedPercent float FillRateUtilizedPercent

Defines a volume.

includes the left, top, and front edges; however, the right, bottom, and back edges are not included. For example, a box that is 100 units wide and begins at 0 (thus, including the points up to and including 99) would be expressed with a value of 0 for the Left member and a value of 100 for the Right member. Note that a value of 99 is not used for the Right member.

The restrictions on side ordering observed for are left to right, top to bottom, and front to back.

bb172510 D3DBOX D3DBOX

Position of the left side of the box on the x-axis.

bb172510 unsigned int Left unsigned int Left

Position of the top of the box on the y-axis.

bb172510 unsigned int Top unsigned int Top

Position of the right side of the box on the x-axis.

bb172510 unsigned int Right unsigned int Right

Position of the bottom of the box on the y-axis.

bb172510 unsigned int Bottom unsigned int Bottom

Position of the front of the box on the z-axis.

bb172510 unsigned int Front unsigned int Front

Position of the back of the box on the z-axis.

bb172510 unsigned int Back unsigned int Back

Measure the cache hit rate performance for textures and indexed vertices.

An efficient cache is typically closer to a 90 percent hit rate, and an inefficient cache is typically closer to a 10 percent hit rate (although a low percentage is not necessarily a problem).

bb172540 D3DDEVINFO_D3D9CACHEUTILIZATION D3DDEVINFO_D3D9CACHEUTILIZATION

The hit rate for finding a texture in the texture cache. This assumes there is a texture cache. Increasing the level-of-detail bias to use the most detailed texture, using many large textures, or producing a near random texture access pattern on large textures with custom shader code can dramatically affect the texture cache hit rate.

bb172540 float TextureCacheHitRate float TextureCacheHitRate

The hit rate for finding transformed vertices in the vertex cache. The GPU is designed to transform indexed vertices and may store them in a vertex cache. If you are using meshes, or may result in better vertex cache utilization.

bb172540 float PostTransformVertexCacheHitRate float PostTransformVertexCacheHitRate

Describes a callback key for use in key frame animation.

bb172886 D3DXKEY_CALLBACK D3DXKEY_CALLBACK

Key frame time stamp.

bb172886 float Time float Time

Pointer to user callback data.

bb172886 void* pCallbackData void pCallbackData

Describes the current clip status.

When clipping is enabled during vertex processing (by ProcessVertices, DrawPrimitive, or other drawing functions), Direct3D computes a clip code for every vertex. The clip code is a combination of D3DCS_* bits. When a vertex is outside a particular clipping plane, the corresponding bit is set in the clipping code. Direct3D maintains the clip status using , which has ClipUnion and ClipIntersection members. ClipUnion is a bitwise OR of all vertex clip codes and ClipIntersection is a bitwise AND of all vertex clip codes. Initial values are zero for ClipUnion and 0xFFFFFFFF for ClipIntersection. When is set to , ClipUnion and ClipIntersection are set to zero. Direct3D updates the clip status during drawing calls. To compute clip status for a particular object, set ClipUnion and ClipIntersection to their initial value and continue drawing.

Clip status is not updated by DrawRectPatch and DrawTriPatch because there is no software emulation for them.

bb172516 D3DCLIPSTATUS9 D3DCLIPSTATUS9

Clip union flags that describe the current clip status. This member can be one or more of the following flags:

ValueMeaning

Combination of all clip flags.

All vertices are clipped by the left plane of the viewing frustum.

All vertices are clipped by the right plane of the viewing frustum.

All vertices are clipped by the top plane of the viewing frustum.

All vertices are clipped by the bottom plane of the viewing frustum.

All vertices are clipped by the front plane of the viewing frustum.

All vertices are clipped by the back plane of the viewing frustum.

Application-defined clipping planes.

Application-defined clipping planes.

Application-defined clipping planes.

Application-defined clipping planes.

Application-defined clipping planes.

Application-defined clipping planes.

?

bb172516 unsigned int ClipUnion unsigned int ClipUnion

Clip intersection flags that describe the current clip status. This member can take the same flags as ClipUnion.

bb172516 unsigned int ClipIntersection unsigned int ClipIntersection

A description of a constant in a constant table.

bb172748 D3DXCONSTANT_DESC D3DXCONSTANT_DESC

Name of the constant.

bb172748 const char* Name char Name

Constant data type. See .

bb172748 D3DXREGISTER_SET RegisterSet D3DXREGISTER_SET RegisterSet

Zero-based index of the constant in the table.

bb172748 unsigned int RegisterIndex unsigned int RegisterIndex

Number of registers that contain data.

bb172748 unsigned int RegisterCount unsigned int RegisterCount

Parameter class. See .

bb172748 D3DXPARAMETER_CLASS Class D3DXPARAMETER_CLASS Class

Parameter type. See .

bb172748 D3DXPARAMETER_TYPE Type D3DXPARAMETER_TYPE Type

Number of rows.

bb172748 unsigned int Rows unsigned int Rows

Number of columns.

bb172748 unsigned int Columns unsigned int Columns

Number of elements in the array.

bb172748 unsigned int Elements unsigned int Elements

Number of structure member sub-parameters.

bb172748 unsigned int StructMembers unsigned int StructMembers

Data size in number of bytes.

bb172748 unsigned int Bytes unsigned int Bytes

Pointer to the default value.

bb172748 const void* DefaultValue void DefaultValue

A description of the constant table.

bb172747 D3DXCONSTANTTABLE_DESC D3DXCONSTANTTABLE_DESC

Name of the constant table creator.

bb172747 const char* Creator char Creator

Shader version.

bb172747 unsigned int Version unsigned int Version

Number of constants in the constant table.

bb172747 unsigned int Constants unsigned int Constants

Describes the creation parameters for a device.

bb172538 D3DDEVICE_CREATION_PARAMETERS D3DDEVICE_CREATION_PARAMETERS

Ordinal number that denotes the display adapter. D3DADAPTER_DEFAULT is always the primary display adapter. Use this ordinal as the Adapter parameter for any of the methods. Note that different instances of Direct3D 9.0 objects can use different ordinals. Adapters can enter or leave a system when users, for example, add or remove monitors from a multiple-monitor system or when they hot-swap a laptop. Consequently, use this ordinal only in a Direct3D 9.0 instance known to be valid, that is, either the Direct3D 9.0 that created this interface or the Direct3D 9.0 returned from GetDirect3D, as called through this interface.

bb172538 unsigned int AdapterOrdinal unsigned int AdapterOrdinal

Member of the enumerated type. Denotes the amount of emulated functionality for this device. The value of this parameter mirrors the value passed to the CreateDevice call that created this device.

bb172538 D3DDEVTYPE DeviceType D3DDEVTYPE DeviceType

Window handle to which focus belongs for this Direct3D device. The value of this parameter mirrors the value passed to the CreateDevice call that created this device.

bb172538 HWND hFocusWindow HWND hFocusWindow

A combination of one or more constants that control global behavior of the device. These constants mirror the constants passed to CreateDevice when the device was created.

bb172538 unsigned int BehaviorFlags unsigned int BehaviorFlags

Specifies types of display modes to filter out.

bb172550 D3DDISPLAYMODEFILTER D3DDISPLAYMODEFILTER

The size of this structure. This should always be set to sizeof().

bb172550 unsigned int Size unsigned int Size

The display mode format to filter out. See .

bb172550 D3DFORMAT Format D3DFORMAT Format

Whether the scanline ordering is interlaced or progressive. See .

bb172550 D3DSCANLINEORDERING ScanLineOrdering D3DSCANLINEORDERING ScanLineOrdering

Describes an effect object.

An effect object can contain multiple rendering techniques and parameters for the same effect.

bb172824 D3DXEFFECT_DESC D3DXEFFECT_DESC

String that contains the name of the effect creator.

bb172824 const char* Creator char Creator

Number of parameters used for effect.

bb172824 unsigned int Parameters unsigned int Parameters

Number of techniques that can render the effect.

bb172824 unsigned int Techniques unsigned int Techniques

Number of functions that can render the effect.

bb172824 unsigned int Functions unsigned int Functions

Describes an animation event.

bb172826 D3DXEVENT_DESC D3DXEVENT_DESC

Event type, as defined in .

bb172826 D3DXEVENT_TYPE Type D3DXEVENT_TYPE Type

Event track identifier.

bb172826 unsigned int Track unsigned int Track

Start time of the event in global time.

bb172826 double StartTime double StartTime

Duration of the event in global time.

bb172826 double Duration double Duration

Transition style of the event, as defined in .

bb172826 D3DXTRANSITION_TYPE Transition D3DXTRANSITION_TYPE Transition

Track weight for the event.

bb172826 float Weight float Weight

Track speed for the event.

bb172826 float Speed float Speed

Track position for the event.

bb172826 double Position double Position

Enable flag.

bb172826 BOOL Enable BOOL Enable

Returns material information saved in Direct3D (.x) files.

The and functions return an array of structures that specify the material color and name of the texture for each material in the mesh. The application is then required to load the texture.

The LPD3DXMATERIAL type is defined as a reference to the structure.

 typedef struct * LPD3DXMATERIAL;	
            
bb172911 D3DXMATERIAL D3DXMATERIAL

structure that describes the material properties.

bb172911 D3DMATERIAL9 MatD3D D3DMATERIAL9 MatD3D

Pointer to a string that specifies the file name of the texture.

bb172911 char* pTextureFilename char pTextureFilename

Defines the attributes of a font.

The compiler setting also determines the structure type. If Unicode is defined, the structure type resolves to a ; otherwise the structure type resolves to a D3DXFONT_DESCA.

Possible values of the above members are given in the GDI structure.

bb172843 D3DXFONT_DESCW D3DXFONT_DESCW

Height, in logical units, of the font's character cell or character.

bb172843 int Height int Height

Width, in logical units, of characters in the font.

bb172843 unsigned int Width unsigned int Width

Weight of the font in the range from 0 through 1000.

bb172843 D3DX9_FONT_WEIGHT Weight D3DX9_FONT_WEIGHT Weight

Number of mip levels requested. If this value is zero or D3DX_DEFAULT, a complete mipmap chain is created. If the value is 1, the texture space is mapped identically to the screen space.

bb172843 unsigned int MipLevels unsigned int MipLevels

Set to TRUE for an Italic font.

bb172843 BOOL Italic BOOL Italic

Character set.

bb172843 D3DX9_FONT_CHARSET CharSet D3DX9_FONT_CHARSET CharSet

Output precision. The output precision defines how closely the output must match the requested font height, width, character orientation, escapement, pitch, and font type.

bb172843 D3DX9_FONT_PRECISION OutputPrecision D3DX9_FONT_PRECISION OutputPrecision

Output quality.

bb172843 D3DX9_FONT_QUALITY Quality D3DX9_FONT_QUALITY Quality

Pitch and family of the font.

bb172843 D3DX9_FONT_PITCHFAMILY PitchAndFamily D3DX9_FONT_PITCHFAMILY PitchAndFamily

A null-terminated string or characters that specifies the typeface name of the font. The length of the string must not exceed 32 characters, including the terminating null character. If FaceName is an empty string, the first font that matches the other specified attributes will be used. If the compiler settings require Unicode, the data type TCHAR resolves to WCHAR; otherwise, the data type resolves to CHAR. See Remarks.

bb172843 wchar_t FaceName[32] wchar_t FaceName

Encapsulates a transform frame in a transformation frame hierarchy.

An application can derive from this structure to add other data.

bb172845 D3DXFRAME D3DXFRAME

Name of the frame.

bb172845 char* Name char Name

Transformation matrix.

bb172845 D3DXMATRIX TransformationMatrix D3DXMATRIX TransformationMatrix

Pointer to the mesh container.

bb172845 D3DXMESHCONTAINER* pMeshContainer D3DXMESHCONTAINER pMeshContainer

Pointer to a sibling frame.

bb172845 D3DXFRAME* pFrameSibling D3DXFRAME pFrameSibling

Pointer to a child frame.

bb172845 D3DXFRAME* pFrameFirstChild D3DXFRAME pFrameFirstChild
No documentation. bb280311 D3DXFUNCTION_DESC D3DXFUNCTION_DESC No documentation. bb280311 const char* Name char Name No documentation. bb280311 unsigned int Annotations unsigned int Annotations

Contains red, green, and blue ramp data.

bb172561 D3DGAMMARAMP D3DGAMMARAMP

Array of 256 WORD element that describes the red gamma ramp.

bb172561 unsigned short red[256] unsigned short red

Array of 256 WORD element that describes the green gamma ramp.

bb172561 unsigned short green[256] unsigned short green

Array of 256 WORD element that describes the blue gamma ramp.

bb172561 unsigned short blue[256] unsigned short blue

Returns a description of the original contents of an image file.

bb172879 D3DXIMAGE_INFO D3DXIMAGE_INFO

Width of original image in pixels.

bb172879 unsigned int Width unsigned int Width

Height of original image in pixels.

bb172879 unsigned int Height unsigned int Height

Depth of original image in pixels.

bb172879 unsigned int Depth unsigned int Depth

Number of mip levels in original image.

bb172879 unsigned int MipLevels unsigned int MipLevels

A value from the enumerated type that most closely describes the data in the original image.

bb172879 D3DFORMAT Format D3DFORMAT Format

Represents the type of the texture stored in the file. It is either , , or D3DRTYPE_CubeTexture.

bb172879 D3DRESOURCETYPE ResourceType D3DRESOURCETYPE ResourceType

Represents the format of the image file.

bb172879 D3DXIMAGE_FILEFORMAT ImageFileFormat D3DXIMAGE_FILEFORMAT ImageFileFormat
Retrieves information about a given image file on the disk. The filename. A structure HRESULT D3DXGetImageInfoFromFileInMemory([In] const void* pSrcData,[In] unsigned int SrcDataSize,[Out] D3DXIMAGE_INFO* pSrcInfo) Retrieves information about a given image file in memory. The memory. A structure HRESULT D3DXGetImageInfoFromFileInMemory([In] const void* pSrcData,[In] unsigned int SrcDataSize,[Out] D3DXIMAGE_INFO* pSrcInfo) Retrieves information about a given image file from a stream. The stream. A structure This method keeps the position of the stream HRESULT D3DXGetImageInfoFromFileInMemory([In] const void* pSrcData,[In] unsigned int SrcDataSize,[Out] D3DXIMAGE_INFO* pSrcInfo) Retrieves information about a given image file from a stream. The stream. if set to true preserve the stream position; false will move the stream pointer. A structure HRESULT D3DXGetImageInfoFromFileInMemory([In] const void* pSrcData,[In] unsigned int SrcDataSize,[Out] D3DXIMAGE_INFO* pSrcInfo)

Describes an index buffer.

bb172563 D3DINDEXBUFFER_DESC D3DINDEXBUFFER_DESC

Member of the enumerated type, describing the surface format of the index buffer data.

bb172563 D3DFORMAT Format D3DFORMAT Format

Member of the enumerated type, identifying this resource as an index buffer.

bb172563 D3DRESOURCETYPE Type D3DRESOURCETYPE Type

Combination of one or more of the following flags, specifying the usage for this resource.

ValueMeaning

Set to indicate that the index buffer content will never require clipping.

Set to indicate that the index buffer requires dynamic memory use. This is useful for drivers because it enables them to decide where to place the buffer. In general, static index buffers are placed in video memory and dynamic index buffers are placed in AGP memory. Note that there is no separate static usage; if you do not specify the index buffer is made static. is strictly enforced through the and locking flags. As a result, and are only valid on index buffers created with ; they are not valid flags on static vertex buffers.

For more information about using dynamic index buffers, see Using Dynamic Vertex and Index Buffers.

Note that cannot be specified on managed index buffers. For more information, see Managing Resources (Direct3D 9).

Set to indicate when the index buffer is to be used for drawing high-order primitives.

Set to indicate when the index buffer is to be used for drawing N patches.

Set to indicate when the index buffer is to be used for drawing point sprites or indexed point lists.

Set to indicate that the buffer is to be used with software processing.

Informs the system that the application writes only to the index buffer. Using this flag enables the driver to choose the best memory location for efficient write operations and rendering. Attempts to read from an index buffer that is created with this capability can result in degraded performance.

?

bb172563 D3DUSAGE Usage D3DUSAGE Usage

Member of the enumerated type, specifying the class of memory allocated for this index buffer.

bb172563 D3DPOOL Pool D3DPOOL Pool

Size of the index buffer, in bytes.

bb172563 unsigned int Size unsigned int Size

Percent of time processing data in the driver. These statistics may help identify cases when the driver is waiting for other resources.

These metrics help identify when a driver is waiting and what it is waiting for. High percentages are not necessarily a problem.

These system-global metrics may or may not be implemented. Depending on the specific hardware, these metrics may not support multiple queries simultaneously.

bb172541 D3DDEVINFO_D3D9INTERFACETIMINGS D3DDEVINFO_D3D9INTERFACETIMINGS

Percentage of time the driver spent waiting for the GPU to finish using a locked resource (and wasn't specified).

bb172541 float WaitingForGPUToUseApplicationResourceTimePercent float WaitingForGPUToUseApplicationResourceTimePercent

Percentage of time the driver spent waiting for the GPU to finish processing some commands before the driver could send more. This indicates the driver has run out of room to send commands to the GPU.

bb172541 float WaitingForGPUToAcceptMoreCommandsTimePercent float WaitingForGPUToAcceptMoreCommandsTimePercent

Percentage of time the driver spent waiting for the GPU latency to reduce to less than three rendering frames.

If an application is GPU-limited, the driver must stall the CPU until the GPU gets within three frames. This prevents an application from queuing up many seconds' worth of rendering calls which may dramatically increase the latency between when the user inputs new data and when the user sees the results of that input. In general, the driver can track the number of times Present is called to prevent queuing up more than three frames of rendering work.

bb172541 float WaitingForGPUToStayWithinLatencyTimePercent float WaitingForGPUToStayWithinLatencyTimePercent

Percentage of time the driver spent waiting for a resource that cannot be pipelined (that is operated in parallel). An application may want to avoid using a non-pipelined resource for performance reasons.

bb172541 float WaitingForGPUExclusiveResourceTimePercent float WaitingForGPUExclusiveResourceTimePercent

Percentage of time the driver spent waiting for other GPU processing.

bb172541 float WaitingForGPUOtherTimePercent float WaitingForGPUOtherTimePercent

Defines a set of lighting properties.

bb172566 D3DLIGHT9 D3DLIGHT9

Type of the light source. This value is one of the members of the enumerated type.

bb172566 D3DLIGHTTYPE Type D3DLIGHTTYPE Type

Diffuse color emitted by the light. This member is a structure.

bb172566 D3DCOLORVALUE Diffuse D3DCOLORVALUE Diffuse

Specular color emitted by the light. This member is a structure.

bb172566 D3DCOLORVALUE Specular D3DCOLORVALUE Specular

Ambient color emitted by the light. This member is a structure.

bb172566 D3DCOLORVALUE Ambient D3DCOLORVALUE Ambient

Position of the light in world space, specified by a structure. This member has no meaning for directional lights and is ignored in that case.

bb172566 D3DVECTOR Position D3DVECTOR Position

Direction that the light is pointing in world space, specified by a structure. This member has meaning only for directional and spotlights. This vector need not be normalized, but it should have a nonzero length.

bb172566 D3DVECTOR Direction D3DVECTOR Direction

Distance beyond which the light has no effect. The maximum allowable value for this member is the square root of FLT_MAX. This member does not affect directional lights.

bb172566 float Range float Range

Decrease in illumination between a spotlight's inner cone (the angle specified by Theta) and the outer edge of the outer cone (the angle specified by Phi).

The effect of falloff on the lighting is subtle. Furthermore, a small performance penalty is incurred by shaping the falloff curve. For these reasons, most developers set this value to 1.0.

bb172566 float Falloff float Falloff

Value specifying how the light intensity changes over distance. Attenuation values are ignored for directional lights. This member represents an attenuation constant. For information about attenuation, see Light Properties (Direct3D 9). Valid values for this member range from 0.0 to infinity. For non-directional lights, all three attenuation values should not be set to 0.0 at the same time.

bb172566 float Attenuation0 float Attenuation0

Value specifying how the light intensity changes over distance. Attenuation values are ignored for directional lights. This member represents an attenuation constant. For information about attenuation, see Light Properties (Direct3D 9). Valid values for this member range from 0.0 to infinity. For non-directional lights, all three attenuation values should not be set to 0.0 at the same time.

bb172566 float Attenuation1 float Attenuation1

Value specifying how the light intensity changes over distance. Attenuation values are ignored for directional lights. This member represents an attenuation constant. For information about attenuation, see Light Properties (Direct3D 9). Valid values for this member range from 0.0 to infinity. For non-directional lights, all three attenuation values should not be set to 0.0 at the same time.

bb172566 float Attenuation2 float Attenuation2

Angle, in radians, of a spotlight's inner cone - that is, the fully illuminated spotlight cone. This value must be in the range from 0 through the value specified by Phi.

bb172566 float Theta float Theta

Angle, in radians, defining the outer edge of the spotlight's outer cone. Points outside this cone are not lit by the spotlight. This value must be between 0 and pi.

bb172566 float Phi float Phi
No documentation. bb280342 D3DLOCKED_BOX D3DLOCKED_BOX No documentation. bb280342 int RowPitch int RowPitch No documentation. bb280342 int SlicePitch int SlicePitch No documentation. bb280342 void* pBits void pBits

Describes a locked rectangular region.

The pitch for DXTn formats is different from what was returned in DirectX 7. It now refers to the number of bytes in a row of blocks. For example, if you have a width of 16, then you will have a pitch of 4 blocks (4*8 for DXT1, 4*16 for DXT2-5.)

bb172570 D3DLOCKED_RECT D3DLOCKED_RECT

Number of bytes in one row of the surface.

bb172570 int Pitch int Pitch

Pointer to the locked bits. If a was provided to the LockRect call, pBits will be appropriately offset from the start of the surface.

bb172570 void* pBits void pBits

Describes preprocessor definitions used by an effect object.

To use s in more than one line, prefix each new line character with a backslash (like a #define in the C language). For example:

 sample=	
            macro.Name = "DO_CODE_BLOCK";	
            macro.Definition = "/* here is a block of code */\\\n" "{ do something ... }\\\n";	
            

Notice the 3 backslash characters at the end of the line. The first two are required to output a single '\', followed by the newline character "\n". Optionally, you may also want to terminate your lines using "\\\r\n".

bb172910 D3DXMACRO D3DXMACRO

Preprocessor name.

bb172910 const char* Name char Name

Definition name.

bb172910 const char* Definition char Definition
Initializes a new instance of the struct. The name. The definition.

Specifies material properties.

To turn off specular highlights, set to , using . This is the fastest option because no specular highlights will be calculated.

For more information about using the lighting engine to calculate specular lighting, see Specular Lighting (Direct3D 9).

bb172571 D3DMATERIAL9 D3DMATERIAL9

Value specifying the diffuse color of the material. See .

bb172571 D3DCOLORVALUE Diffuse D3DCOLORVALUE Diffuse

Value specifying the ambient color of the material. See .

bb172571 D3DCOLORVALUE Ambient D3DCOLORVALUE Ambient

Value specifying the specular color of the material. See .

bb172571 D3DCOLORVALUE Specular D3DCOLORVALUE Specular

Value specifying the emissive color of the material. See .

bb172571 D3DCOLORVALUE Emissive D3DCOLORVALUE Emissive

Floating-point value specifying the sharpness of specular highlights. The higher the value, the sharper the highlight.

bb172571 float Power float Power
No documentation. bb280302 D3DXMESHCONTAINER D3DXMESHCONTAINER No documentation. bb280302 char* Name char Name No documentation. bb280302 D3DXMESHDATA MeshData D3DXMESHDATA MeshData No documentation. bb280302 D3DXMATERIAL* pMaterials D3DXMATERIAL pMaterials No documentation. bb280302 D3DXEFFECTINSTANCE* pEffects D3DXEFFECTINSTANCE pEffects No documentation. bb280302 unsigned int NumMaterials unsigned int NumMaterials No documentation. bb280302 unsigned int* pAdjacency unsigned int pAdjacency No documentation. bb280302 ID3DXSkinInfo* pSkinInfo ID3DXSkinInfo pSkinInfo No documentation. bb280302 D3DXMESHCONTAINER* pNextMeshContainer D3DXMESHCONTAINER pNextMeshContainer Gets or sets the materials. The materials.

Mesh data structure.

bb205372 D3DXMESHDATA D3DXMESHDATA

Defines the mesh data type. See .

bb205372 D3DXMESHDATATYPE Type D3DXMESHDATATYPE Type

Pointer to a mesh. See .

bb205372 ID3DXMesh* pMesh ID3DXMesh pMesh

Pointer to a patch mesh. See .

bb205372 ID3DXPMesh* pPMesh ID3DXPMesh pPMesh

Pointer to a patch mesh. See .

bb205372 ID3DXPatchMesh* pPatchMesh ID3DXPatchMesh pPatchMesh

Describes a parameter used for an effect object.

bb205379 D3DXPARAMETER_DESC D3DXPARAMETER_DESC

Name of the parameter.

bb205379 const char* Name char Name

Semantic meaning, also called the usage.

bb205379 const char* Semantic char Semantic

Parameter class. Set this to one of the values in .

bb205379 D3DXPARAMETER_CLASS Class D3DXPARAMETER_CLASS Class

Parameter type. Set this to one of the values in .

bb205379 D3DXPARAMETER_TYPE Type D3DXPARAMETER_TYPE Type

Number of rows in the array.

bb205379 unsigned int Rows unsigned int Rows

Number of columns in the array.

bb205379 unsigned int Columns unsigned int Columns

Number of elements in the array.

bb205379 unsigned int Elements unsigned int Elements

Number of annotations.

bb205379 unsigned int Annotations unsigned int Annotations

Number of structure members.

bb205379 unsigned int StructMembers unsigned int StructMembers

Parameter attributes. See Effect Constants.

bb205379 unsigned int Flags unsigned int Flags

The size of the parameter, in bytes.

bb205379 unsigned int Bytes unsigned int Bytes

Describes a pass for an effect object.

bb205381 D3DXPASS_DESC D3DXPASS_DESC

String value used for the pass.

bb205381 const char* Name char Name

Annotations are user-specific data that can be attached to any technique, pass, or parameter. See Add Information to Effect Parameters with_Annotations.

bb205381 unsigned int Annotations unsigned int Annotations

Pointer to the vertex shader function. If an effect is created with , this structure will return a null reference when called by GetPassDesc.

bb205381 const unsigned int* pVertexShaderFunction unsigned int pVertexShaderFunction

Pointer to the pixel shader function. If an effect is created with , this structure will return a null reference when called by GetPassDesc.

bb205381 const unsigned int* pPixelShaderFunction unsigned int pPixelShaderFunction

Structure that contains the attributes of a patch mesh.

A mesh is a set of faces, each of which is described by a simple polygon. Objects can be created by connecting several meshes together. A patch mesh is constructed from patches. A patch is a four-sided piece of geometry constructed from curves. The type of curve used and the order of the curve can be varied so that the patch surface will fit almost any surface shape.

The following types of patch combinations are supported:

Patch TypeBasisDegree
RectangleBezier2,3,5
RectangleB-Spline2,3,5
RectangleCatmull-Rom3
TriangleBezier2,3,5
N-patchN/A3

?

bb205382 D3DXPATCHINFO D3DXPATCHINFO

The patch type. For information about patch types, see .

bb205382 D3DXPATCHMESHTYPE PatchType D3DXPATCHMESHTYPE PatchType

Degree of the curves used to construct the patch. For information about the degrees supported, see .

bb205382 D3DDEGREETYPE Degree D3DDEGREETYPE Degree

Type of curve used to construct the patch. For information about the basis types supported, see .

bb205382 D3DBASISTYPE Basis D3DBASISTYPE Basis

Percent of time processing data in the pipeline.

For best performance, a balanced load is recommended.

bb172542 D3DDEVINFO_D3D9PIPELINETIMINGS D3DDEVINFO_D3D9PIPELINETIMINGS

Percent of time spent running vertex shaders.

bb172542 float VertexProcessingTimePercent float VertexProcessingTimePercent

Percent of time spent running pixel shaders.

bb172542 float PixelProcessingTimePercent float PixelProcessingTimePercent

Percent of time spent doing other processing.

bb172542 float OtherGPUProcessingTimePercent float OtherGPUProcessingTimePercent

Percent of time not processing anything.

bb172542 float GPUIdleTimePercent float GPUIdleTimePercent

Pixel shader driver caps.

bb172591 D3DPSHADERCAPS2_0 D3DPSHADERCAPS2_0

Instruction predication is supported if this value is nonzero. See setp_comp - vs.

bb172591 D3DPS20CAPS Caps D3DPS20CAPS Caps

Either 0 or 24, which represents the depth of the dynamic flow control instruction nesting. See .

bb172591 int DynamicFlowControlDepth int DynamicFlowControlDepth

The number of temporary registers supported. See .

bb172591 int NumTemps int NumTemps

The depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - vs instructions. See .

bb172591 int StaticFlowControlDepth int StaticFlowControlDepth

The number of instruction slots supported. See .

bb172591 int NumInstructionSlots int NumInstructionSlots

Describes swapchain statistics relating to PresentEx calls.

When a 9Ex application adopts Flip Mode present (), applications can detect frame dropping by calling GetPresentStatistics at any point in time. In effect, they can do the following.

  1. Render to the back buffer
  2. Call Present
  3. Call GetPresentStats and store the resulting structure
  4. Render the next frame to the back buffer
  5. Call Present
  6. Repeat steps 4 and 5 one or more times
  7. Call GetPresentStats and store the resulting structure
  8. Compare the values of PresentRefreshCount from the two stored structures. The application can calculate the corresponding PresentRefreshCount of a particular PresentCount parameter based on the assumptions of PresentRefreshCount increment and PresentCount assignment of frame presents. If the PresentRefreshCount last sampled does not match the PresentCount (i.e. if the PresentRefreshCount has incremented but PresentCount has not, then there was frame dropping.)

Applications can determine whether a frame has been dropped by sampling any two instances of PresentCount and GetPresentStats (by calling GetPresentStats API at any two points in time). For example, a media application that is presenting at the same rate as the monitor refresh rate (for example, monitor refresh rate is 60Hz, the application presents a frame every 1/60 seconds) wants to present frames A, B, C, D, E, each corresponding to Present IDs (PresentCount) 1, 2, 3, 7, 8.

The application code looks like the following sequence.

  1. Render frame A to the back buffer
  2. Call Present, PresentCount = 1
  3. Call GetPresentStats and store the resulting structure
  4. Render the next 4 frames, B, C, D, E, respectively
  5. Call Present 4 times, PresentCounts = 2, 3, 7, 8, respectively
  6. Call GetPresentStats and store the resulting structure
  7. Compare the values of PresentRefreshCount from the two stored structures. If the difference is 2, i.e. 2 vblank intervals has elapsed between the two GetPresentStats API calls, then the last presented frame should be frame C. Because the application presents once very vblank interval (the refresh rate of the monitor), the time elapsed between when frame A is presented and when frame C is presented should be 2 vblanks.
  8. Compare the values of PresentCount from the two stored structures. If the first PresentCount is 1 (corresponding to frame A) and the second PresentCount is 3 (corresponding to frame C), then no frames have been dropped. If the second PresentCount is 3, which corresponds to frame D, then the application knows that one frame has been dropped.

Note that GetPresentStatistics will be processed after it is called, regardless of the state of FLIPEX mode PresentEx calls.

Windows?Vista:??The Present calls will be queued and then processed before GetPresentStats call will be processed.

When an application detects that the presentation of certain frames are behind, it can skip those frames and correct the presentation to re-synchronize with the vblank. To do this, an application can simply not render the late frames and start rendering with the next correct frame in the queue. However, if an application has already started the rendering of late frames, it can use a new Present parameter in D3D9Ex called . The flag will be passed in the parameters of Present API call and indicates to the runtime that the frame will be processed immediately within the next vblank interval, effectively not visible on screen at all. Here is the application usage example after the last step in the previous example.

  1. Render the next frame to the back buffer
  2. Discover from PresentRefreshCount that the next frame is already late
  3. Set Present interval to
  4. Call Present on the next frame

Applications can synchronize video and audio streams in the same manner because the behavior of GetPresentStatistics does not change in that scenario.

D3D9Ex Flip Mode provides frame statistics information to windowed applications and full screen 9Ex applications.

Windows?Vista:??Use the DWM APIs for retrieving present statistics.

When Desktop Window Manager is turned off, windowed mode 9Ex applications using flip mode will receive present statistics information of limited accuracy.

Windows?Vista:??

If an application is not fast enough to keep up with the monitor's refresh rate, possibly due to slow hardware or lack of system resources, then it can experience a graphics glitch. A glitch is a so-called visual hiccup. If a monitor is set to refresh at 60 Hz, and the application can only manage 30 fps, then half of the frames will have glitches.

Applications can detect a glitch by keeping track of SynchRefreshCount. For example, an application might perform the following sequence of actions.

  1. Render to the back buffer.
  2. Call Present.
  3. Call GetPresentStats and store the resulting structure.
  4. Render the next frame to the back buffer.
  5. Call Present.
  6. Call GetPresentStats and store the resulting structure.
  7. Compare the values of SyncRefreshCount from the two stored structures. If the difference is greater than one, then a frame was skipped.
bb172587 D3DPRESENTSTATS D3DPRESENTSTATS
No documentation. bb172587 unsigned int PresentCount unsigned int PresentCount No documentation. bb172587 unsigned int PresentRefreshCount unsigned int PresentRefreshCount No documentation. bb172587 unsigned int SyncRefreshCount unsigned int SyncRefreshCount No documentation. bb172587 LARGE_INTEGER SyncQPCTime LARGE_INTEGER SyncQPCTime No documentation. bb172587 LARGE_INTEGER SyncGPUTime LARGE_INTEGER SyncGPUTime

Describes the presentation parameters.

bb172588 D3DPRESENT_PARAMETERS D3DPRESENT_PARAMETERS

Width of the new swap chain's back buffers, in pixels. If Windowed is (the presentation is full-screen), this value must equal the width of one of the enumerated display modes found through EnumAdapterModes. If Windowed is TRUE and either BackBufferWidth or BackBufferHeight is zero, the corresponding dimension of the client area of the hDeviceWindow (or the focus window, if hDeviceWindow is null) is taken.

bb172588 unsigned int BackBufferWidth unsigned int BackBufferWidth

Height of the new swap chain's back buffers, in pixels. If Windowed is (the presentation is full-screen), this value must equal the height of one of the enumerated display modes found through EnumAdapterModes. If Windowed is TRUE and either BackBufferWidth or BackBufferHeight is zero, the corresponding dimension of the client area of the hDeviceWindow (or the focus window, if hDeviceWindow is null) is taken.

bb172588 unsigned int BackBufferHeight unsigned int BackBufferHeight

The back buffer format. For more information about formats, see . This value must be one of the render-target formats as validated by CheckDeviceType. You can use GetDisplayMode to obtain the current format.

In fact, can be specified for the BackBufferFormat while in windowed mode. This tells the runtime to use the current display-mode format and eliminates the need to call GetDisplayMode.

For windowed applications, the back buffer format no longer needs to match the display-mode format because color conversion can now be done by the hardware (if the hardware supports color conversion). The set of possible back buffer formats is constrained, but the runtime will allow any valid back buffer format to be presented to any desktop format. (There is the additional requirement that the device be operable in the desktop; devices typically do not operate in 8 bits per pixel modes.)

Full-screen applications cannot do color conversion.

bb172588 D3DFORMAT BackBufferFormat D3DFORMAT BackBufferFormat

This value can be between 0 and (or when using Direct3D 9Ex). Values of 0 are treated as 1. If the number of back buffers cannot be created, the runtime will fail the method call and fill this value with the number of back buffers that could be created. As a result, an application can call the method twice with the same structure and expect it to work the second time.

The method fails if one back buffer cannot be created. The value of BackBufferCount influences what set of swap effects are allowed. Specifically, any swap effect requires that there be exactly one back buffer.

bb172588 unsigned int BackBufferCount unsigned int BackBufferCount

Member of the enumerated type. The value must be unless SwapEffect has been set to . Multisampling is supported only if the swap effect is .

bb172588 D3DMULTISAMPLE_TYPE MultiSampleType D3DMULTISAMPLE_TYPE MultiSampleType

Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by CheckDeviceMultiSampleType. Passing a larger value returns the error . Paired values of render targets or of depth stencil surfaces and must match.

bb172588 unsigned int MultiSampleQuality unsigned int MultiSampleQuality

Member of the enumerated type. The runtime will guarantee the implied semantics concerning buffer swap behavior; therefore, if Windowed is TRUE and SwapEffect is set to , the runtime will create one extra back buffer and copy whichever becomes the front buffer at presentation time.

requires that BackBufferCount be set to 1.

will be enforced in the debug runtime by filling any buffer with noise after it is presented.

Differences between Direct3D9 and Direct3D9Ex

In Direct3D9Ex, is added to designate when an application is adopting flip mode. That is, whan an application's frame is passed in window's mode (instead of copied) to the Desktop Window Manager(DWM) for composition. Flip mode provides more efficient memory bandwidth and enables an application to take advantage of full-screen-present statistics. It does not change full screen behavior. Flip mode behavior is available beginning with Windows 7.

?

bb172588 D3DSWAPEFFECT SwapEffect D3DSWAPEFFECT SwapEffect

The device window determines the location and size of the back buffer on screen. This is used by Direct3D when the back buffer contents are copied to the front buffer during Present.

  • For a full-screen application, this is a handle to the top window (which is the focus window).

    For applications that use multiple full-screen devices (such as a multimonitor system), exactly one device can use the focus window as the device window. All other devices must have unique device windows.

  • For a windowed-mode application, this handle will be the default target window for Present. If this handle is null, the focus window will be taken.

Note that no attempt is made by the runtime to reflect user changes in window size. The back buffer is not implicitly reset when this window is reset. However, the Present method does automatically track window position changes.

bb172588 HWND hDeviceWindow HWND hDeviceWindow

TRUE if the application runs windowed; if the application runs full-screen.

bb172588 BOOL Windowed BOOL Windowed

If this value is TRUE, Direct3D will manage depth buffers for the application. The device will create a depth-stencil buffer when it is created. The depth-stencil buffer will be automatically set as the render target of the device. When the device is reset, the depth-stencil buffer will be automatically destroyed and recreated in the new size.

If EnableAutoDepthStencil is TRUE, then AutoDepthStencilFormat must be a valid depth-stencil format.

bb172588 BOOL EnableAutoDepthStencil BOOL EnableAutoDepthStencil

Member of the enumerated type. The format of the automatic depth-stencil surface that the device will create. This member is ignored unless EnableAutoDepthStencil is TRUE.

bb172588 D3DFORMAT AutoDepthStencilFormat D3DFORMAT AutoDepthStencilFormat

One of the constants.

bb172588 D3DPRESENTFLAG Flags D3DPRESENTFLAG Flags

The rate at which the display adapter refreshes the screen. The value depends on the mode in which the application is running:

  • For windowed mode, the refresh rate must be 0.
  • For full-screen mode, the refresh rate is one of the refresh rates returned by EnumAdapterModes.
bb172588 unsigned int FullScreen_RefreshRateInHz unsigned int FullScreen_RefreshRateInHz

The maximum rate at which the swap chain's back buffers can be presented to the front buffer. For a detailed explanation of the modes and the intervals that are supported, see .

bb172588 D3DPRESENT_INTERVAL PresentationInterval D3DPRESENT_INTERVAL PresentationInterval
Initializes a new instance of the struct. Width of the back buffer. Height of the back buffer. Initializes a new instance of the struct. Width of the back buffer. Height of the back buffer. The back buffer format. The back buffer count. Type of the multi sample. The multi sample quality. The swap effect. The device window handle. if set to true [windowed]. if set to true [enable auto depth stencil]. The auto depth stencil format. The present flags. The full screen refresh rate in Hz. The presentation interval. Init this structure to defaults

Describes the raster status.

bb172596 D3DRASTER_STATUS D3DRASTER_STATUS

TRUE if the raster is in the vertical blank period. if the raster is not in the vertical blank period.

bb172596 BOOL InVBlank BOOL InVBlank

If InVBlank is , then this value is an integer roughly corresponding to the current scan line painted by the raster. Scan lines are numbered in the same way as Direct3D surface coordinates: 0 is the top of the primary surface, extending to the value (height of the surface - 1) at the bottom of the display.

If InVBlank is TRUE, then this value is set to zero and can be ignored.

bb172596 unsigned int ScanLine unsigned int ScanLine

Describes a rectangular high-order patch.

The following diagram identifies the parameters that specify a rectangle patch.

Each of the vertices in the vertex buffer is shown as a black dot. In this case, the vertex buffer has 20 vertices in it, 16 of which are in the rectangle patch. The stride is the number of vertices in the width of the vertex buffer, in this case five. The x offset to the first vertex is called the StartIndexVertexWidth and is in this case 1. The y offset to the first patch vertex is called the StartIndexVertexHeight and is in this case 0.

To render a stream of individual rectangular patches (non-mosaic), you should interpret your geometry as a long narrow (1 x N) rectangular patch. The structure for such a strip (cubic B?zier) would be set up in the following manner.

  RectInfo; RectInfo.Width = 4;	
            RectInfo.Height = 4;	
            RectInfo.Stride = 4;	
            RectInfo.Basis = ;	
            RectInfo.Order = D3DORDER_CUBIC;	
            RectInfo.StartVertexOffsetWidth = 0;	
            RectInfo.StartVertexOffsetHeight = 4*i;  // The variable i is the index of the 	
            //   patch you want to render.	
            
bb172598 D3DRECTPATCH_INFO D3DRECTPATCH_INFO

Starting vertex offset width, in number of vertices.

bb172598 unsigned int StartVertexOffsetWidth unsigned int StartVertexOffsetWidth

Starting vertex offset height, in number of vertices.

bb172598 unsigned int StartVertexOffsetHeight unsigned int StartVertexOffsetHeight

Width of each vertex, in number of vertices.

bb172598 unsigned int Width unsigned int Width

Height of each vertex, in number of vertices.

bb172598 unsigned int Height unsigned int Height

Width of the imaginary two-dimensional vertex array, which occupies the same space as the vertex buffer. For an example, see the diagram below.

bb172598 unsigned int Stride unsigned int Stride

Member of the enumerated type, defining the basis type for the rectangular high-order patch.

ValueOrder supportedWidth and height
Linear, cubic, and quinticWidth = height = (DWORD)order + 1
Linear, cubic, and quinticWidth = height > (DWORD)order
D3DBASIS_INTERPOLATECubicWidth = height > (DWORD)order

?

bb172598 D3DBASISTYPE Basis D3DBASISTYPE Basis

Member of the enumerated type, defining the degree for the rectangular patch.

bb172598 D3DDEGREETYPE Degree D3DDEGREETYPE Degree

Describes an off-screen render target used by an instance of .

This method is used to return the creation parameters used when creating an object.

bb205425 D3DXRTE_DESC D3DXRTE_DESC
No documentation. bb205425 unsigned int Size unsigned int Size No documentation. bb205425 unsigned int MipLevels unsigned int MipLevels No documentation. bb205425 D3DFORMAT Format D3DFORMAT Format No documentation. bb205425 BOOL DepthStencil BOOL DepthStencil No documentation. bb205425 D3DFORMAT DepthStencilFormat D3DFORMAT DepthStencilFormat

Describes a render surface.

bb205426 D3DXRTS_DESC D3DXRTS_DESC

Width of the render surface, in pixels.

bb205426 unsigned int Width unsigned int Width

Height of the render surface, in pixels.

bb205426 unsigned int Height unsigned int Height

Member of the enumerated type, describing the pixel format of the render surface.

bb205426 D3DFORMAT Format D3DFORMAT Format

If TRUE, the render surface supports a depth-stencil surface; otherwise this member is set to .

bb205426 BOOL DepthStencil BOOL DepthStencil

If DepthStencil is set to TRUE, this parameter is a member of the enumerated type, describing the depth-stencil format of the render surface.

bb205426 D3DFORMAT DepthStencilFormat D3DFORMAT DepthStencilFormat
No documentation. bb280347 D3DDEVINFO_RESOURCEMANAGER D3DDEVINFO_RESOURCEMANAGER No documentation. bb280347 D3DRESOURCESTATS stats[8] D3DRESOURCESTATS stats

Resource statistics gathered by the D3DDEVINFO_ResourceManager when using the asynchronous query mechanism.

bb172600 D3DRESOURCESTATS D3DRESOURCESTATS
No documentation. bb172600 BOOL bThrashing BOOL bThrashing No documentation. bb172600 unsigned int ApproxBytesDownloaded unsigned int ApproxBytesDownloaded No documentation. bb172600 unsigned int NumEvicts unsigned int NumEvicts No documentation. bb172600 unsigned int NumVidCreates unsigned int NumVidCreates No documentation. bb172600 unsigned int LastPri unsigned int LastPri No documentation. bb172600 unsigned int NumUsed unsigned int NumUsed No documentation. bb172600 unsigned int NumUsedInVidMem unsigned int NumUsedInVidMem No documentation. bb172600 unsigned int WorkingSet unsigned int WorkingSet No documentation. bb172600 unsigned int WorkingSetBytes unsigned int WorkingSetBytes No documentation. bb172600 unsigned int TotalManaged unsigned int TotalManaged No documentation. bb172600 unsigned int TotalBytes unsigned int TotalBytes No documentation. bb280307 D3DXKEY_QUATERNION D3DXKEY_QUATERNION No documentation. bb280307 float Time float Time No documentation. bb280307 D3DXQUATERNION Value D3DXQUATERNION Value

Describes a vector key for use in key frame animation. It specifies a vector at a given time. This is used for scale and translation keys.

bb172889 D3DXKEY_VECTOR3 D3DXKEY_VECTOR3

Key frame time stamp.

bb172889 float Time float Time

3D vector that supplies scale and/or translation values.

bb172889 D3DXVECTOR3 Value D3DXVECTOR3 Value
No documentation. bb205439 D3DXSHADER_CONSTANTINFO D3DXSHADER_CONSTANTINFO

Offset from the beginning of this structure, in bytes, to the string that contains the constant information.

bb205439 unsigned int Name unsigned int Name

Register set. See .

bb205439 unsigned short RegisterSet unsigned short RegisterSet

The register index.

bb205439 unsigned short RegisterIndex unsigned short RegisterIndex

Number of registers.

bb205439 unsigned short RegisterCount unsigned short RegisterCount

Reserved.

bb205439 unsigned short Reserved unsigned short Reserved

Offset from the beginning of this structure, in bytes, to the string that contains the D3DXSHADER_TYPEINFO information.

bb205439 unsigned int TypeInfo unsigned int TypeInfo

Offset from the beginning of this structure, in bytes, to the string that contains the default value.

bb205439 unsigned int DefaultValue unsigned int DefaultValue

Helper structure for managing a shader constant table. This can also be done using .

Shader constant information is included in a tab-delimited table of comments. All offsets are measured in bytes from the beginning of the structure. Entries in the constant table are sorted by Creator in ascending order.

A shader constant table can be managed with the interfaces. Alternatively, you can manage the constant table with .

This size member is often initialized using the following:

  constantTable;	
            constantTable.Size = sizeof()	
            
bb205440 D3DXSHADER_CONSTANTTABLE D3DXSHADER_CONSTANTTABLE
No documentation. bb205440 unsigned int Size unsigned int Size No documentation. bb205440 unsigned int Creator unsigned int Creator No documentation. bb205440 unsigned int Version unsigned int Version No documentation. bb205440 unsigned int Constants unsigned int Constants No documentation. bb205440 unsigned int ConstantInfo unsigned int ConstantInfo No documentation. bb205440 unsigned int Flags unsigned int Flags No documentation. bb205440 unsigned int Target unsigned int Target

Semantics map a parameter to vertex or pixel shader registers. They can also be optional descriptive strings attached to non-register parameters.

Semantics are required for vertex and pixel shader, input and output registers.

bb205437 D3DXSEMANTIC D3DXSEMANTIC

Options that identify how resources are used. See .

bb205437 D3DDECLUSAGE Usage D3DDECLUSAGE Usage

Options that modify how the usage is interpreted. The usage and usage index make up a vertex declaration. See Vertex Declaration (Direct3D 9).

bb205437 unsigned int UsageIndex unsigned int UsageIndex

Percent of time processing shader data.

For best performance, a balanced load is recommended.

bb172543 D3DDEVINFO_D3D9STAGETIMINGS D3DDEVINFO_D3D9STAGETIMINGS

Percent of time in shader spent on memory accesses.

bb172543 float MemoryProcessingPercent float MemoryProcessingPercent

Percent of time processing (moving data around in registers or doing mathematical operations).

bb172543 float ComputationProcessingPercent float ComputationProcessingPercent

Describes a surface.

bb172611 D3DSURFACE_DESC D3DSURFACE_DESC

Member of the enumerated type, describing the surface format.

bb172611 D3DFORMAT Format D3DFORMAT Format

Member of the enumerated type, identifying this resource as a surface.

bb172611 D3DRESOURCETYPE Type D3DRESOURCETYPE Type

Either the or values. For more information, see .

bb172611 D3DUSAGE Usage D3DUSAGE Usage

Member of the enumerated type, specifying the class of memory allocated for this surface.

bb172611 D3DPOOL Pool D3DPOOL Pool

Member of the enumerated type, specifying the levels of full-scene multisampling supported by the surface.

bb172611 D3DMULTISAMPLE_TYPE MultiSampleType D3DMULTISAMPLE_TYPE MultiSampleType

Quality level. The valid range is between zero and one less than the level returned by pQualityLevels used by CheckDeviceMultiSampleType. Passing a larger value returns the error, . The MultisampleQuality values of paired render targets, depth stencil surfaces and the MultiSample type must all match.

bb172611 unsigned int MultiSampleQuality unsigned int MultiSampleQuality

Width of the surface, in pixels.

bb172611 unsigned int Width unsigned int Width

Height of the surface, in pixels.

bb172611 unsigned int Height unsigned int Height

Describes a technique used by an effect.

Some video cards can render two textures in a single pass. However, if a card does not have this capability, it is often possible to render the same effect in two passes, using one texture for each pass.

bb205468 D3DXTECHNIQUE_DESC D3DXTECHNIQUE_DESC

String that contains the technique name.

bb205468 const char* Name char Name

Number of rendering passes the technique requires. See Remarks.

bb205468 unsigned int Passes unsigned int Passes

The number of annotations. See Add Information to Effect Parameters with_Annotations.

bb205468 unsigned int Annotations unsigned int Annotations

Describes an animation track and specifies blending weight, speed, and position for the track at a given time.

Tracks with the same priority are blended together, and the two resulting values are then blended using the priority blend factor. A track must have an animation set (stored separately) associated with it.

bb205474 D3DXTRACK_DESC D3DXTRACK_DESC

Priority type, as defined in .

bb205474 D3DXPRIORITY_TYPE Priority D3DXPRIORITY_TYPE Priority

Weight value. The weight determines the proportion of this track to blend with other tracks.

bb205474 float Weight float Weight

Speed value. This is used similarly to a multiplier to scale the period of the track.

bb205474 float Speed float Speed

Time position of the track, in the local timeframe of its current animation set.

bb205474 double Position double Position

Track enable/disable. To enable, set to TRUE. To disable, set to .

bb205474 BOOL Enable BOOL Enable

Describes a triangular high-order patch.

For example, the following diagram identifies the vertex order and segment numbers for a cubic B?zier triangle patch. The vertex order determines the segment numbers used by DrawTriPatch. The offset is the number of bytes to the first triangle patch vertex in the vertex buffer.

bb172620 D3DTRIPATCH_INFO D3DTRIPATCH_INFO

Starting vertex offset, in number of vertices.

bb172620 unsigned int StartVertexOffset unsigned int StartVertexOffset

Number of vertices.

bb172620 unsigned int NumVertices unsigned int NumVertices

Member of the enumerated type, which defines the basis type for the triangular high-order patch. The only valid value for this member is .

bb172620 D3DBASISTYPE Basis D3DBASISTYPE Basis

Member of the enumerated type, defining the degree type for the triangular high-order patch.

ValueNumber of vertices
10
3
N/A
21

?

N/A - Not available. Not supported.

bb172620 D3DDEGREETYPE Degree D3DDEGREETYPE Degree

DirectX 8.1 and later versions only.

The structure describes vertex-cache information of a device.

DirectX 8.1 versions only. The Direct3D runtime calls a driver's D3dGetDriverState function to obtain vertex-cache information from the driver. In this D3dGetDriverState call, the runtime specifies the D3DDEVINFOID_VCACHE flag in the dwFlags member of the DD_GETDRIVERSTATEDATA structure that the runtime passes. The driver specifies vertex-cache information in a structure and returns it at the lpdwStates member of DD_GETDRIVERSTATEDATA.

DirectX 9.0 and later versions only. The Direct3D runtime specifies D3DDP2OP_CREATEQUERY and D3DDP2OP_ISSUEQUERY commands in calls to the driver's D3dDrawPrimitives2 callback to create driver-side resources for the query and then to asynchronously query the driver for vertex-cache information. In the call with the D3DDP2OP_CREATEQUERY command, the runtime specifies the query type in the QueryType member of the D3DHAL_DP2CREATEQUERY structure.

When the driver completes a vertex-cache query, the driver sets the total size of the response buffer in the dwErrorOffset member of the D3DHAL_DRAWPRIMITIVES2DATA structure and sets the ddrval member of D3DHAL_DRAWPRIMITIVES2DATA to for successful completion. The driver also overwrites the incoming command buffer with the outgoing response buffer. This response buffer contains a D3DHAL_DP2RESPONSEQUERY structure that identifies a response for the vertex-cache query. This D3DHAL_DP2RESPONSEQUERY is followed by the vertex-cache data in the structure.

ff544702 D3DDEVINFO_VCACHE D3DDEVINFO_VCACHE

Specifies the bit pattern. The driver must specify the bit pattern as the CACH four-character code (FOURCC) value. The driver can use the MAKEFOURCC macro as follows to specify the FOURCC value as CACH:

MAKEFOURCC('C', 'A', 'C', 'H');
ff544702 unsigned int Pattern unsigned int Pattern

Specifies the method of mesh optimization. The driver can use one of the following values to specify the mesh optimization that it uses:

ValueMeaning

(0)

Longest strips optimization

D3DXMESHOPT_VCACHE (1)

Vertex-cache based optimization

?

ff544702 unsigned int OptMethod unsigned int OptMethod

Specifies the effective size, in entries, for which the driver optimizes the vertex cache. The actual cache size is not required to be the size specified in CacheSize because in most cases the actual cache size turns out to be larger. The driver only specifies an optimized size in CacheSize if it also specifies D3DXMESHOPT_VCACHE in the OptMethod member.

ff544702 unsigned int CacheSize unsigned int CacheSize

Specifies the number that should be used as part of a trial-and-error procedure when determining when to restart the strips list. This number can be set from 1 to the value in the CacheSize member. Typically, the best values are near CacheSize/2.

ff544702 unsigned int MagicNumber unsigned int MagicNumber

Describes a vertex buffer.

bb172629 D3DVERTEXBUFFER_DESC D3DVERTEXBUFFER_DESC

Member of the enumerated type, describing the surface format of the vertex buffer data.

bb172629 D3DFORMAT Format D3DFORMAT Format

Member of the enumerated type, identifying this resource as a vertex buffer.

bb172629 D3DRESOURCETYPE Type D3DRESOURCETYPE Type

Combination of one or more flags.

bb172629 D3DUSAGE Usage D3DUSAGE Usage

Member of the enumerated type, specifying the class of memory allocated for this vertex buffer.

bb172629 D3DPOOL Pool D3DPOOL Pool

Size of the vertex buffer, in bytes.

bb172629 unsigned int Size unsigned int Size

Combination of that describes the vertex format of the vertices in this buffer.

bb172629 D3DFVF FVF D3DFVF FVF

Defines the vertex data layout. Each vertex can contain one or more data types, and each data type is described by a vertex element.

Vertex data is defined using an array of structures. Use D3DDECL_END to declare the last element in the declaration.

bb172630 D3DVERTEXELEMENT9 D3DVERTEXELEMENT9

Stream number.

bb172630 unsigned short Stream unsigned short Stream

Offset from the beginning of the vertex data to the data associated with the particular data type.

bb172630 unsigned short Offset unsigned short Offset

The data type, specified as a . One of several predefined types that define the data size. Some methods have an implied type.

bb172630 D3DDECLTYPE Type D3DDECLTYPE Type

The method specifies the tessellator processing, which determines how the tessellator interprets (or operates on) the vertex data. For more information, see .

bb172630 D3DDECLMETHOD Method D3DDECLMETHOD Method

Defines what the data will be used for; that is, the interoperability between vertex data layouts and vertex shaders. Each usage acts to bind a vertex declaration to a vertex shader. In some cases, they have a special interpretation. For example, an element that specifies or is used by the N-patch tessellator to set up tessellation. See for a list of the available semantics. can be used for user-defined fields (which don't have an existing usage defined).

bb172630 D3DDECLUSAGE Usage D3DDECLUSAGE Usage

Modifies the usage data to allow the user to specify multiple usage types.

bb172630 unsigned char UsageIndex unsigned char UsageIndex
Used for closing a VertexElement declaration. Initializes the struct. Initializes a new instance of the struct. The stream. The offset. The type. The method. The usage. Index of the usage.

Vertex shader caps.

bb172635 D3DVSHADERCAPS2_0 D3DVSHADERCAPS2_0

Instruction predication is supported if this value is nonzero. See setp_comp - vs.

bb172635 D3DVS20CAPS Caps D3DVS20CAPS Caps

Either 0 or 24, which represents the depth of the dynamic flow control instruction nesting. See .

bb172635 int DynamicFlowControlDepth int DynamicFlowControlDepth

The number of temporary registers supported. See .

bb172635 int NumTemps int NumTemps

The depth of nesting of the loop - vs/rep - vs and call - vs/callnz bool - vs instructions. See .

bb172635 int StaticFlowControlDepth int StaticFlowControlDepth

Reports the number of triangles that have been processed and clipped by the runtime's software vertex processing.

Use the debug runtime and software vertex processing to get the number of non-clipped and clipped primitives for a particular scene. Primitives will typically be clipped based on a guard band (if one is present). The clipping guard band is set with parameters such as GuardBandLeft in .

bb172544 D3DDEVINFO_D3DVERTEXSTATS D3DDEVINFO_D3DVERTEXSTATS

Total number of triangles that are not clipped in this frame.

bb172544 unsigned int NumRenderedTriangles unsigned int NumRenderedTriangles

Number of new triangles generated by clipping.

bb172544 unsigned int NumExtraClippingTriangles unsigned int NumExtraClippingTriangles

Describes a volume.

bb172633 D3DVOLUME_DESC D3DVOLUME_DESC

Member of the enumerated type, describing the surface format of the volume.

bb172633 D3DFORMAT Format D3DFORMAT Format

Member of the enumerated type, identifying this resource as a volume.

bb172633 D3DRESOURCETYPE Type D3DRESOURCETYPE Type

Currently not used. Always returned as 0.

bb172633 D3DUSAGE Usage D3DUSAGE Usage

Member of the enumerated type, specifying the class of memory allocated for this volume.

bb172633 D3DPOOL Pool D3DPOOL Pool

Width of the volume, in pixels.

bb172633 unsigned int Width unsigned int Width

Height of the volume, in pixels.

bb172633 unsigned int Height unsigned int Height

Depth of the volume, in pixels.

bb172633 unsigned int Depth unsigned int Depth

Specifies tolerance values for each vertex component when comparing vertices to determine if they are similar enough to be welded together.

The LPD3DXWELDEPSILONS type is defined as a reference to the structure.

 typedef  *LPD3DXWELDEPSILONS;	
            
bb205560 D3DXWELDEPSILONS D3DXWELDEPSILONS

Position

bb205560 float Position float Position

Blend weight

bb205560 float BlendWeights float BlendWeights

Normal

bb205560 float Normal float Normal

Point size value

bb205560 float PSize float PSize

Specular lighting value

bb205560 float Specular float Specular

Diffuse lighting value

bb205560 float Diffuse float Diffuse

Eight texture coordinates

bb205560 float Texcoord[8] float Texcoord

Tangent

bb205560 float Tangent float Tangent

Binormal

bb205560 float Binormal float Binormal

Tessellation factor

bb205560 float TessFactor float TessFactor

Identifies compressed key frame animation data.

bb174824 XFILECOMPRESSEDANIMATIONSET XFILECOMPRESSEDANIMATIONSET

Total size, in bytes, of the compressed data in the compressed key frame animation data buffer.

bb174824 unsigned int CompressedBlockSize unsigned int CompressedBlockSize

Number of animation key frame ticks that occur per second.

bb174824 float TicksPerSec float TicksPerSec

Type of the animation set playback loop. See .

bb174824 unsigned int PlaybackType unsigned int PlaybackType

Minimum buffer size, in bytes, required to hold compressed key frame animation data. Value is equal to ( ( CompressedBlockSize + 3 ) / 4 ).

bb174824 unsigned int BufferLength unsigned int BufferLength
Shadow callback for . Return a pointer to the unmanaged version of this callback. The callback. A pointer to a shadow c++ callback Internal Include Callback A user-implemented method for opening and reading the contents of a shader #include file. This pointer A -typed value that indicates the location of the #include file. Name of the #include file. Pointer to the container that includes the #include file. Pointer to the buffer that Open returns that contains the include directives. This pointer remains valid until is called. Pointer to the number of bytes that Open returns in ppData. The user-implemented method should return S_OK. If Open fails when reading the #include file, the application programming interface (API) that caused Open to be called fails. This failure can occur in one of the following situations:The high-level shader language (HLSL) shader fails one of the D3D10CompileShader*** functions.The effect fails one of the D3D10CreateEffect*** functions. HRESULT Open([None] D3D_INCLUDE_TYPE IncludeType,[None] const char* pFileName,[None] LPCVOID pParentData,[None] LPCVOID* ppData,[None] UINT* pBytes) A user-implemented method for closing a shader #include file. If was successful, Close is guaranteed to be called before the API using the interface returns. This pointer Pointer to the buffer that contains the include directives. This is the pointer that was returned by the corresponding call. The user-implemented Close method should return S_OK. If Close fails when it closes the #include file, the application programming interface (API) that caused Close to be called fails. This failure can occur in one of the following situations:The high-level shader language (HLSL) shader fails one of the D3D10CompileShader*** functions.The effect fails one of the D3D10CreateEffect*** functions. HRESULT Close([None] LPCVOID pData) Internal class used to initialize this assembly. Initializes this assembly. This method is called when the assembly is loaded. The namespace provides a managed Direct3D9 API. bb219837 Direct3D9 Direct3D9 The PaletteEntry struct contains the color and usage of an entry in a logical palette. PALETTEENTRY The red intensity value for the palette entry. The green intensity value for the palette entry. The blue intensity value for the palette entry. Indicates how the palette entry is to be used. TODO define an enum for flags Represents the compiled bytecode of a shader or effect. Blob Initializes a new instance of the class. A containing the compiled bytecode. Initializes a new instance of the class. A containing the compiled bytecode. Initializes a new instance of the class. The buffer. Initializes a new instance of the class. a pointer to a compiler bytecode size of the bytecode Initializes a new instance of the class. The BLOB. Gets the buffer pointer. Gets or sets the size of the buffer. The size of the buffer. Gets the shader constant table. HRESULT D3DXGetShaderConstantTable([In] const void* pFunction,[In] ID3DXConstantTable** ppConstantTable) Gets the version of the shader. unsigned int D3DXGetShaderVersion([In] const void* pFunction) Gets the size of the shader from a function pointer. The shader function pointer. Size of the shader Assembles a shader from the given source data. The source shader data. Compilation options. A object representing the raw shader stream. HRESULT D3DXAssembleShader([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs) Assembles a shader from the given source data. The source shader data. Compilation options. A object representing the raw shader stream. HRESULT D3DXAssembleShader([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs) Assembles a shader from the given source data. The source shader data. Macro definitions. An interface to use for handling #include directives. Compilation options. A object representing the raw shader stream. HRESULT D3DXAssembleShader([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs) Assembles a shader from the given source data. The source shader data. Macro definitions. An interface to use for handling #include directives. Compilation options. A object representing the raw shader stream. HRESULT D3DXAssembleShader([In] const void* pSrcData,[In] unsigned int SrcDataLen,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs) Assembles a shader from file. Name of the shader file. Compilation options. A object representing the raw shader stream. Assembles a shader from file. Name of the shader file. Macro definitions. An interface to use for handling #include directives. Compilation options. A object representing the raw shader stream. Compiles the provided shader or effect source. A string containing the source of the shader or effect to compile. The shader target or set of shader features to compile against. Shader compilation options. The compiled shader bytecode, or null if the method fails. HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) Compiles the provided shader or effect source. An array of bytes containing the raw source of the shader or effect to compile. The shader target or set of shader features to compile against. Shader compilation options. The compiled shader bytecode, or null if the method fails. HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) Compiles the provided shader or effect source. A string containing the source of the shader or effect to compile. The name of the shader entry-point function, or null for an effect file. The shader target or set of shader features to compile against. Shader compilation options. The compiled shader bytecode, or null if the method fails. HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) Compiles the provided shader or effect source. An array of bytes containing the raw source of the shader or effect to compile. The name of the shader entry-point function, or null for an effect file. The shader target or set of shader features to compile against. Shader compilation options. The compiled shader bytecode, or null if the method fails. HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) Compiles the provided shader or effect source. A string containing the source of the shader or effect to compile. The shader target or set of shader features to compile against. Shader compilation options. A set of macros to define during compilation. An interface for handling include files. The compiled shader bytecode, or null if the method fails. HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) Compiles the provided shader or effect source. An array of bytes containing the raw source of the shader or effect to compile. The shader target or set of shader features to compile against. Shader compilation options. A set of macros to define during compilation. An interface for handling include files. The compiled shader bytecode, or null if the method fails. HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) Compiles the provided shader or effect source. A string containing the source of the shader or effect to compile. The name of the shader entry-point function, or null for an effect file. The shader target or set of shader features to compile against. Shader compilation options. A set of macros to define during compilation. An interface for handling include files. The compiled shader bytecode, or null if the method fails. HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) Compiles a shader or effect from a file on disk. The name of the source file to compile. The shader target or set of shader features to compile against. Shader compilation options. A set of macros to define during compilation. An interface for handling include files. The compiled shader bytecode, or null if the method fails. HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) Compiles a shader or effect from a file on disk. The name of the source file to compile. The name of the shader entry-point function, or null for an effect file. The shader target or set of shader features to compile against. Shader compilation options. A set of macros to define during compilation. An interface for handling include files. The compiled shader bytecode, or null if the method fails. HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) Compiles the provided shader or effect source. An array of bytes containing the raw source of the shader or effect to compile. The name of the shader entry-point function, or null for an effect file. The shader target or set of shader features to compile against. Shader compilation options. A set of macros to define during compilation. An interface for handling include files. The compiled shader bytecode, or null if the method fails. HRESULT D3DXCompileShader([In] const char* pSrcData,[In] unsigned int SrcDataLen,[In] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] const char* pFunctionName,[In] const char* pProfile,[In] unsigned int Flags,[In] ID3DXBuffer** ppShader,[In] ID3DXBuffer** ppErrorMsgs,[In] ID3DXConstantTable** ppConstantTable) Disassembles compiled HLSL code back into textual source. The textual source of the shader or effect. HRESULT D3DXDisassembleShader([In] const void* pShader,[In] BOOL EnableColorCode,[In] const char* pComments,[In] ID3DXBuffer** ppDisassembly) Disassembles compiled HLSL code back into textual source. if set to true [enable color code]. The textual source of the shader or effect. HRESULT D3DXDisassembleShader([In] const void* pShader,[In] BOOL EnableColorCode,[In] const char* pComments,[In] ID3DXBuffer** ppDisassembly) Disassembles compiled HLSL code back into textual source. if set to true [enable color code]. Commenting information to embed in the disassembly. The textual source of the shader or effect. HRESULT D3DXDisassembleShader([In] const void* pShader,[In] BOOL EnableColorCode,[In] const char* pComments,[In] ID3DXBuffer** ppDisassembly) Searches through the shader for the specified comment. A FOURCC code used to identify the comment. The comment data. HRESULT D3DXFindShaderComment([In] const void* pFunction,[In] unsigned int FourCC,[Out] const void** ppData,[Out] unsigned int* pSizeInBytes) Gets the set of semantics for shader inputs. The set of semantics for shader inputs. HRESULT D3DXGetShaderInputSemantics([In] const void* pFunction,[In, Out, Buffer] D3DXSEMANTIC* pSemantics,[InOut] unsigned int* pCount) Gets the set of semantics for shader outputs. The set of semantics for shader outputs. HRESULT D3DXGetShaderOutputSemantics([In] const void* pFunction,[In, Out, Buffer] D3DXSEMANTIC* pSemantics,[InOut] unsigned int* pCount) Gets the sampler names references in the shader. The set of referenced sampler names. HRESULT D3DXGetShaderSamplers([In] const void* pFunction,[In] const char** pSamplers,[In] unsigned int* pCount) Extracts the major version component of a shader version number. The shader version number. The major version component. Extracts the minor version component of a shader version number. The shader version number. The minor version component. Converts a shader version number into a managed object. The shader version number. The parsed shader version information. Loads from the specified stream. The stream. A shader bytecode Saves to the specified file name. Name of the file. Saves this bytecode to the specified stream. The stream. Create a ShaderBytecode from a pointer. The pointer. Preprocesses the provided shader or effect source. A string containing the source of the shader or effect to preprocess. A set of macros to define during preprocessing. An interface for handling include files. The preprocessed shader source. HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) Preprocesses the provided shader or effect source. An array of bytes containing the raw source of the shader or effect to preprocess. A set of macros to define during preprocessing. An interface for handling include files. The preprocessed shader source. HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) Preprocesses the provided shader or effect source. An array of bytes containing the raw source of the shader or effect to preprocess. A set of macros to define during preprocessing. An interface for handling include files. When the method completes, contains a string of compilation errors, or an empty string if preprocessing succeeded. The preprocessed shader source. HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) Preprocesses the provided shader or effect source. The shader source PTR. Length of the shader source. A set of macros to define during preprocessing. An interface for handling include files. When the method completes, contains a string of compilation errors, or an empty string if preprocessing succeeded. The preprocessed shader source. HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) Preprocesses the provided shader or effect source. A string containing the source of the shader or effect to preprocess. A set of macros to define during preprocessing. An interface for handling include files. When the method completes, contains a string of compilation errors, or an empty string if preprocessing succeeded. The preprocessed shader source. HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) Preprocesses a shader or effect from a file on disk. The name of the source file to compile. The preprocessed shader source. HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) Preprocesses a shader or effect from a file on disk. The name of the source file to compile. A set of macros to define during preprocessing. An interface for handling include files. The preprocessed shader source. HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) Preprocesses a shader or effect from a file on disk. The name of the source file to compile. A set of macros to define during preprocessing. An interface for handling include files. When the method completes, contains a string of compilation errors, or an empty string if preprocessing succeeded. The preprocessed shader source. HRESULT D3DXPreprocessShader([In] const void* pSrcData,[In] unsigned int SrcDataSize,[In, Buffer] const D3DXMACRO* pDefines,[In] ID3DXInclude* pInclude,[In] ID3DXBuffer** ppShaderText,[In] ID3DXBuffer** ppErrorMsgs) Gets the raw data of the compiled bytecode. Read a compiled shader bytecode from a Stream and return a ShaderBytecode Read a compiled shader bytecode from a Stream and return a ShaderBytecode Width of the texture. Height of the texture. Format of the texture. Mip level count of the texture. Helper methods to create special . Calculates a specific TEXCOORDSIZEN . The size of the texcoord. The value must be in the range [1,4] (Number of floating point values) Index of the coord. The If size is not in the range [1,4] Contains requested texture creation parameters for volume textures. None The requested width of the texture, in pixels. The requested height of the texture, in pixels. The requested depth of the texture, in pixels. The requested surface format. The requested mip level count. Internal class to interact with Native Message