Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

yyh

How to Draw polygon index in Direct3D

This topic is 5735 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
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.

Share this post


Link to post
Share on other sites
Thanks ,How about DrawPrimitive,

because I need to render a BSP map in direct3D

the face is different in every frame.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!