Jump to content
  • Advertisement


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


Adding vertices to a D3DXMesh..

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

I am trying to extend my mesh class (remember my demo?), by giving the ability to add vertices to an already loaded mesh. I specify D3DXMESH_DYNAMIC for the mesh flags without MANAGED, so it can be correct. Here is my add vertex code: [cpp] void CRTStaticMesh::AddVertex(Vec3* vertex) { if (meshes.bProgressive) return; Vec3* vertices=NULL; //get the VB meshes.pMesh->GetVertexBuffer(&meshes.pVB); meshes.pVB->Lock(0, 0, (void**)&vertices, D3DLOCK_DISCARD); memcpy(vertices, vertex, sizeof(vertex)); meshes.pVB->Unlock(); SR(meshes.pVB); } [/cpp] Also, should I lock my VB with DISCARD or NOSYSLOCK? I am sure that there will be no disp mode changes, so whats the difference? Btw, the above code isnt adding the vertex, meaning I cannot see it rendered along with the other vertices. Whats wrong here? Thanks!

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!