Original Post
i try a simplest Vertex array, but it doesn't work, i can see anything , Can anyone help me with this? thanks here some codes: #define MESH_SIZE (1<<4) #define BUFFER_OFFSET(i) ((char *)NULL + (i)) //------------------------------------------------------------------------------ struct Vertex3 { Vertex3() : x(0.0f), y(0.0f), z(0.0f) {} float x, y, z; }; struct Normal3 { Normal3() : nx(0.0f), ny(1.0f), nz(0.0f) {} float nx, ny, nz; }; //------------------------------------------------------------------------------ Vertex3 Vertex[MESH_SIZE*MESH_SIZE]; Normal3 Normal[MESH_SIZE*MESH_SIZE]; GLuint Index[4*(MESH_SIZE-1)*(MESH_SIZE-1)]; //------------------------------------------------------------------------------ //!!!!!!!!!!!!!!!!!!!!!!! in init(): for (int i = 0; i < MESH_SIZE; ++i) { for (int j = 0; j < MESH_SIZE; ++j) { Vertex[i*MESH_SIZE+j].x = i; Vertex[i*MESH_SIZE+j].z = j; } } int numIndex = 0; for (unsigned int iv=0; iv<MESH_SIZE-1; iv++) { for (unsigned int iu=0; iu<MESH_SIZE-1; iu++) { Index[numIndex++] = (iv+1)*MESH_SIZE+iu; Index[numIndex++] = iv*MESH_SIZE+iu; Index[numIndex++] = iv*MESH_SIZE+iu+1; Index[numIndex++] = (iv+1)*MESH_SIZE+iu+1; } } //------------------------------------------------------------------------------ //!!!!!!!!!!!!!!!!!!!!!!! in render(): glEnableClientState( GL_VERTEX_ARRAY ); glEnableClientState( GL_NORMAL_ARRAY ); glVertexPointer( 3, GL_FLOAT, 0, Vertex); glNormalPointer(GL_FLOAT, 0, Normal); glIndexPointer(GL_UNSIGNED_INT, 0, Index); //glDrawArrays( GL_POINTS, 0, MESH_SIZE*MESH_SIZE ); glDrawElements ( GL_QUADS, 4*(MESH_SIZE-1)*(MESH_SIZE-1), GL_UNSIGNED_INT, Index); glDisableClientState( GL_VERTEX_ARRAY ); glDisableClientState( GL_NORMAL_ARRAY );