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

Author Topic: Max Framerate  (Read 1490 times)

0 Members and 1 Guest are viewing this topic.

Poraft

  • Newbie
  • *
  • Posts: 24
    • View Profile
Max Framerate
« on: May 24, 2012, 12:11:59 pm »
Hello,

When I'm drawing my map( 300 32x32 tiles) from a file. It goes from 3000 to 500 frames per second. Pretty big drop I know. But when I'm using the SetMaxFramerate(60) function. It goes like 59, 60, 59, 58, 61, 120, 125, 123, 60, 61, etc. The jumps to 120 makes the game really weird.

Does someone know how to fix this? Or what the problem is?

- Windows 7 64bit (laptop)
- SFML pre-RC version

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11034
    • View Profile
    • development blog
    • Email
Re: Max Framerate
« Reply #1 on: May 24, 2012, 12:26:04 pm »
A quick search for 'fps' would have lead you to many many topics about strange FPS behaviour. Many things can't be explained and they may be diffrent on diffrent systems...

Keep in mind setFramerateLimit does not guarantee a fixed frame limit but it also should prevent a fps doubling.
A drop from 3000 to 500 can be quite normal, because there's a big differences between doing nothing and drawing.

To confirm that it's not a mistake in your code where you calc the fps, you should provide it.

SFML pre-RC version
Additionally being up to date can't hurt. ;)
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/