Platform SDK: DirectX

Retrieving Vertex Buffer Descriptions

[C++]

Applications often need to retrieve information about existing vertex buffers at run time. Direct3D makes this possible through the IDirect3DVertexBuffer7::GetVertexBufferDesc method. Call this method using the IDirect3DVertexBuffer7 interface of any vertex buffer to retrieve its current description.

The GetVertexBufferDesc method accepts only one parameter: the address of a properly initialized D3DVERTEXBUFFERDESC structure. To initialize the structure, set the dwSize member to the structure size, in bytes, and set the remaining members to 0. After the method returns, the structure will contain information about the vertex buffer capabilities, the vertex format in the buffer, and the total number of vertices that it can contain.

Note  Optimizing a vertex buffer sets the D3DVBCAPS_OPTIMIZED capability flag in the dwCaps member of the D3DVERTEXBUFFERDESC structure. If this flag is set, the vertex buffer cannot be locked. The contents of an optimized vertex buffer are not made available to anything but rendering methods and vertex buffer processing methods (IDirect3DVertexBuffer7::ProcessVertices and IDirect3DVertexBuffer7::ProcessVerticesStrided).

For general information, see Vertex Buffer Descriptions.

[Visual Basic]

Applications often need to retrieve information about existing vertex buffers at run time. Direct3D makes this possible for Visual Basic applications through the Direct3DVertexBuffer7.GetVertexBufferDesc method.

The GetVertexBufferDesc method accepts only one parameter: a properly variable of type D3DVERTEXBUFFERDESC. After the method returns, the structure will contain information about the vertex buffer capabilities, the vertex format in the buffer, and the total number of vertices that it can contain.

Note  Optimizing a vertex buffer sets the D3DVBCAPS_OPTIMIZED capability flag in the lCaps member of the D3DVERTEXBUFFERDESC type retrieved by GetVertexBufferDesc. If this flag is set, the vertex buffer cannot be locked. The contents of an optimized vertex buffer are not made available to anything but rendering methods and the Direct3DVertexBuffer7.ProcessVertices method.

For general information, see Vertex Buffer Descriptions.