I visit often this forum and learn alot about Opengl.
So I try to learn to use OpenGL. Most of the time i use gvertex3f to plot some polygons on the screen. But its to slow when I try to plot more then 20 K polygon to the screen.
I read alot of vertex array. they told me that its alot faster then the normal way so I make some example to test it. When the test code is ready i dont see i thing on my screen.
Can somebody tell me what I'm doing wrong???
ps : sorry for my bad english
ps2 : this is a piece of my code
thx in advance
static GLfloat corners[] = { -25.0f, 25.0f, 25.0f, // 0 // Front of cube
25.0f, 25.0f, 25.0f, // 1
25.0f, -25.0f, 25.0f,// 2
-25.0f, -25.0f, 25.0f,// 3
-25.0f, 25.0f, -25.0f,// 4 // Back of cube
25.0f, 25.0f, -25.0f,// 5
25.0f, -25.0f, -25.0f,// 6
-25.0f, -25.0f, -25.0f };// 7
// Array of indexes to create the cube
static GLubyte indexes[] = { 0, 1, 2, 3, // Front Face
4, 5, 1, 0, // Top Face
3, 2, 6, 7, // Bottom Face
5, 4, 7, 6, // Back Face
1, 5, 6, 2, // Right Face
4, 0, 3, 7 }; // Left Face
void render(void)
{
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
// Make the cube a wire frame
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
// Save the matrix state
glMatrixMode(GL_MODELVIEW);
glPushMatrix();
glTranslatef(0.0f, 0.0f, -200.0f);
// Rotate about x and y axes
glRotatef(xRot, 1.0f, 0.0f, 0.0f);
glRotatef(yRot, 0.0f, 0.0f, 1.0f);
// Enable and specify the vertex array
glEnableClientState(GL_VERTEX_ARRAY);
glVertexPointer(3, GL_FLOAT, 0, corners);
// Using Drawarrays
glDrawElements(GL_QUADS, 24, GL_UNSIGNED_BYTE, indexes);
glPopMatrix();
glFlush();
}












