-
- if( m_gllist == 0 )
- {
- m_gllist = glGenLists( 1 );
- glNewList( m_gllist, GL_COMPILE_AND_EXECUTE );
- /* draw six faces of a cube */
- glBegin(GL_QUADS);
- glNormal3f( 0.0f, 0.0f, 1.0f);
- glVertex3f( 0.5f, 0.5f, 0.5f); glVertex3f(-0.5f, 0.5f, 0.5f);
- glVertex3f(-0.5f,-0.5f, 0.5f); glVertex3f( 0.5f,-0.5f, 0.5f);
-
- glNormal3f( 0.0f, 0.0f,-1.0f);
- glVertex3f(-0.5f,-0.5f,-0.5f); glVertex3f(-0.5f, 0.5f,-0.5f);
- glVertex3f( 0.5f, 0.5f,-0.5f); glVertex3f( 0.5f,-0.5f,-0.5f);
-
- glNormal3f( 0.0f, 1.0f, 0.0f);
- glVertex3f( 0.5f, 0.5f, 0.5f); glVertex3f( 0.5f, 0.5f,-0.5f);
- glVertex3f(-0.5f, 0.5f,-0.5f); glVertex3f(-0.5f, 0.5f, 0.5f);
-
- glNormal3f( 0.0f,-1.0f, 0.0f);
- glVertex3f(-0.5f,-0.5f,-0.5f); glVertex3f( 0.5f,-0.5f,-0.5f);
- glVertex3f( 0.5f,-0.5f, 0.5f); glVertex3f(-0.5f,-0.5f, 0.5f);
-
- glNormal3f( 1.0f, 0.0f, 0.0f);
- glVertex3f( 0.5f, 0.5f, 0.5f); glVertex3f( 0.5f,-0.5f, 0.5f);
- glVertex3f( 0.5f,-0.5f,-0.5f); glVertex3f( 0.5f, 0.5f,-0.5f);
-
- glNormal3f(-1.0f, 0.0f, 0.0f);
- glVertex3f(-0.5f,-0.5f,-0.5f); glVertex3f(-0.5f,-0.5f, 0.5f);
- glVertex3f(-0.5f, 0.5f, 0.5f); glVertex3f(-0.5f, 0.5f,-0.5f);
- glEnd();
-
- glEndList();
- }
- else
- {
- glCallList(m_gllist);
- }