Apparently, you can render a quad directly in d3d10< without using vertices and indices. The approach is:
"In order to render a full screen quad, you will need to set both index and vertex buffers to null. Set the topology to triangle strip and call Draw with four vertices starting from position zero."
device_context->IASetVertexBuffers(0, 1, nullptr, {???}, {0});
device_context->IASetIndexBuffer(nullptr, ???, 0);
device_context->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
device_context->Draw(4, 0);
What index format and stride size do you need to use?
Is it a good practice to use this approach for other "frequently" used meshes as well (such as a cube of lines for visualizing bounding boxes)?
↧