VSync in SDL

Started by
7 comments, last by c-gibson-s 19 years, 6 months ago
How would I enforce this? Thanks.
---"What? What is it? Is it the monkey in the pants? It's the monkey in the pants, isn't it. Don't give me that look."
Advertisement
you don't.
HxRender | Cornerstone SDL TutorialsCurrently picking on: Hedos, Programmer One
This topic has been brought up before.
You cant turn it on within SDL
You can only force it with your gfx card drivers.
You shouldn't need vsync when programming anyway. There should be no reason why you need to limit the fps. All animations, movement etc should be time based and should not rely on the speed of the computer.
The purpose of VSync isn't to limit the FPS. It's a side effect. It's used to syncronise the FPS with the monitors refresh rate, so you can't see the image 'tearing'.
You don't need Vsync when working with SDL. I think that SDL takes care of this for you. SDL_Flip and SDL_UpdateRect should do Vsyncing for you. At least I've never experienced any strange artifacts while using SDL.

-Richardo
turning vsync on will sync SDL_Flip with every monitor refresh
you cant turn vsyncon in SDL
Quote:
You shouldn't need vsync when programming anyway. There should be no reason why you need to limit the fps. All animations, movement etc should be time based and should not rely on the speed of the computer.
Uh... ever heard of cel-based animation?
Hehe.. Use the OpenGL extension. WGL_EXT_swap_control!

Dunno if that would mean you couldn't use SDL graphics anymore..
By default SDL 'waits' until monitor refresh before drawing to the screen, essentially using a vsync like thing to prevent tearing.

It handles it for you basically.
gib.son

This topic is closed to new replies.

Advertisement