How to Draw polygon index in Direct3D
Hi guys !!
I have a problem in D3D.
because my BSP engine is use this two function to draw polygon :
////////////////////////////////////////////////////////////
glBindTexture(GL_TEXTURE_2D, m_textures[pFace->textureID]);
glDrawArrays(GL_TRIANGLE_FAN, pFace->startVertIndex, pFace->numOfVerts);
////////////////////////////////////////////////////////////
But I want to how what function in Direct3D is same to this
thanks
DrawIndexedPrimitive(), except that you will need a vertex buffer and index buffer. Drawing faces one at a time is absolutely horrible for performance so you should group sets of faces into vertex/index buffers and make a single call per set. A given call should render atleast 200 triangles, optimally thousands on the latest hardware. Also lookup CreateVertexBuffer() and CreateIndexBuffer(). The docs explain this stuff pretty clearly.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement