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

Author Topic: FPS capped around 47 to 50  (Read 1160 times)

0 Members and 1 Guest are viewing this topic.

Johannes01

  • Newbie
  • *
  • Posts: 3
    • View Profile
FPS capped around 47 to 50
« on: December 28, 2017, 02:04:37 am »
My FPS seem to be capped around 47 to 50 frames. It doesn't really matter how much there is to update. I have tried to run a program where the only thing that happens is that I am calculating the FPS. Still around 50 frames. I tried to tripple the amount of stuff my program does. Also around 50 frames. I understand why my program only recieves part of the processing power, even if more would be available. But why such an odd number? And how do I change it? I would much prefere around 60 FPS or more. Is this even a problem with SFML?

Here's how I calculate the FPS, maybe the problem lies there.

        lastTime = 0;

        while (window.isOpen())
        {
                currentTime = clock.restart().asSeconds();
                fps = 1 / currentTime;
                lastTime = currentTime;

                //do stuff...
        }

Thanks.
« Last Edit: December 28, 2017, 02:07:49 am by Johannes01 »

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11030
    • View Profile
    • development blog
    • Email
Re: FPS capped around 47 to 50
« Reply #1 on: December 28, 2017, 09:20:57 am »
You most likely have vsync enabled in your GPU settings and you may have a 50Hz monitor.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Johannes01

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: FPS capped around 47 to 50
« Reply #2 on: December 28, 2017, 12:33:04 pm »
It really was vsync. Thanks a lot!