Results 1 to 3 of 3

Thread: please Help me the noobs of noobs!

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2006
    Posts
    3

    please Help me the noobs of noobs!

    im trying to get a menu option to clear the screen, but its not clearing the screen for some reason! please help me

    Code :
    	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

  2. #2
    Junior Member Newbie
    Join Date
    Sep 2006
    Posts
    3

    Re: please Help me the noobs of noobs!

    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

  3. #3
    Senior Member OpenGL Pro Zengar's Avatar
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    1,931

    Re: please Help me the noobs of noobs!

    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean