So my software is receiving an arbitrary amount of points over time that need to be visualized. The thing is i do not know in advance how many points there will be. My solution is to allocate empty VBOs of a fixed size, and copy the incoming points into the current VBO with calls to glBufferData. When a VBO fills up I allocate a new VBO and start filling it, and so on.
The problem I am having is when allocating an empty VBO, with a call like this:
glGenBuffers(1, &(entry.handle)); glBindBuffer(GL_ARRAY_BUFFER, entry.handle); glBufferData(GL_ARRAY_BUFFER, entry.size, NULL, usage); GLenum err = glCheckError(); if(err != GL_NO_ERROR) return false;
I am using interleaved arrays with a vertex of size 28 bytes, I tried letting my max VBO size to be 50k vertices, which is 1.4 mb each. After about the 5th VBO allocated like this, glBufferData fails with an invalid parameter message (from glGetError). The odd thing is if I allow the VBO max size to be 500k vertices, everything is fine, glBufferData never fails and everything renders fine.
Has anyone ever come across anything like this?
I would have thought glBufferData would have failed with a out of memory message if anything.