SFML community forums

Help => Graphics => Topic started by: Predator106 on June 28, 2008, 06:48:35 pm

Title: [Solved] Crapping the Framerate?
Post by: Predator106 on June 28, 2008, 06:48:35 pm
Hi, I'm completely new to SFML, and was wondering if it is native and possible to cap the frame rate. I read somewhere in the forums about somebody mentioning a function for it, but I found no such function in the documentation.
Title: [Solved] Crapping the Framerate?
Post by: Xylankant on June 28, 2008, 06:54:07 pm
hi,

if you mean limiting the framerate, then SetFramerateLimit is what you are looking for.

when creating a (Rendered)Window, you can set it's framerate, what looks like this:
Code: [Select]
sf::RenderedWindow App(sf::VideoMode(X-Res, Y-Res, Bit), "Title");
App.SetFramerateLimit(Rate);

where "Rate" is your wished limit for Frames.

See also the Tutorials Page: http://www.sfml-dev.org/tutorials/1.3/window-time.php[/code]
Title: [Solved] Crapping the Framerate?
Post by: Predator106 on June 28, 2008, 09:35:48 pm
Yep, Thanks, that's exactly what I wanted.