im trying to get a menu option to clear the screen, but its not clearing the screen for some reason! please help me
case CCLEAR:
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glTranslatef(0.0f,0.0f,-5.0f);
glPopMatrix();
glutSwapBuffers();
break;
// Do something
im supper noooob at opengl
let me repost the code, i dont think people can read what i posted
case CCLEAR:
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glPushMatrix();
glTranslatef(0.0f,0.0f,-5.0f);
glPopMatrix();
glutSwapBuffers();
break;
// Do something
Zengar
3
Actually it should clear the screen, but…
- make shure that you initialize glut correctly
- make shure you trigger the switch case (dunno how/why you do it)
Usually you want to execute this code each time the frage is drawn