Jump to content
  • Advertisement
Sign in to follow this  
Scorcher24

OpenGL Vsnyc ??

This topic is 4978 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi Folks !! My first Steps in 3D Programming I took in DirectX and that sucked. ;) Now I rather stick to OpenGL. But there is something I didn't find: Is there a way to enable something like vsync ?? There is no param for it in the DEVMODE structure and I don't know any extionsion which can enable it. Thx for helping and rya. Scorcher24

Share this post


Link to post
Share on other sites
Advertisement
you can use this extension to enable/disable the vsnys WGL_EXT_swap_control
by using this func
wglSwapIntervalEXT(int );
1=enable
0=Disable
the frame rate will be 60 fps
you can use this library to help you to setup this extension
GLEW
Please rate me :)

[Edited by - ff8 on March 30, 2005 9:39:48 AM]

Share this post


Link to post
Share on other sites

std::string SetVSync( int interval )
{
typedef BOOL (APIENTRY *PFNWGLSWAPINTERVALFARPROC)( int );
PFNWGLSWAPINTERVALFARPROC wglSwapIntervalEXT = 0;
const unsigned char *extensions = ::glGetString( GL_EXTENSIONS );
if( !extensions )
{
return std::string( "::glGetString( GL_EXTENSIONS ) returned NULL" );
}

if( ::strstr( (const char *)extensions, "WGL_EXT_swap_control" ) == 0 )
{
return std::string( "WGL_EXT_swap_control extension not supported on your computer." );
}
else
{
wglSwapIntervalEXT = (PFNWGLSWAPINTERVALFARPROC)::wglGetProcAddress( "wglSwapIntervalEXT" );
if( wglSwapIntervalEXT )
{
wglSwapIntervalEXT( interval );
return std::string( "VSync change successfull" );
}
else
{
return std::string( "wglGetProcAddress failed" );
}
}
}



SetVSync( 0 );

This works for me.

Share this post


Link to post
Share on other sites
Hi Folks !!
Sorry for my late reply and thanks a lot.
But why is the framerate limited to 60 FPS with VSync ??

Thanks for the link with glew, but for Extensions I use the ATI SDK. They have a cool library for all that stuff and the program works good with NVidia Cards, too.

rya.
Scorcher24

Share this post


Link to post
Share on other sites
60 FPS seems to be the standard rate for games and demos. You can change the refresh rate via control panel if you want.

Share this post


Link to post
Share on other sites
unless you specifiy a different refresh rate when changing screen size the system defaults to 60hz. Now, it should default to the best your monitor can do at that size, however for whatever reason its been broken for some time now (certainly regarding OpenGL based programs, I'm not sure about the D3D side of things) thus the rate of 60hz is selected. There are programs out there to force a refresh rate to a certain speed at certain screen sizes, google for 'refresh rate fix' or something simular.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!