Original Post
I'm having a problem with a simple OpenGL program. There is little GL code at all right now, just a framework for switching between different "scenes" and a couple of test triangles. I've zipped up the Python code and put it on my website (http://davemikesell.net/code.zip), but a print trace of the GL calls is shown below. I removed repetitions of the drawing of each triangle for brevity. The first red triangle appears as expected, but the 2nd green one does not after the scene is changed (i.e. the screen is black). I tried drawing the 2nd scene first and it drew, so it is a state problem of some kind. What am I overlooking? init menu_scene glShadeModel(GL_SMOOTH) glClearColor(0.0, 0.0, 0.0, 1.0) glClearDepth(1.0) glViewport(0, 0, WIDTH, HEIGHT) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluOrtho2D(0.0, WIDTH, 0.0, HEIGHT) glMatrixMode(GL_MODELVIEW) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glLoadIdentity() glColor4f(1.0, 0.0, 0.0, 1.0) glBegin(GL_TRIANGLES) glVertex3f( 0.0, 1.0, 0.0) glVertex3f(-1.0,-1.0, 0.0) glVertex3f( 1.0,-1.0, 0.0) glEnd() glFlush() pygame.display.flip() init game_scene glShadeModel(GL_SMOOTH) glClearColor(0.0, 0.0, 0.0, 1.0) glClearDepth(1.0) glViewport(0, 0, WIDTH, HEIGHT) glMatrixMode(GL_PROJECTION) glLoadIdentity() gluOrtho2D(0.0, WIDTH, 0.0, HEIGHT) glMatrixMode(GL_MODELVIEW) glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT) glLoadIdentity() glColor4f(0.0, 1.0, 0.0, 1.0) glBegin(GL_TRIANGLES) glVertex3f( 0.0, 1.0, 0.0) glVertex3f(-1.0,-1.0, 0.0) glVertex3f( 1.0,-1.0, 0.0) glEnd() glFlush() pygame.display.flip()