I’m drawing a single polygon with the following code:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glTranslated( 100.0, 100.0, -1.5); glRotatef( 50.0, 1.0, 0.0, 0.0); glRotatef( 10.0, 0.0, 1.0, 0.0); glScalef( 0.5, 1.0, 0.9); glBegin(GL_POLYGON); glColor3f( 1.0,0.0,1.0); glVertex3f( 0, 0, 0); glVertex3f( Width, 0, 0); glVertex3f( Width, 0, -Height); glVertex3f( 0, 0, -Height); glEnd();
==============================================================
Then I try to replace that part of the code for a display list, but It doesn’t work:
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glLoadIdentity(); glTranslated( 100.0, 100.0, -1.5); glRotatef( 50.0, 1.0, 0.0, 0.0); glRotatef( 10.0, 0.0, 1.0, 0.0); glScalef( 0.5, 1.0, 0.9); glCallList(ENVIRONMENT_DL);
==============================================================
The display list was created with:
glLoadIdentity(); glNewList(ENVIRONMENT_DL, GL_COMPILE); glBegin(GL_POLYGON); glColor3f( 1.0,0.0,1.0); glVertex3f( 0, 0, 0); glVertex3f( Width, 0, 0); glVertex3f( Width, 0, -Height); glVertex3f( 0, 0, -Height); glEnd(); glEndList();