Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: [SOLVED] setVerticalSyncEnabled is broken in 2.5.0?  (Read 1670 times)

0 Members and 1 Guest are viewing this topic.

dmitry_t

  • Newbie
  • *
  • Posts: 18
    • View Profile
[SOLVED] setVerticalSyncEnabled is broken in 2.5.0?
« 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.
« Last Edit: August 22, 2018, 12:47:54 am by dmitry_t »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 10827
    • View Profile
    • development blog
    • Email
Re: setVerticalSyncEnabled is broken in 2.5.0?
« Reply #1 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?
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

dmitry_t

  • Newbie
  • *
  • Posts: 18
    • View Profile
Re: setVerticalSyncEnabled is broken in 2.5.0?
« Reply #2 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)
« Last Edit: August 22, 2018, 12:51:44 am by dmitry_t »

dmitry_t

  • Newbie
  • *
  • Posts: 18
    • View Profile
[SOLVED] Re: setVerticalSyncEnabled is broken in 2.5.0?
« Reply #3 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.

 

anything