Drawing...?

Ok, here’s the problem: I can’t get OpenGL to draw stuff outside the “DrawGLScene()” function.

I hijacked the code from NeHe and added this part (with a menu to go with it, but this is pertinent.)

What happens when I run it? Well, MNU_CLEAR works, but MNU_POLYTRI never draws a thing.

case WM_COMMAND:
{
switch(wParam) {
case MNU_EXIT:
PostQuitMessage(0);
break;
case MNU_CLEAR:
glClearColor(1.0f, 1.0f, 1.0f, 1.0f);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
MessageBox(hWnd, “Cleared Window”, “Action!”, MB_OK);
break;
case MNU_POLYTRI:
glLoadIdentity(); // Reset The Current Modelview Matrix
glTranslatef(-1.5f,0.0f,-6.0f); // Move Left 1.5 Units And Into The Screen 6.0
glBegin(GL_TRIANGLES); // Drawing Using Triangles
glColor3f(1.0f,0.0f,0.0f); // Set The Color To Red
glVertex3f( 0.0f, 1.0f, 0.0f); // Top
glColor3f(0.0f,1.0f,0.0f); // Set The Color To Green
glVertex3f(-1.0f,-1.0f, 0.0f); // Bottom Left
glColor3f(0.0f,0.0f,1.0f); // Set The Color To Blue
glVertex3f( 1.0f,-1.0f, 0.0f); // Bottom Right
glEnd();
MessageBox(hWnd, “Triangle drawn”, “Drawing!”, MB_OK);
break;
}
break;
}

You probably need to call glFlush() (if you’re using single-buffering) or glutSwapBuffers() (if you’re using double-buffering), before the changes will be displayed.