Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: How to correctly resize VBO

  1. #1
    Intern Contributor
    Join Date
    Sep 2013
    Posts
    85

    How to correctly resize VBO

    Hello,
    if I wanted to resize a VBO (to make it bigger) how would I do it best?

    What I currently do is:
    Code :
    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.

  2. #2
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    491
    Quote Originally Posted by Cornix View Post
    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().

  3. #3
    Intern Contributor
    Join Date
    Sep 2013
    Posts
    85
    Thank you.
    I was just not sure if there might be any other data on the graphics card which needs to be reset.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •