Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
A vertex buffer is described in terms of its capabilities: if it can exist only in system memory, if it is only used for write operations, and the type and number of vertices it can contain. All these traits are held in a D3DMVERTEXBUFFER_DESCstructure.
Vertex buffer descriptions tell your application how an existing buffer was created and if it has been optimized since being created. You provide an empty description structure for the system to fill with the capabilities of a previously created vertex buffer. For more information about this task, see Retrieving Vertex Buffer Descriptions.
The Formatmember is set to D3DMFMT_VERTEXDATA to indicate that this is a vertex buffer. The Typeidentifies the resource type of the vertex buffer. The Usagestructure member contains general capability flags (see D3DMUSAGE Values). The presence of the D3DMUSAGE_WRITEONLY flag in Usageindicates that the vertex buffer memory is used only for write operations. This frees the driver to place the vertex data in the best memory location to enable fast processing and rendering. If the D3DMUSAGE_WRITEONLY flag is not used, the driver is less likely to put the data in a location that is inefficient for read operations. This sacrifices some processing and rendering speed. If this flag is not specified, it is assumed that applications perform read and write operations on the data within the vertex buffer.
Poolspecifies the memory class that is allocated for the vertex buffer. The D3DPOOL_SYSTEMMEM flag indicates that the system created the vertex buffer in system memory.
The Sizemember simply stores the size, in bytes, of the vertex buffer data. The FVFmember contains a combination of flexible vertex format flags (see D3DMFVF Values) that identify the type of vertices that the buffer contains.