Skip to main content
gamedev.net
🔒 Locked

changing vertex buffer size

Started by blue-ice2002 Sep 15, 2006 at 11:51 AM 0 replies 600+ views
Original Post
blue-ice2002
blue-ice2002
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.
sirob
sirob
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.
Sirob Yes.» - status: Work-O-Rama.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.