I am trying to find what am I doing wrong in my code. I am using JOGL.
I'd like to make two VBOs, one for vertices, other for indices, inside a given object.
There is no error inside init(GLAutoDrawable glAutoDrawable) function, but display(GLAutoDrawable glAutoDrawable) does not show my object when running the program.
Where am I making a mistake? Thank you for help.
My code:
public class Test1 implements GLEventListener {
private int program;
IntBuffer vao = IntBuffer.allocate(1);
private IntBuffer buffers = IntBuffer.allocate(2);
private float[] vertices = {
-0.853250f, -0.136293f, -0.188932f,
-0.129650f, 0.416492f, 0.336788f,
-1.129635f, 0.416492f, 0.661708f,
-1.747674f, 0.416492f, -0.188932f,
-1.129635f, 0.416492f, -1.039572f,
-0.129650f, 0.416492f, -0.714652f,
-0.576865f, 1.310922f, 0.661708f,
-1.576849f, 1.310922f, 0.336788f,
-1.576849f, 1.310922f, -0.714652f,
-0.576865f, 1.310922f, -1.039572f,
0.041175f, 1.310922f, -0.188932f,
-0.853250f, 1.863707f, -0.188932f
};