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

Author Topic: Method for retrying of availability of vertical sync  (Read 4554 times)

0 Members and 1 Guest are viewing this topic.

Hronom

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Method for retrying of availability of vertical sync
« on: July 14, 2013, 06:58:45 pm »
I wanna some method that return true if vertical sync available on current platform. So if it not available i set maximum frame rate option.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Method for retrying of availability of vertical sync
« Reply #1 on: July 14, 2013, 07:13:41 pm »
Haven't heard of a system that wouldn't support VSync. The only thing that's could be a problem is, when the driver can block the changing of VSync state, but since this is very driver specific I would be very surprise if there was a general way to retrieve that information.

If you however meant to simply track the current VSync state, then I suggest to use your own boolean and check against it. :)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Hronom

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Method for retrying of availability of vertical sync
« Reply #2 on: July 22, 2013, 12:55:08 pm »
Thanks for reply.

I have a situation, at home i have normal drivers with enabled vsync(NVIDIA), and then i enable vsync in SFML its works. Then i come to my friend its have integrated intel card and in its driver by default vsync disabled, so programs cant force using it.

I understand that this is driver specific. But it will be nice if i can retrive of availability of enabling feature like vsync. So if i cant enable i try emulate vsync.

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Method for retrying of availability of vertical sync
« Reply #3 on: July 22, 2013, 01:10:38 pm »
I'm not sure if that's possible to check.
What you could do is render a few frames and calculate the FPS, if it's too high activate your own framerate lowering code (or setFramerateLimit).
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

netrick

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Re: Method for retrying of availability of vertical sync
« Reply #4 on: July 23, 2013, 09:08:14 am »
Just put an option menu in your game when user can set if he wants vsync of frame limit (with vsync default).

Hronom

  • Newbie
  • *
  • Posts: 6
    • View Profile
    • Email
Re: Method for retrying of availability of vertical sync
« Reply #5 on: July 23, 2013, 09:52:04 am »
Just put an option menu in your game when user can set if he wants vsync of frame limit (with vsync default).
Its not good, becouse, then user launch a game he see glitches in the main menu and user dont know why this glitches happens. So game must resolve some problems automaticly...

netrick

  • Full Member
  • ***
  • Posts: 174
    • View Profile
Re: Method for retrying of availability of vertical sync
« Reply #6 on: July 24, 2013, 11:37:15 am »
Then set frame limit as default option.

AlexAUT

  • Sr. Member
  • ****
  • Posts: 396
    • View Profile
Re: Method for retrying of availability of vertical sync
« Reply #7 on: July 24, 2013, 01:13:28 pm »
Solution already posted...

What you could do is render a few frames and calculate the FPS, if it's too high activate your own framerate lowering code (or setFramerateLimit).



AlexAUT

 

anything