Jump to content
  • Advertisement


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


problem with DrawIndexedPrimitive.

This topic is 5262 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 dynamic buffer that I use to stuff vertices into (for billboarding) each frame I copy a certain number of quads into the buffer. The buffer can hold about 10 times as much as i can stuff in. The problem is that suppose the buffer is now half full and i''m going to fill it up with some more vertex data similar situation for the index buffer ......it''s getting hard for me to explain, so i''m going to try to draw some ascii picture. Dynamic VB: suppose it can hold 10 vertices |---------------------------------| Dynamic IB: suppose it can hold 20 indices (for trianglelist) |------------------------------------------------------| now suppose each frame i want to copy a triangle to the VB and 3 indices into the IB, as I do this I obtain the offset from the base of these 2 buffers. for example my VB has been fill with 2 vertices and now I want to copy another 3 vertices into it which I then obtain the offset as 2. this is the code i setup to render

VertexType *tempvb = dvb->Lock( nVert, startvb );
.... copy vertices here

Indextype *tempib = dib->Lock( nTri*3, startib);

ge->GetDevice()->SetStreamSource(0, dvb->GetInterface(), sizeof(VertexType));

i''m pretty sure the problem is setting the minindex, base index etc... I not sure what the documentation said, as English is not my main language. Hope someone can help me with this. thanks.

Share this post

Link to post
Share on other sites
This paper (pdf) from GDC has a really nice diagram of what all the parameters mean precisely, on page 18.

Most of the greatest evils that man has inflicted upon man have come through people feeling quite certain about something which, in fact, was false.

-Bertrand Russell, Unpopular Essays, "Ideas That Have Harmed Mankind"

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!