Re: glBufferData and glBufferSubData seems not to work
Posted by
Wade Walker on
Aug 19, 2011; 1:27pm
URL: https://forum.jogamp.org/glBufferData-and-glBufferSubData-seems-not-to-work-tp3267295p3268042.html
Problem solved! You just need to make your buffers native ordered. To do so, change:
// vertexPositions = ByteBuffer.allocateDirect(verticesSizeInBytes).asFloatBuffer();
vertexPositions = Buffers.newDirectFloatBuffer(verticesSize);
and
// indices = ByteBuffer.allocateDirect(indicesSizeInBytes).asShortBuffer();
indices = Buffers.newDirectShortBuffer(indicesSize);
When I make those two changes, I see two white squares on screen