D3DHAL_DRAWPRIMITIVES2DATA
This structure contains the information required by D3dDrawPrimitives2 to render primitives.
typedef struct _D3DHAL_DRAWPRIMITIVES2DATA {
ULONG_PTR dwhContext;
DWORD dwFlags;
DWORD dwVertexType;
PDD_SURFACE_LOCAL lpDDCommands;
DWORD dwCommandOffset;
DWORD dwCommandLength;
union
{
PDD_SURFACE_LOCAL lpDDVertex;
LPVOID lpVertices;
};
DWORD dwVertexOffset;
DWORD dwVertexLength;
DWORD dwReqVertexBufSize;
DWORD dwReqCommandBufSize;
LPDWORD lpdwRStates;
union
{
DWORD dwVertexSize;
HRESULT ddrval;
};
DWORD dwErrorOffset;
} D3DHAL_DRAWPRIMITIVES2DATA;
Members
dwhContext
Specifies the context handle of the Direct3D device.dwFlags
Specifies flags that provide additional instructions to the driver or provide information from the driver. This member can be a bitwise-OR of the following values.Value Description D3DHALDP2_EXECUTEBUFFER The command and vertex buffers were created in system memory. The driver should update the state array that lpdwRStates points to. This flag is set by Direct3D only. D3DHALDP2_REQCOMMANDBUFSIZE The driver must be able to increase the current command buffer by at least the size specified in dwReqCommandBufSize. Drivers that do not support multibuffering of command buffers can ignore this flag. This flag is set by Direct3D only. D3DHALDP2_REQVERTEXBUFSIZE The driver must be able to allocate a vertex buffer of at least the size specified in dwReqVertexBufSize. Drivers that do not support multibuffering of vertex buffers can ignore this flag. This flag is set by Direct3D only. D3DHALDP2_SWAPCOMMANDBUFFER The driver can swap the buffer that lpDDCommands points to with a new command buffer and return immediately, asynchronously processing the original buffer while Direct3D fills the new command buffer. Drivers that do not support multibuffering of command buffers can ignore this flag. This flag is set by Direct3D only. D3DHALDP2_SWAPVERTEXBUFFER The driver can swap the buffer that lpDDVertex or lpVertices points to with a new vertex buffer and return immediately, asynchronously processing the original buffer while Direct3D fills the new vertex buffer. Drivers that do not support multibuffering of vertex buffers can ignore this flag. This flag is set by Direct3D only. D3DHALDP2_USERMEMVERTICES The lpVertices member is valid so the driver should obtain the vertex data from the user-allocated memory that lpVertices points to. This flag is set by Direct3D only. D3DHALDP2_VIDMEMCOMMANDBUF The command buffer allocated by the driver as a swap buffer is not in system memory. This flag can be set by drivers that support multibuffering of command buffers. D3DHALDP2_VIDMEMVERTEXBUF The vertex buffer allocated by the driver as a swap buffer is not in system memory. This flag can be set by drivers that support multibuffering of vertex buffers. dwVertexType
Identifies the FVF (Flexible Vertex Format) of the data in the vertex buffer; that is, dwVertexType specifies which per-vertex data fields are present in the vertex buffer that lpDDVertex or lpVertices points to. This member can be a bitwise-OR of the values in the following table. Only one of the D3DFVF_TEXx flags will be set.Value Description D3DFVF_DIFFUSE Each vertex has a diffuse color. D3DFVF_SPECULAR Each vertex has a specular color. D3DFVF_TEX0 No texture coordinates are provided with the vertex data. D3DFVF_TEX1 Each vertex has one set of texture coordinates. D3DFVF_TEX2 Each vertex has two sets of texture coordinates. D3DFVF_TEX3 Each vertex has three sets of texture coordinates. D3DFVF_TEX4 Each vertex has four sets of texture coordinates. D3DFVF_TEX5 Each vertex has five sets of texture coordinates. D3DFVF_TEX6 Each vertex has six sets of texture coordinates. D3DFVF_TEX7 Each vertex has seven sets of texture coordinates. D3DFVF_TEX8 Each vertex has eight sets of texture coordinates. D3DFVF_XYZRHW Each vertex has x, y, z, and w coordinates. This flag is always set. lpDDCommands
Points to the DDRAWI_DDRAWSURFACE_LCL structure that identifies the DirectDraw surface containing the command data. The fpVidMem member of the embedded DDRAWI_DDRAWSURFACE_GBL structure points to the buffer that contains state change and primitive drawing commands for the driver to process. Specifically, this buffer contains one or more D3DHAL_DP2COMMAND structures, each followed by a D3DHAL_DP2XXX structure whose exact type is identified by D3DHAL_DP2COMMAND's bCommand member.dwCommandOffset
Specifies the number of bytes into the surface that lpDDCommands points to and where the command data starts.dwCommandLength
Specifies the number of bytes of valid command data in the surface that lpDDCommands points to starting at dwCommandOffset.lpDDVertex
Points to the DDRAWI_DDRAWSURFACE_LCL structure that identifies the DirectDraw surface containing the vertex data when the D3DHALDP2_USERMEMVERTICES flag is not set in dwFlags. Forms a union with lpVertices.lpVertices
Points to a user-mode memory block containing vertex data when the D3DHALDP2_USERMEMVERTICES flag is set in dwFlags.dwVertexOffset
Specifies the number of bytes into the surface pointed to by lpDDVertex or lpVertices where the vertex data starts.dwVertexLength
The number of vertices for which valid data exists in the surface pointed to by lpDDVertex (starting at dwVertexOffset). Note that dwVertexOffset is specified in bytes.dwReqVertexBufSize
Specifies the minimum number of bytes that the driver must allocate for the swap vertex buffer. This member is valid only when the D3DHALDP2_REQVERTEXBUFSIZE flag is set. Drivers that do not support multibuffering of vertex buffers should ignore this member.dwReqCommandBufSize
Specifies the minimum number of bytes that the driver must increase the swap command buffer by. This member is valid only when the D3DHALDP2_REQCOMMANDBUFSIZE flag is set. Drivers that do not support multibuffering of command buffers should ignore this member.lpdwRStates
Points to a render state array that the driver should update when it parses render state commands from the command buffer. The driver should update this array only when the D3DHALDP2_EXECUTEBUFFER flag is set in dwFlags. The driver should use the D3DRENDERSTATETYPE enumerated types to update the appropriate element of the render state array.dwVertexSize
Specifies the size of each vertex, in bytes. Forms a union with ddrval.ddrval
Specifies the location where the driver writes the return value of D3dDrawPrimitives2. D3D_OK indicates success. Otherwise, the driver should return the appropriate D3DERR_XXX error code.Value Description D3D_OK The operation completed successfully. D3DERR_COMMAND_UNPARSED The driver requires the Direct3D run-time to parse the execute buffer. dwErrorOffset
Specifies the location where the driver should write the offset into the surface that lpDDCommands points to where the first unhandled D3DHAL_DP2COMMAND can be found. The driver must set this value when it returns an error condition in ddrval.
Requirements
OS Versions: Windows CE .NET 4.0 and later.
Header: D3dhal.h.
See Also
FVF (Flexible Vertex Format) | DDRAWI_DDRAWSURFACE_LCL | DDRAWI_DDRAWSURFACE_GBL | D3DRENDERSTATETYPE | D3DHAL_DP2COMMAND | D3dDrawPrimitives2 | Structures Associated with Direct3D Callback Functions
Last updated on Tuesday, May 18, 2004
© 1992-2003 Microsoft Corporation. All rights reserved.