![]() ![]() ID3D11Buffer *g_pIndexBuffer = NULL īufferDesc.ByteWidth = sizeof( unsigned int ) * 3 īufferDesc. ![]() Is a valid ID3D11Device object and that g_pd3dContext The following code example demonstrates how to create an index buffer. Call ID3D11Device::CreateBuffer while passing the D3D11_BUFFER_DESC structure, the D3D11_SUBRESOURCE_DATA structure, and the address of a pointer to the ID3D11Buffer interface to initialize.The pSysMem member should point directly to the index data created in step one. Create a subresource data description by filling in a D3D11_SUBRESOURCE_DATA structure.Now that we’ve drawn our first geometric shapes in Chapter 2, it’s time to step up the complexity a bit.While uploading our vertices to the GPU and rendering them all as a batch is a great solution for a single triangle, you will soon notice that as geometric complexity increases, so does the need for more efficient rendering methods. Pass the D3D11_BIND_INDEX_BUFFER flag to the BindFlags member and pass the size of the buffer in bytes to the ByteWidth member. Chapter 3: Index Buffer Objects and Primitive Types. Create a buffer description by filling in a D3D11_BUFFER_DESC structure. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |