1
0
Fork 0
mirror of https://github.com/TerryCavanagh/VVVVVV.git synced 2024-12-23 01:59:43 +01:00

Add v-sync hint

This is because otherwise, on my Linux system at least, the game will
take up a lot of CPU that it doesn't really need to (I only have a 60hz
monitor).

On Windows, it looks like Windows already enforces V-sync for
applications anyway, unless they have exclusive fullscreen control.
Linux doesn't enforce V-sync on apps and lets them take up as much CPU
as they want, so I'm putting this here to limit the framerate.

The game is already actually 30 FPS anyway, the nice smooth FPS is just
visual. V-sync won't introduce any more "input lag" than already exists.
This commit is contained in:
Misa 2020-05-02 14:53:43 -07:00 committed by Ethan Lee
parent ad6adcb3c0
commit 4be18ff9fe

View file

@ -108,6 +108,8 @@ int main(int argc, char *argv[])
}
}
SDL_SetHintWithPriority(SDL_HINT_RENDER_VSYNC, "1", SDL_HINT_OVERRIDE);
if(!FILESYSTEM_init(argv[0], baseDir, assetsPath))
{
return 1;