[SDL] Fullscreen Vsync in Win32

Damien A original.gs at gmail.com
Tue Jul 25 18:48:08 PDT 2006


That technique works only when the SDL_OPENGL flag is set.  You may have 
to try forcing V-sync in the video card drivers, however that has never 
worked outside of OpenGL in my experience [on a Geforce].  You can try 
to use SDL_Delay to slow down the framerate.

Alan Wolfe wrote:
> Im not sure why vsync is off for you but if you're in windows you can use
> this function to turn on and off vsync:
>
> #include <windows.h>
>
> void VSyncOn(char On)
> {
>   typedef void (APIENTRY * WGLSWAPINTERVALEXT) (int);
>
>   WGLSWAPINTERVALEXT wglSwapIntervalEXT = (WGLSWAPINTERVALEXT) 
>   wglGetProcAddress("wglSwapIntervalEXT");
>   if (wglSwapIntervalEXT)
>   {
>      wglSwapIntervalEXT(On); // set vertical synchronisation
>   }
> }
>
>
>
> -----Original Message-----
> From: sdl-bounces+atrix2=cox.net at libsdl.org
> [mailto:sdl-bounces+atrix2=cox.net at libsdl.org] On Behalf Of Adam Smith
> Sent: Wednesday, July 05, 2006 7:26 PM
> To: sdl at libsdl.org
> Subject: [SDL] Fullscreen Vsync in Win32
>
> I am using SDL1.2.11, WinXp, Ati X800 PCI Express videocard
>
> I have tried setting the flags as follows:
> *flags = SDL_HWSURFACE | SDL_DOUBLEBUF | SDL_FULLSCREEN;
> SDL_SetVideoMode(640, 480, 32, flags);
> *
> When rendering the screen, I call *SDL_Flip( ).
>
> *However, vsync does not appear to be taking place as the frame rate 
> exceeds 60hz or
> whatever I set the monitor refresh rate to.
>
> Please advise!
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
>
>
> _______________________________________________
> SDL mailing list
> SDL at libsdl.org
> http://www.libsdl.org/mailman/listinfo/sdl
>
>   





More information about the SDL mailing list