Skip to main content
gamedev.net
🔒 Locked

Vsnyc ??

Started by Scorcher24 4 replies 1.4k views
Original Post
Scorcher24
Scorcher24
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
ff8
ff8
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]
try_catch_this
try_catch_this
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.
Scorcher24
Scorcher24
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
relsoft
relsoft
60 FPS seems to be the standard rate for games and demos. You can change the refresh rate via control panel if you want.
Hi.
_the_phantom_
_the_phantom_
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.

Topic Locked

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

Sign in to reply to this topic.