That would do it as well! Been there, done that. And quite recently!
Solved. I blame this on 4 days of less than 3 hours of sleep per night. Ha.
When I draw, I was doing:
glDrawArrays(GL_TRIANGLES, 1, this.numVerts);
I step over the first degenerate vertex as I should. The problem was that, stupid me, this.numVerts was being calculated wrong..
I was doing:
this.numVerts = this.vbuffer.position() / 8;
this.numVerts = this.vbuffer.position() / 12;
You'll see my blocks hold 12 floats per vertex.
I suppose it's useful to know that if you tell glDrawArrays(GL_TRIANGLES, 1, x); where x is larger than the currently bound buffer, you can and will overrun it and spill over into surrounding memory.
Well, yes. This is no different than accessing an array out of bounds on a CPU. You'll successfully access the data outside of the array, but the result will not be what you expect.
I do stand by what I said about using glBufferSubData...
glBufferData creates a new data store for the buffer object currently bound to target. Any pre-existing data store is deleted. The new data store is created with the specified size in bytes and usage.
glBufferSubData redefines some or all of the data store for the buffer object currently bound to target. Data starting at byte offset offset and extending for size bytes is copied to the data store from the memory pointed to by data. An error is thrown if offset and size together define a range beyond the bounds of the buffer object's data store.
When replacing the entire data store, consider using glBufferSubData rather than completely recreating the data store with glBufferData. This avoids the cost of reallocating the data store.
You *can* use glBufferData, but you'll see a performance drop as it has to delete the data and then create a new data store. glBufferSubData works within the existing buffer's memory store and doesn't do any expensive memory allocation/management.