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

Author Topic: SetFramerateLimit problem  (Read 13545 times)

0 Members and 1 Guest are viewing this topic.

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SetFramerateLimit problem
« Reply #15 on: July 09, 2009, 02:28:52 pm »
Did you try on different computers? It looks like it's related to your configuration.
Laurent Gomila - SFML developer

Dominator

  • Newbie
  • *
  • Posts: 37
    • View Profile
SetFramerateLimit problem
« Reply #16 on: July 09, 2009, 03:28:08 pm »
It works correctly on a different computer.

csiz

  • Newbie
  • *
  • Posts: 30
    • Yahoo Instant Messenger - calinutzu92
    • View Profile
    • Email
SetFramerateLimit problem
« Reply #17 on: July 09, 2009, 04:35:22 pm »
I remember I read something about frame rates and it seems like its that situation.

The monitor goes at about 60 fps so it draws the frames at 1/60 of a second. But if you delay the frames for a little more than 1/60 s than the monitor will wait for the next round of drawing to draw that frame so there will be 2/60 distance between frames, that means 30 fps.

So the monitor tries to draw something if there is nothing it will wait another 1/60 s.

And if your delay is constantly very little more than 1/60 you will get 30 fps, if its more than 2/60 you will get 20 fps (because it jumps 2 frames for every frame drawn) and so on.
My new webpage calinmocanu

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32498
    • View Profile
    • SFML's website
    • Email
SetFramerateLimit problem
« Reply #18 on: July 09, 2009, 04:37:27 pm »
This applies only when vertical synchronization is activated.
Laurent Gomila - SFML developer

Dominator

  • Newbie
  • *
  • Posts: 37
    • View Profile
SetFramerateLimit problem
« Reply #19 on: December 12, 2009, 01:03:12 pm »
Now I have strange issues with the framelimit on a different computer.

Setting the framelimit to 60 results in 50 fps.
But when using VSync it reaches nearly exactly 60 fps.

So to get over the 50 fps, I had to set 90 fps as framelimit (which results in 100 fps), but this works only occasionally, sometimes it's capped at exactly 64 fps (like in the original issue in this thread), but most time it's 100 fps.

From what I can see, is that the factor 2 is somehow involved.

32 vs 64 fps
50 vs 100 fps

drobole

  • Newbie
  • *
  • Posts: 9
    • View Profile
SetFramerateLimit problem
« Reply #20 on: December 28, 2009, 05:26:59 pm »
Im having a similar problem.
I'm using Windows 7 x64, VC++ 2008 Express and latest trunc of SFML from SVN.

Running with no clamps on the frame limit and vertical sync disabled I get ~2700 FPS

Using SetFramerateLimit here is the measures I get:
Code: [Select]

FrameLimit(10) - FPS(9)
FrameLimit(20) - FPS(16)
FrameLimit(30) - FPS(21)
FrameLimit(40) - FPS(32)
FrameLimit(50) - FPS(32)
FrameLimit(60) - FPS(32) Jumps to 64 now and then
FrameLimit(70) - FPS(64)
FrameLimit(80) - FPS(64)
FrameLimit(120) - FPS(64)
FrameLimit(500) - FPS(64)
FrameLimit(700) - FPS(1800)
FrameLimit(800) - FPS(2700)
FrameLimit(> 800) - FPS(2700)


Here is how I calculate FPS:
Code: [Select]

float framerate = 1.f / window.GetFrameTime();
std::stringstream ss;
ss << "FPS: " << framerate;
mDebugInfo->SetText(ss.str());

 

anything