Jump to content
  • Advertisement

Archived

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

kaos2000

coping vertex data to vertex vb in a loop

This topic is 5815 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 have a class hierarchy. (Object->frame->geometry->point) geometry has vertex information pos nor color etc.(DX3D vectors and floats) the point class constructor takes arguments for vertix quantity and pointers to d3dxvectors for vertex values. example: Vertex = new direct3dxvector3[vertex-Quantity]. the same for color value. the vertex size is already defined. My point is sense the geometry is not a seperate clsss or struct i have to do something like this when it comes to copying the Vertices to vb buffer. BYTE* pVertices; Result = pVertexBuffer->Lock(0,0,&pVertices,D3DLOCK_DISCARD); BYTE* pOffset = pVertices; for (int i = 0; i < vertex-Quantity; i++) { memcpy(pCurrentVertex,Vertex++,3*sizeof(float)); pOffset += VertexSize; } i got this idea from the zen of direct3d programing book but the book uses seperate class for vertex struct and a list with while loop; i cant get this approach to work one soul to use many lives to live! [edited by - kaos2000 on August 17, 2002 9:01:20 PM]

Share this post


Link to post
Share on other sites
Advertisement

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