PDA

View Full Version : glDrawRangeElements



guju
06-03-2002, 09:05 AM
Hi There!
I let the user decide, if he wants line display or shaded with element outline. I made the following construct:
if (LineMode){
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
glColor3f(float(mesh_R)/255.,float(mesh_G)/255.,float(mesh_B)/255.);
}else if(!LineMode){
glPolygonMode(GL_FRONT_AND_BACK,GL_FILL);
glEnable(GL_POLYGON_OFFSET_FILL);
glPolygonOffset(1.,1.);
glColor3f(2,0,0);
}
glDrawRangeElements(GL_QUADS,0,(numQuads-1)*4,numQuads*4,GL_UNSIGNED_INT,elements_quad);
if (ShadedMode){
glColor3f(float(mesh_R)/255.,float(mesh_G)/255.,float(mesh_B)/255.);
glDisable(GL_POLYGON_OFFSET_FILL);
glPolygonMode(GL_FRONT_AND_BACK,GL_LINE);
glDrawRangeElements(GL_QUADS,0,(numQuads-1)*4,numQuads*4,GL_UNSIGNED_INT,elements_quad);
This works perfect with glDrawElements, but if i use glDrawRangeElements i can not see the element border!
What is different betweeen glDrawElements and glDrawRangeElements???
Juergen