Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: Problem with lagging animation over time

  1. #11
    Senior Member OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,136
    I'd advise that first of all you get rid of that single-buffered context. I'd honestly love to see all GLUT tutorials that create a single-buffered context being consumed by a very large, very hot fire. You'd almost think that using double-buffered was in some way an advanced topic, but it's not - it's two lines of code.

    Change this:
    Code :
    glutInitDisplayMode (GLUT_RGB | GLUT_DEPTH);
    To this:
    Code :
    glutInitDisplayMode (GLUT_RGB | GLUT_DEPTH | GLUT_DOUBLE);

    And at the end of your OnDisplay function, instead of glFlush or glFinish, use this:
    Code :
    glutSwapBuffers ();

    Now you've got a nice double-buffered context that will work better with the way your GPU is designed to work, so try things out and see what happens from there.

  2. #12
    Junior Member Newbie
    Join Date
    Jun 2013
    Posts
    10
    Now you've got a nice double-buffered context that will work better with the way your GPU is designed to work, so try things out and see what happens from there.
    Unfortunately, frame buffering is not the problem. I had been using it at first, but i thought it can be the cause, so i removed it. But the performance problem remains with enabled or disabled double buffering.

    Did anyone try to compile my example code to ensure they experience the same problem?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •