use updates synchronized with vertical retrace if adaptive vsync fails

This commit is contained in:
jaz
2019-12-12 18:49:37 +01:00
committed by Mischa Spiegelmock
parent 15caaaec10
commit b2c3b49cdf

View File

@ -306,7 +306,11 @@ srand((int)(time(NULL)));
SDL_SetWindowTitle(win, "projectM Visualizer");
SDL_GL_MakeCurrent(win, glCtx); // associate GL context with main window
SDL_GL_SetSwapInterval(-1); // Enable adaptive vsync
int avsync = SDL_GL_SetSwapInterval(-1); // try to enable adaptive vsync
if (avsync == -1) { // adaptive vsync not supported
SDL_GL_SetSwapInterval(1); // enable updates synchronized with vertical retrace
}
projectMSDL *app;