Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
29 lines (24 sloc) 624 Bytes
/**
* \file FPSLimit.hpp
* \brief FPS Limiter.
*
* This class automatically limits the frames per second of a game loop, and it
* provides performance warnings to stdout if the framerate is less than the
* desired value.
*/
#ifndef __FPSLIMIT_H__
#define __FPSLIMIT_H__
#ifdef __APPLE__
#include "SDL.h"
#else
#include "SDL/SDL.h"
#endif
class FPSLimit {
public:
FPSLimit( int desiredFPS );
void Regulate();
private:
Uint32 lastTime; //!< The SDL timestamp received last call to Regulate.
Uint32 numMillis; //!< The number of milliseconds per frame.
};
#endif