Advertisement Jump to content
Sign in to follow this  
ultim

no point sprites from VB

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

When I render point sprites from a vertex buffer, only one single sprite gets drawn. However, if I use almost the same code to render from an array (a user pointer), everything is fine. I'm using managed directx. Here's the code: verts = new CustomVertex.PositionColoredTextured[numNewParticles]; ...fill verts array with data... VB.SetData(verts, 0, LockFlags.Discard); // this works fine Device.SetStreamSource(0, VB, 0); Device.DrawUserPrimitives(PrimitiveType.PointList, numNewParticles, verts); // this only renders one particle Device.DrawPrimitives(PrimitiveType.PointList, 0, numNewParticles); What can possibly be the problem? Thanks for your help in advance

Share this post


Link to post
Share on other sites
Advertisement
update:

// this works fine
Device.DrawUserPrimitives(PrimitiveType.PointList, numNewParticles, verts);

// this only renders one particle
Device.SetStreamSource(0, VB, 0);
Device.DrawPrimitives(PrimitiveType.PointList, 0, numNewParticles);

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!