How to Draw polygon index in Direct3D

Started by
2 comments, last by yyh 21 years ago
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
Yee
Advertisement
Help !!!!
Yee
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.
Thanks ,How about DrawPrimitive,

because I need to render a BSP map in direct3D

the face is different in every frame.
Yee

This topic is closed to new replies.

Advertisement