Here are some codes concerning my problem.
I hope it will be more easier to find a way by this manner.
These are from 3 files making some rendering using extensions and NVidia.
it’s some about huge… so i cut them to reduce only to the renderer.
Here what i call when i render
<code>
[…]
inline GLuint Render( void){
static GLuint *dlists= new GLuint[branch_nb];
static bool done= false;
glPushMatrix();
for( GLuint i=0; i<branch_nb; i++){
if( done){
glPushMatrix();
matrix3D& pos= graphic_branch[i].children->position;
glTranslatef( pos.x, pos.y, pos.z);
matrix3D& rot= graphic_branch[i].children->orientation;
glRotatef( _RAD_TO_DEG, rot.x), 0,1,0);
glRotatef( _RAD_TO_DEG(rot.y), 1,0,0);
glRotatef( _RAD_TO_DEG(rot.z), 0,0,1);
glCallList( dlists[i]);
glPopMatrix();
}
else{
dlists[i]=glGenLists( 1);
glNewList( dlists[i], GL_COMPILE);
glPushMatrix();
graphic_branch[i].Render();
glPopMatrix();
glEndList();
if( i==branch_nb-1)
done= true;
}
}
glPopMatrix();
return 1;
}
</code>
And here is what making the display list:
<code>
//! render the part data
inline GLuint Render( void){
ext.glextVertexPointer( 3, GL_FLOAT, 0, 9faces_nb, &vertices[0]);
ext.glextNormalPointer( GL_FLOAT, 0, faces_nb9, &normals[0]);
ext.glextColorPointer( 4, GL_FLOAT, 0, faces_nb12, &colors[0]);
ext.glextTexCoordPointer( 2, GL_FLOAT, 0, faces_nb6, &texels[0]);
ext.glextIndexPointer( GL_UNSIGNED_INT, 0, 3faces_nb, &index[0]);
ext.glextDrawRangeElements(GL_TRIANGLES, 0, faces_nb, 3faces_nb, GL_UNSIGNED_INT, &index[0]);
return 1;
}
</code>
I must call the display list to get a normal render. Otherwise, i have something like a ball. It seems that the indexes always started from the first index of what’s in the NV memory.