Skip to main content
GameDev.net gamedev.net
🔒 Locked

Pausing for video lock

Started by Aargyle Apr 26, 2003 at 4:47 AM 2 replies 250+ views
Original Post
Aargyle
Aargyle
I have been measuring my time between frames and getting exactly 85.0 FPS, which is my moniter refresh rate. My question is this: Which openGL call is pausing my program to wait for the video refresh rate? Is it GLFlush()? I would like to do other things to fill up my ''empty'' time each frame, but I can''t figure out where the program is actually pausing. Thanks!
_Corrupt_
_Corrupt_
it''s SwapBuffers() ( only when v-sync is enabled )

so you must disable v-sync
don''t piss on an electrical fence
Aargyle
Aargyle
Ah thanks!

Anyone know how ''close you can cut it'' before calling swapbuffers? For instance at 85 Hz refresh rate that gives 11.76 ms per frame. Can I call swapbuffers() as late as 11.70, or is it safer to leave a millisecond or two of extra room? Not sure how much I can squeeze out of it without missing the vsync refresh. But with my current program I''m calling it after like 2 ms, since I hardly draw anything.

iNsAn1tY
iNsAn1tY
OK, what you need to do is this: look up OpenGL extensions, then try this extension: WGL_EXT_swap_control. It allows you to disable vsync, so that your program can output many more frames than the monitor's refresh rate. You don't have to wait for wglSwapBuffers() to return before creating the next frame, as you do when vsync is turned on, and this way, you never need to to worry about precisely timing your frames. The swap control extension is how commercial software achieves frame rates far in excess of any monitor refresh rate...



Coding Stuff ->  [ iNsAn1tY Games | DarkVertex | How To Do CSG | Direct3D Vs. OpenGL | Google ]
Fun Stuff    ->  [ Evil T-Shirts | Stick-Based Comedy | You're Already Here | The Best Film Reviews ]


[edited by - iNsAn1tY on April 26, 2003 1:56:05 PM]
My opinion is a recombination and regurgitation of the opinions of those around me. I bring nothing new to the table, and as such, can be safely ignored.[ Useful things - Firefox | GLee | Boost | DevIL ]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.