Jump to content
  • Advertisement
Sign in to follow this  
blue-ice2002

vertex buffer in direct3d9

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

hello, im writing a tile engine in direct3d using transformed vertices,i mean i use 2d screen coordinates to construct diamond shaped tiles,from 2 triangles. My question is,i use a 4 vertice sized vertex buffer,and in the main loop i do this gamemain() { vertex transformed[4]; for(screeny<screenheight) for(screenx<screenwidth) { compute vertices and drawprimitive } } i mean i compute and create and lock and draw in a loop,but i dont create it before run-time.else should i create a big vertex buffer and create it at once? is there a performance problem with using drawprimitive in a loop for example 3000 times to draw each quad seperately? sincerely, B.T.

Share this post


Link to post
Share on other sites
Advertisement
It's not the most efficient way to do it, by far, but you should be able to do it without seeing ill effects. My first engine mostly did the same thing, and only ran into issues up closer to 10000 quads.

Generally speaking, you'd be better off:



lock
for...
for...
push verts onto buffer
}
}
unlock
draw


er, I think. It's early, and I'm sleepy.

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.

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!