Sign in to follow this  

changing vertex buffer size

This topic is 4108 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, i want to make a vertex buffer that will hold a single object,but then in real time when i add more from the same object ,i want that object also added to the end of the same vertex buffer,is there a chance to add it,if i give a size for only 1 object in d3d,then later i dont know how many more objects i will add. I mean its like an array,but its like a vector,not an int[100] array. I want to do the same thing with D3DVERTEXBUFFER ,is it possible? thank you very much.

Share this post


Link to post
Share on other sites
It's impossible to resize a vertex buffer once it is created without destroying it and creating it again with the new size (which would make you lose all the data in it).

What is usually done is that the buffer is made large enough to hold a lot of data, but only a part of it is used. If you need more room, you just use more of it. Obviously, theres a size limit to a vertex buffer, and if you reach it, you'll need to split it up into two buffers.

Hope this helps.

Share this post


Link to post
Share on other sites

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