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

Author Topic: FPS Count issues  (Read 3030 times)

0 Members and 1 Guest are viewing this topic.

StormWingDelta

  • Sr. Member
  • ****
  • Posts: 365
    • View Profile
FPS Count issues
« on: April 14, 2014, 09:59:55 pm »
Been trying to remember how to setup a game loop with an FPS limiter but so far I've been getting over 600fps without a limiter and as you can tell that's way too fast. :(  I know my counter is working fine but now I just need to figure out how to slow things down to 60FPS or lower. ???


Currently I'm using C#'s Thread.Sleep to slow the game down but I know there are other ways to pull this off and don't want to sleep the thread if I don't have to. :(
I have many ideas but need the help of others to find way to make use of them.

Jesper Juhl

  • Hero Member
  • *****
  • Posts: 1405
    • View Profile
    • Email
Re: FPS Count issues
« Reply #1 on: April 14, 2014, 10:07:50 pm »
I'll admit up-front that I have no knowledge of the SFML DotNet bindings.
But, for the C++ version of the library you'd want to call something like sf::Window::setVerticalSyncEnabled or sf::Window::setFramerateLimit
I assume these functions are also exposed to DotNet.

zsbzsb

  • Hero Member
  • *****
  • Posts: 1409
  • Active Maintainer of CSFML/SFML.NET
    • View Profile
    • My little corner...
    • Email
Re: FPS Count issues
« Reply #2 on: April 14, 2014, 10:08:56 pm »
You got 2 options, use thread sleeping (SFML has Window.SetFramerateLimit) or use vertical sync (recommended).
Motion / MotionNET - Complete video / audio playback for SFML / SFML.NET

NetEXT - An SFML.NET Extension Library based on Thor

StormWingDelta

  • Sr. Member
  • ****
  • Posts: 365
    • View Profile
Re: FPS Count issues
« Reply #3 on: April 15, 2014, 01:09:23 am »
hmm guess I'll have to test both and see what happens. :)
I have many ideas but need the help of others to find way to make use of them.