Hey, real newbie to OpenGL so please bear with me.
I’m trying to make a checkered floor with data generated from the code. The generation part seems to be working, the vertex, index and color arrays all contain the correct data. However, when calling glDrawElements on them nothing appears. It is working for another object drawn in this method.
void drawFloor()
{
glShadeModel(GL_FLAT);
glPolygonMode(GL_FRONT, GL_FILL);
glPolygonMode(GL_BACK, GL_FILL);
glEnableClientState(GL_VERTEX_ARRAY);
glEnableClientState(GL_COLOR_ARRAY);
glColorPointer(3, GL_FLOAT, 0, colorsFloor);
glVertexPointer(3, GL_FLOAT, 0, verticesFloor);
glDrawElements(GL_QUADS, 16, GL_UNSIGNED_BYTE, indicesFloor);
glDisableClientState(GL_VERTEX_ARRAY);
glDisableClientState(GL_COLOR_ARRAY);
}
This is just a portion of the code, but it seems to be the only relevant part. If you need any more information please tell me.