Sign in to follow this  
stroma

about FPS

Recommended Posts

my program's fps cannot be 80. Because it waits for monitor's frame rate(70). how can i solve this? how can i know the real fps? i mean the fps when if program does not wait for the monitor..

Share this post


Link to post
Share on other sites
thank you, i found a code for this:

typedef BOOL (APIENTRY *PFNWGLSWAPINTERVALFARPROC)( int );
PFNWGLSWAPINTERVALFARPROC wglSwapIntervalEXT = 0;

void setVSync(int interval=1)
{
const unsigned char *extensions = glGetString( GL_EXTENSIONS );

if( strstr( (const char *)extensions, "WGL_EXT_swap_control" ) == 0 )
return; // Error: WGL_EXT_swap_control extension not supported on your computer.\n");
else
{
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALFARPROC)wglGetProcAddress( "wglSwapIntervalEXT" );

if( wglSwapIntervalEXT )
wglSwapIntervalEXT(interval);
}
}


it uses the extension that you said...

Share this post


Link to post
Share on other sites
Quote:
Original post by stroma
it uses the extension that you said...


but keep in mind that forcing vsync off for anything but benchmarking is a great way to piss off the user ,-)

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