I recently tried playing a plain-old DMG game on vbam for the first time and found the graphics to be really choppy. I did not experience this when playing GBA games or when rendering through SDL. This is because on OS X SDL_Flip() automatically waits for monitor vsync. (IIRC, it does not do this on some systems.) I went in and added a line to make OpenGL do the same, and it made a world of difference. The game was unplayable before, but it worked perfectly after that. Patch is attached.
SDL: vsync when using OpenGL
-
- Posting Freak
- Posts: 1223
- Joined: Tue Mar 18, 2008 9:21 am
SDL: vsync when using OpenGL
You shouldn't be limiting to vsync anyway, since v-refresh differs, Sync directly to audio will give you the best performance.
SDL: vsync when using OpenGL
Yes, I know it's not a great solution, however, it's no different than how the SDL renderer does it currently. IIRC, SDL_Flip() (which is called once per frame) waits for vsync when SDL_HWSURFACE is used. (Except, perhaps, in the X11 driver.) And considering that it made DMG games, which were unplayable on my system, playable, I decided to upload the patch.
Â
I'm willing to look into sync to audio, if you could provide more details as to how that works. It might also be worthwhile to include vsync as an option in the SDL port since it seems to me that syncing to audio wouldn't necessarily prevent tearing.
-
- Posting Freak
- Posts: 1223
- Joined: Tue Mar 18, 2008 9:21 am
SDL: vsync when using OpenGL
hah, thats something you'd be better asking Spacy,