glutSwapBuffers

Started by
1 comment, last by Cone83 22 years, 1 month ago
Hello I''ve read that glutSwapBuffers waits until the screen refresh period is over before swapping the buffers. With my game (not yet a real game...) I made an other experience: Although my screen has a refresh rate of 113 Hz I can get frame rates over 200 (when drawing nearly nothing). Also there is a noticable tearing effect. any idear tho synchronize it? btw.: I''m developing for linux Thanx a lot Konstantin Schauwecker
Advertisement
I am not completely sure in linux, but under win32, opengl''s refreshing options are display settings. The application generally has very little control. I imagine glut uses the default refresh rate, which for yours must be unlocked, so you are experiencing tearing. I have no idea where such a setting would be found, but look for the following names;

Verticial Refresh Sync
VSYNC
One way is to calculate the framerate and to calculate then, how far you are relating to the moniteur refresh rate. Then if you''re really in advance, wait a little time.
And do so on each frame you draw.

This is only theoric, i''ve never tested it yet. But i think this could work, and is the only way to have a compatible rate with your monitor: ex: monitor 120Hz, so you can draw at 240Hz, 120Hz, 60Hz...

i hope this will help you.

Fratt

ps: good choice that Linux !! very more speed compared to Windows !

This topic is closed to new replies.

Advertisement