void IASetVertexBuffers( UINT StartSlot, UINT NumBuffers, ID3D11Buffer* const* ppVertexBuffers, const UINT* pStrides, const UINT* pOffsets );
// Binding a single vertex buffer ID3D11Buffer* pVertexBuffer = // Get a pointer to a vertex buffer UINT stride = // Set the stride value for the vertex buffer UINT offset = // Set the offset value for the vertex buffer pContext->IASetVertexBuffers(0, 1, &pVertexBuffer, &stride, &offset);
// Binding multiple vertex buffers with different strides and offsets ID3D11Buffer* pVertexBuffer1 = // Get a pointer to the first vertex buffer ID3D11Buffer* pVertexBuffer2 = // Get a pointer to the second vertex buffer UINT strides[] = {sizeof(Vertex1), sizeof(Vertex2)}; // Set different strides for each vertex buffer UINT offsets[] = {0, 0}; // Set different offsets for each vertex buffer ID3D11Buffer* pVertexBuffers[] = {pVertexBuffer1, pVertexBuffer2}; // Create an array of vertex buffers pContext->IASetVertexBuffers(0, 2, pVertexBuffers, strides, offsets);This code example binds two different vertex buffers, each with a different stride and offset, to the input-assembler stage. The IASetVertexBuffers method is part of the Direct3D 11 API package library.