Notify user when Adaptive Vsync is not available

This commit is contained in:
Yousef Khadadeh 2025-11-20 13:12:41 +03:00
parent d5d586092d
commit 4d294f1002

View file

@ -256,6 +256,10 @@ void MainProgram::load_config() {
void MainProgram::set_vsync_value(int vsyncValue) {
if(!SDL_GL_SetSwapInterval(vsyncValue)) {
Logger::get().log("INFO", "Vsync value " + std::to_string(vsyncValue) + " not available. Setting to 1");
if(vsyncValue == -1) {
Logger::get().log("USERINFO", "Adaptive VSync not available. Setting Vsync to On");
vsyncValue = 1;
}
SDL_GL_SetSwapInterval(1);
}
window.vsyncValue = vsyncValue;