How do i use Vertex Arrays in JOGL

Hello .
This may be a stupid beginner question but i coundn’t figure it out by myself:

I would like to use vertex arrays in JOGL, but how do i create the array?

This doesn’t work because java wants it to be a Buffer-type variable:



float vertices[] = {0.5f,0.5f,1.5f,1.5f,3.0f,3.0f,-0.2f,0.5f};
gl.glVertexPointer(2,GL.GL_FLOAT,0,vertices);


Thanks for help.

Please see the VertexArrayRange or VertexBufferObject demos in the jogl-demos project. The JOGL ports of the NeHe demos might also have some examples but I haven’t looked at them.

ok. thanks for the tip. It looks a lot more complicated than i thought… i hope i will manage it.

But thank you.