We are about to switch to a new forum software. Until then we have removed the registration on this forum.
has anyone tried using VAOs in Processing?
I'm attempting to add a VAO to the Advanced OpenGL example from the Wiki, but I can't work out how to set it up.
My plan is to create and populate the VBOs and bind them to a VAO in setup(), then I just need to bind and draw the VAO in draw(), rather than having to bind the 3 VBOs individually before drawing. That's the plan, anyway.
So far, I've changed 'gl' to be an instance of the 'GL3', rather than 'GL2ES2' JOGL objects, as I think VAOs aren't part of the GL2ES2 spec.
gl = pgl.gl.getGL2ES2();
gl = pgl.gl.getGL3(); to match.
I've also generated an extra IntBuffer in setup()
vaoId = intBuffer.get(0);
posVboId = intBuffer.get(1);
colorVboId = intBuffer.get(2);
indexVboId = intBuffer.get(3);
as according to the the jogamp docs for GL3, the glGenVertexArrays() function requires an IntBuffer as its 2nd argument.
What I can't work out is what should be in the IntBuffer that's passed in, and how to get the data into it.
Apologies if this is a stupid question. I have a basic concept of what VAOs are for, but have never tried implementing them before.
Any tips or pointers gratefully accepted.