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

Author Topic: Vsync limits entire loop to 60 cycles per second  (Read 2047 times)

0 Members and 1 Guest are viewing this topic.

inaudax

  • Newbie
  • *
  • Posts: 7
    • View Profile
Vsync limits entire loop to 60 cycles per second
« on: September 13, 2014, 07:29:12 am »
My understanding of vsync in SFML is that it is only supposed to limit the calls to the display() function of sf::RenderWindow.  However, whenever I have vsync enabled the entire game loop gets limited to 60 cycles per second.  Has anyone else encountered this issue?

OniLinkPlus

  • Hero Member
  • *****
  • Posts: 500
    • View Profile
Re: Vsync limits entire loop to 60 cycles per second
« Reply #1 on: September 13, 2014, 08:04:53 am »
This is exactly how Vsync is supposed to work. If Vsync is enabled, every time you call display(), the program goes to sleep until the next vertical sync of your monitor.
I use the latest build of SFML2

Hapax

  • Hero Member
  • *****
  • Posts: 3346
  • My number of posts is shown in hexadecimal.
    • View Profile
    • Links
Re: Vsync limits entire loop to 60 cycles per second
« Reply #2 on: September 15, 2014, 10:48:10 pm »
If you need to run your 'game loop' more rapidly than the display rate, you'll need to "decouple the simulation and rendering framerates", as described in this article about time steps.
Selba Ward -SFML drawables
Cheese Map -Drawable Layered Tile Map
Kairos -Timing Library
Grambol
 *Hapaxia Links*

 

anything