Above is the current issue with my code, I have to update certain VBOs realtime such as the UI so I use glBufferSubData. However after profiling the CPU, I found out that it takes a very long time
After some research I found that glBufferSubData also stalls the rendering until it’s completed the rendering
Below is my VertexBuffer class, I’m trying to resolve it. I heard that there’s something like glMapBufferRange (?) which helps but I have no idea how to use it
VertexBuffer.java
http://pastebin.com/ZMpJ6kjV
Example use of above is something like;
VertexBuffer vb = new VertexBuffer(3); // Init
// In a loop
vb.clear();
vb.addVertex(0, 1, 0, 0xFFFFFF, 0, 0);
vb.addVertex(0, 1, 1, 0xFFFFFF, 0, 1);
vb.addVertex(1, 1, 0, 0xFFFFFF, 1, 0);
vb.refresh();
drawVBO(vb);