PGraphicsOpenGL mainGL; // the main screenPGL pgl; // make raw GL calls here
mainGL = (PGraphicsOpenGL)g;pgl = mainGL.beginPGL();
int numVerts = 32;float[] verts = new float[numVerts*2]; //xyxyxyxyxyxyfor(int i = 0; i < verts.length; i++){verts[i] = random(512.0);}
FloatBuffer vertexBuffer = FloatBuffer.wrap(verts);
int[] vboIDs = new int[1];pgl.glGenBuffers(1, vboIDs, 0);pgl.glBindBuffer(pgl.GL_ARRAY_BUFFER, vboIDs[0]);pgl.glBufferData(pgl.GL_ARRAY_BUFFER, numVerts*2*4, vertexBuffer, pgl.GL_STATIC_DRAW);
pgl.glBindBuffer(pgl.GL_ARRAY_BUFFER, vboIDs[0]);pgl.glVertexAttribPointer(0, 2, pgl.GL_FLOAT, false, numVerts*2*4, 0);pgl.glEnableVertexAttribArray(0);
mainGL.endPGL();
/////
pgl.glVertexAttribPointer(0, 2, pgl.GL_FLOAT, false, numVerts*2*4, 0);
What am I passing as the first argument here? I'm only familiar with the old way, I don't know what shader program I an querying to get the location of the vertex attributes. I'm trying to make OpenCL aware of these GL objects and PShape is getting in the way. Thanks!
1