PDA

View Full Version : How to correctly resize VBO



Cornix
09-23-2013, 01:44 PM
Hello,
if I wanted to resize a VBO (to make it bigger) how would I do it best?

What I currently do is:

glDeleteBuffers(vboId);
vboId = glGenBuffers();
glBindBuffer(GL15.GL_ARRAY_BUFFER, vboId);
glBufferData(GL15.GL_ARRAY_BUFFER, ..., GL_DYNAMIC_DRAW);
But could I do without the "glGenBuffers()"? Or even without the "glDeleteBuffers()"?
I am just not 100% sure and thats why I'd like to ask.

Thank you very much.

GClements
09-23-2013, 07:59 PM
But could I do without the "glGenBuffers()"? Or even without the "glDeleteBuffers()"?
You can re-use the name and just re-create the data store with glBufferData().

Cornix
09-24-2013, 06:38 AM
Thank you.
I was just not sure if there might be any other data on the graphics card which needs to be reset.