Page 1 of 5 12345 LastLast
Results 1 to 10 of 47

Thread: some help regarding flickering

  1. #1
    Junior Member Newbie
    Join Date
    Jan 2011
    Posts
    25

    some help regarding flickering

    I have create a game in glut. It was flickering so I used GLUT_DOUBLE and then it was showing the transparent window then I used glutSwapBuffers(); then it was showing game without flickering but there was no movement in game i.e. the keystrokes are not working. What should I do now??

  2. #2
    Senior Member Regular Contributor
    Join Date
    Mar 2010
    Posts
    213

    Re: some help regarding flickering

    Could you paste the relevant code here?

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2011
    Posts
    25

    Re: some help regarding flickering

    Code :
        void display(void)
        {
        	glClear (GL_COLOR_BUFFER_BIT);
        	arena();
        	start();			//start the game
        	comments();
        	next_level();
        	glutSwapBuffers();
        }
     
     
    void init() {
            glClearColor (0.0, 0.0, 0.0, 0.0);
    //    	glEnable(GL_DEPTH_TEST);
            glMatrixMode(GL_PROJECTION);
            glLoadIdentity();
            glShadeModel(GL_SMOOTH);
            glOrtho(-1000.0, 1000.0, -1000.0, 1000.0, -1000.0, 1000.0);
        	glutDisplayFunc(display);
        	glutKeyboardFunc(processNormalKeys);
        	glutSpecialFunc(pressKey);
     
     
        }
        int  main(int argc, char** argv)
        {
            glutInit(&argc, argv);
            glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);
      //      glutInitDisplayMode (GLUT_SINGLE | GLUT_RGB);
            glutInitWindowSize (700,700);
            glutInitWindowPosition (100,-100);
            glutCreateWindow ("BLASTERBALL 1.0");
            init ();
            glutMainLoop();
            return 0;
     
        }

  4. #4
    Junior Member Newbie
    Join Date
    Jan 2011
    Posts
    25

    Re: some help regarding flickering

    please help someone!!!

  5. #5
    Member Newbie
    Join Date
    Jan 2011
    Location
    Lincoln, UK
    Posts
    36

    Re: some help regarding flickering

    Code :
    glutDisplayFunc(display);
    glutKeyboardFunc(processNormalKeys);
    glutSpecialFunc(pressKey);

    for a start, all of the above functions should be in your main function (before glutMainLoop(), NOT your init function.

    also, why are you using glLoadIdentity(); in your init function?

  6. #6
    Junior Member Newbie
    Join Date
    Jan 2011
    Posts
    25

    Re: some help regarding flickering

    I am new to this. I saw this on some site. What should I do here instead?

  7. #7
    Member Newbie
    Join Date
    Jan 2011
    Location
    Lincoln, UK
    Posts
    36

    Re: some help regarding flickering

    did moving the mouse and key functions to the main function resolve the issue.

    from what i can see i your code, the glLoadIdentity() call isnt needed, thats all.

  8. #8
    Junior Member Newbie
    Join Date
    Jan 2011
    Posts
    25

    Re: some help regarding flickering

    no its still same. The keystrokes are not working with GLUT_DOUBLE and glutSwapBuffer()

  9. #9
    Member Newbie
    Join Date
    Jan 2011
    Location
    Lincoln, UK
    Posts
    36

    Re: some help regarding flickering

    keep the functions mentioned in the main function, but remove the glLoadIdentity(); call

    see if that helps.

    dale

  10. #10
    Junior Member Newbie
    Join Date
    Jan 2011
    Posts
    25

    Re: some help regarding flickering

    i did all those thing but still the issue is same.

Page 1 of 5 12345 LastLast

Similar Threads

  1. Still flickering
    By art-ganseforth in forum OpenGL: Basic Coding
    Replies: 2
    Last Post: 04-04-2016, 12:25 AM
  2. flickering
    By stranimondi in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 01-17-2006, 11:41 PM
  3. Help Me I need help with flickering
    By in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 07-29-2002, 01:21 AM
  4. Flickering?
    By ym in forum OpenGL: Basic Coding
    Replies: 4
    Last Post: 10-13-2001, 01:58 AM
  5. Flickering
    By cwhite40 in forum OpenGL: Basic Coding
    Replies: 7
    Last Post: 09-23-2000, 10:49 AM

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