Sign in to follow this  

vertex buffer in direct3d9

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

This topic is 4692 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this