PDA

View Full Version : please Help me the noobs of noobs!



openglDUMBO
09-14-2006, 05:15 PM
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 somethingim supper noooob at opengl

openglDUMBO
09-14-2006, 05:16 PM
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
09-15-2006, 12:53 AM
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