2
\$\begingroup\$

I am trying to completely unlimit the SFML framerate, so that as many frames will be displayed as possible. The reason for this is I want to loop through one section of code which calculates positions of objects in a physics simulation, and update the screen after perhaps 100 iterations.

I have done:

window.SetFramerateLimit(0);
window.UseVerticalSync(false);

The SFML documentation says this should set the frame rate to "infinity", but I still think it's stuck at about 60-ish...

Does anyone know how I can get more performance out of this?

Also once unlimited, I need to be able to do the equivalent of this in SFML, from SDL:

SDL.Delay(1000);

Is there a way of doing this? The SDL Delay is good because it frees CPU time for other processes. Any help would be greatly appreciated, especially as it's Christmas and you probably have better things to do! (I don't I'm a student.)

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Crosspost from SO: stackoverflow.com/questions/14032593/… \$\endgroup\$
    – Alayric
    Commented Dec 25, 2012 at 20:34
  • \$\begingroup\$ Without any code about vertical sync, the frame rate of a SFML application should not be limited. I tried that and got something around 1500 fps. \$\endgroup\$
    – danijar
    Commented Dec 25, 2012 at 22:01
  • \$\begingroup\$ Vsync is your enemy for this, if vsync is enabled it keep your games fps the same as your monitors refresh rate \$\endgroup\$
    – Canvas
    Commented Jan 14, 2015 at 12:44

1 Answer 1

2
\$\begingroup\$

Those values you set are set to that by default you shouldn't have to explicitly write that. Anyway why you are stuck at 60 is probably because your driver still has vertical sync enabled. The driver can choose to override any application, you should be able to change this in the drivers control panel.

And equivalent to SDL.Delay(1000) in SFML would be: sf::sleep(sf::seconds(1)) if you are using SFML 2.0-RC or sf::Sleep(1) if you are using the obsolete 1.6

\$\endgroup\$
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .