Sign in to follow this  
martin_bfg10k

OpenGL vsync problem

Recommended Posts

I'm making a game with Opengl. When I tested it, the game runs at 60 fps, but then I tested in a friend's pc and the game runs at 300 fps or more. It seems that my pc uses vertical sync, but not in my friend's pc. There is any way to enable vsync? thanks.

Share this post


Link to post
Share on other sites
In your Display Settings in the control panel click on the advanced tab and look there. Your graphics hardware might be configured to always force v-sync.

ace

Share this post


Link to post
Share on other sites
Even with vsync enabled they could set their refresh rate to 100hz and then you would run at 100 fps. If they don't have a 3D accelerator they might well drop to 20 fps or lower. You can use wglSwapIntervalEXT from the WGL_EXT_swap_control to try to turn vsync back on, but I don't know if it will override the control panel. With the GeForce drivers you specify whether you want it under application control or not and if not which way you want it set. I would assume if it isn't under application control then it doesn't matter what the application does.

Since you have no reasonable ability to control the frame rate it's best to simply make your animations time based. Rather than velocity being stated in units of per frame you state it in per second, calculate the time since last frame and multiply your velocity by that time delta to find how far it moved since last frame.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this