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

Author Topic: EnableVerticalSync  (Read 2016 times)

0 Members and 1 Guest are viewing this topic.

kidchameleon

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • Email
EnableVerticalSync
« on: August 13, 2011, 12:53:03 am »
Hi All,

I'm working on a tile engine at the moment. Everything is going well. I have the characters moving using delta time to ensure movement is uniform on all platforms. There is slight jagged edges on sprites and tiles when the map is scrolling, if I set EnableVerticalSync to true on  the render window, I get lovely crisp graphics but the whole game slows down. Looking at the documentation for EnableVerticalSync (using latest 2.0), it says

"This can avoid some visual artifacts, and limit the framerate to a good value (but not constant across different computers)."

Is there any way I can use this function yet somehow ensure uniform speeds for my characters?

I hope Ive explained this properly and thank you for reading.

Kid.

Sui

  • Jr. Member
  • **
  • Posts: 67
    • View Profile
    • http://www.suisoft.co.uk/
EnableVerticalSync
« Reply #1 on: August 13, 2011, 09:46:39 am »
A lot of games have an option to switch on/off vertical retrace.

Maybe put something in your Options screen.

It's pretty much impossible to get software to run on every machine configuration without some workarounds / user settings. Even then there will be some machines that are lost causes due to dodgy drivers.
Gary Marples, Developer of games and other stuff.
www.suisoft.co.uk/games/BlogTwitter

kidchameleon

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • Email
EnableVerticalSync
« Reply #2 on: August 13, 2011, 10:18:02 am »
Thanks Sui,

I was actually thinking about the putting something in the options menu, and perhaps a slider to speed the game up/down. Thanks a million for your help.

Kid.

Nexus

  • SFML Team
  • Hero Member
  • *****
  • Posts: 6287
  • Thor Developer
    • View Profile
    • Bromeon
EnableVerticalSync
« Reply #3 on: August 13, 2011, 10:55:52 am »
sf::Window::SetFramerateLimit() or manual sf::Clock() measuring are other possibilities to have a fixed framerate.
Zloxx II: action platformer
Thor Library: particle systems, animations, dot products, ...
SFML Game Development:

kidchameleon

  • Newbie
  • *
  • Posts: 29
    • View Profile
    • Email
EnableVerticalSync
« Reply #4 on: August 13, 2011, 12:53:00 pm »
Quote from: "Nexus"
sf::Window::SetFramerateLimit() or manual sf::Clock() measuring are other possibilities to have a fixed framerate.


Looking into that now thanks Nexus