Game Development Reference
In-Depth Information
other than zero, however, a non-zero value will allow you to bind multiple arrays at
once.
numBuffers describes the number of vertex buffers within the pointer passed to
ppVertexBuffers . You can pass in a chain of buffers if required, which will be
bound to sequential slots based on the values in pOffsets .
ppVertexBuffers is a pointer to an array of vertex buffers. In many cases you
won't need multiple vertex buffers to be bound at once, but if you do, put them all
together and point to the start of the array.
pStrides defines the size of each element for each buffer. This means that you
need to pass an array of values to pStrides , one for each of the buffers you are
setting.
pOffsets is similar, but, it defines the offset for each buffer. In this case, we are
defining the offset from the start of the buffer to the start of the vertices that need
to be rendered for each buffer (as opposed to an offset from the start of ppVer-
texBuffers to the actual buffer).
For the index buffer, use the following method:
void IASetIndexBuffer(ID3D11Buffer
*pIndexBuffer,
DXGI_FORMAT format,
UINT offset);
For an index buffer you can only pass one buffer, so we just need the pointer to the
buffer, as well as the format of each element and the offset to the start of the array
that we will use.
For reference the format of the elements can be as follows:
DXGI_FORMAT_R16_UINT
DXGI_FORMAT_R32_UINT
Rxx refers to the length of the unsigned integer, where xx can be 16 bits or 32 bits
depending on which integer you chose for your buffer.
Search WWH ::




Custom Search