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

Author Topic: [Solved] Crapping the Framerate?  (Read 3110 times)

0 Members and 1 Guest are viewing this topic.

Predator106

  • Newbie
  • *
  • Posts: 43
    • View Profile
[Solved] Crapping the Framerate?
« 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.

Xylankant

  • Newbie
  • *
  • Posts: 32
    • View Profile
    • http://xylankant.xy.funpic.de
[Solved] Crapping the Framerate?
« Reply #1 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]

Predator106

  • Newbie
  • *
  • Posts: 43
    • View Profile
[Solved] Crapping the Framerate?
« Reply #2 on: June 28, 2008, 09:35:48 pm »
Yep, Thanks, that's exactly what I wanted.