I need to get back a float[] of vertices which is stored in attrList in vbo in vao.
I do:
float[] b = new float[vertexCount];
glBindVertexArray(vaoId);
long pointer;
glEnableVertexAttribArray(0);
pointer = glGetVertexAttribPointer(0, GL_VERTEX_ATTRIB_ARRAY_POINTER);
glBindBuffer(GL_ARRAY_BUFFER, (int) pointer);
glGetBufferSubData(GL_ARRAY_BUFFER, 0, b);
All data in vaos and vbos is stored correctly, I can draw things perfectly.
The problem here is that variable pointer returns 0.
What am I doing wrong?
b[]around - but assuming you don't want to do that, look at:glMapBufferwith:GL_ARRAY_BUFFER, GL_READ_ONLY