Sign in to follow this  

Need help on LPD3DXMESH

This topic is 4106 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 everyone, here is my question: i am currently trying to get triangles information from LPD3DXMESH. i found a post told me how to do it, it involves a method called "mesh->GetNumBytesPerVertex()", but i get an error tells me that "GetNumBytesPerVertex" is not a member of LPD3DXMESH something like that. i am using direct3d8. i want to know if this method is available only in direct3d9? if so, what can i do to get the same result in direct3d8? thank you in advance.

Share this post


Link to post
Share on other sites
GetNumBytesPerVertex() is a DirectX 9 thing...

...if the vertices in your mesh can be represented with an FVF (i.e. you could use them with the fixed function pipeline if you wanted), then in DirectX 8 you can do:

DWORD fvf = mesh->GetFVF();
UINT vertexSize = D3DXGetFVFVertexSize( fvf );


If the vertices in your mesh use vertex declarations, you'll need to get the vertex declaration (mesh->GetDeclaration()) then walk through the declaration structure summing up the sizes for each element you encounter. This becomes less straightforward when you have multiple streams where each vertex may be split across multiple vertex buffers.


BTW: it's not too difficult to upgrade Direct3D 8 application to use Direct3D 9 which gives you access to these new mesh features, various bug fixes, various new core features, etc...

Share this post


Link to post
Share on other sites
Thaks for your nice help S1CA!!

i am using TV3D 6.2 engine. i tried to include d3d9 header files but i get many errors, but it is ok if i include d3d8 headers. does it means the engine wont support d3d9?
(From TV3D documentation: "Full DirectX8.1 and DirectX9 support")........

Share this post


Link to post
Share on other sites

This topic is 4106 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this