Jump to content
  • Advertisement
Sign in to follow this  
Tispe

[DX9] D3DXCreateMeshFVF and the D3DFORMAT of IndexBuffer

This topic is 2513 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

From what I understand the D3DXCreateMeshFVF function creates a container for a mesh that includes both vertex and index buffers. However I can not SET the D3DFORMAT of the Index Buffer. I wish to know what the standard format for the Index Buffer is when using D3DXCreateMeshFVF. (I don't want to make my own class just yet).

How does D3DXCreateMeshFVF() wrap CreateIndexBuffer(), does it take NumFaces*3*"format" as the size of the IndexBuffer, what is the D3DFORMAT? Once a Mesh is made is it impossible to change the format, size etc of the buffers?

I can GetDesc() and cast my indices accordingly when I copy them over as a work around. But I'd rather know what happens behind the scenes so I can code without the extra lines of GetDesc().

Share this post


Link to post
Share on other sites
Advertisement
It uses 16-bit indices, unless you pass D3DXMESH_32BIT in the options parameter.

Share this post


Link to post
Share on other sites
You can use IDirect3DIndexBuffer9::GetDesc on any index buffer at any time to find it's format and other creation params.

Share this post


Link to post
Share on other sites

From what I understand the D3DXCreateMeshFVF function creates a container for a mesh that includes both vertex and index buffers. However I can not SET the D3DFORMAT of the Index Buffer. I wish to know what the standard format for the Index Buffer is when using D3DXCreateMeshFVF. (I don't want to make my own class just yet).
What MJP said - it's 16-bit unless you specify otherwise.


How does D3DXCreateMeshFVF() wrap CreateIndexBuffer(), does it take NumFaces*3*"format" as the size of the IndexBuffer, what is the D3DFORMAT? Once a Mesh is made is it impossible to change the format, size etc of the buffers?
Yes to both questions, where "format" is 2 by default, or 4 for D3DXMESH_32BIT.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!