SFML community forums

Help => Graphics => Topic started by: dmitry_t on August 21, 2018, 10:08:24 pm

Title: [SOLVED] setVerticalSyncEnabled is broken in 2.5.0?
Post by: dmitry_t on August 21, 2018, 10:08:24 pm
Hi there,

I just migrated to 2.5.0 and suddenly realized that the FPS is not limited, it does not matter whether verticalSyncEnabled is set to true or false.
Tested on Windows and Linux.
Is it something known?

Update. On Windows, the first call setVerticalSyncEnabled(true) does nothing, however, subsequent calls setVerticalSyncEnabled(false) and setVerticalSyncEnabled(true) lead to the desired effect.
Title: Re: setVerticalSyncEnabled is broken in 2.5.0?
Post by: eXpl0it3r on August 21, 2018, 10:51:55 pm
When do you call setVerticalSyncEnabled the first time, i.e. do you have a complete but minimal example?
Title: Re: setVerticalSyncEnabled is broken in 2.5.0?
Post by: dmitry_t on August 22, 2018, 12:11:27 am
I have written a simple example. However it does not reproduce the issue.
However I realized that the very first call is done from a non-main thread, when the app is reading preferences and other stuff. I guess this might cause the issue?

(click to show/hide)
Title: [SOLVED] Re: setVerticalSyncEnabled is broken in 2.5.0?
Post by: dmitry_t on August 22, 2018, 12:47:22 am
Indeed, if there is a call from non-main thread, this call is ignored on Windows. And on Linux it causes that all subsequent calls do not work.