I only started with openGL this weekend so my knowledge is quit a stretch...anyway Im reading OpenGL Programming Guide and have gotten to the function glDrawElements...from what I can tell the book says it is like writing
glBegin(mode);
for(int i=0; i<count; i++)
glArrayElement(indices[i]);
glEnd();
so I wrote this but it doesn't do anything...can anyone help..
void display()
{
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
GLubyte indices[] =
{
4, 5, 6, 7, 1, 2, 6, 5,
0, 1, 5, 4, 0, 3, 2, 1,
0, 4, 7, 3, 2, 3, 7, 6
};
glEnableClientState(GL_VERTEX_ARRAY); //specifies array to enable
glVertexPointer(4, GL_UNSIGNED_BYTE, 0, indices);
glDrawElements(GL_QUADS, 24, GL_UNSIGNED_BYTE, indices);
glFlush();
}
[edited by - dnagcat on March 10, 2003 1:49:29 AM]