I have the following code in my test app and I can see a square as expected when I run. However when I enable the color array bits, my square disapears, has any got any idea why?
float[] lvColours = {0f, 1f, 0.5f, 1.0f, 0f, 1f, 0.5f, 1.0f, 0f, 1f, 0.5f, 1.0f, 0f, 1f, 0.5f, 1.0f};
float[] lvVertices = {-150f, -150f, -50f, -150f, 150f, -50f, 150f, 150f, -50f, 150f, -150f, -50f};
GL.glEnableClientState(GL.GL_VERTEX_ARRAY);
// GL.glEnableClientState(GL.GL_COLOR_ARRAY);
GL.glVertexPointer(3, GL.GL_FLOAT, 0, lvVertices);
// GL.glColorPointer (4, GL.GL_FLOAT, 0, lvColours);
GL.glDrawArrays(GL.GL_QUADS, 0, lvVertices.length / 3);
GL.glDisableClientState(GL.GL_VERTEX_ARRAY);
// GL.glDisableClientState(GL.GL_COLOR_ARRAY);
I read somewhere that the only valid value for the size parameter on the glColorPointer method is 4, but I have also tried it with the value of 3 and removed the alpha values from my colour array, but still nothing.
Thanks,
Andy.
PS: I have some nice wrapper classes that use a scratch buffer so that I can pass float[] to my methods rather than have the buffer conversions all over the place.
