/usr/include/OpenLayer/FpsCounter.hpp is in libopenlayer-dev 2.1-2.1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 | #ifndef OL_FPS_COUNTER_HPP
#define OL_FPS_COUNTER_HPP
#include "Declspec.hpp"
namespace ol {
// FpsCounter - Make the game to run at the same speed in every computer and calculate the fps //
#define AUTO -1
class OL_LIB_DECLSPEC FpsCounter {
public:
// Start the timer, defaultFps is the fps you're planning the game to run in //
static void Start( float defaultFps );
// Pause the fps counter //
static void Pause();
// Resumes the paused fps counter //
static void Resume();
// The old name "Continue" for the Resume-function can still be used //
inline static void Continue() {
Resume();
}
// You'll have to call this once per frame! //
// This function now also returns the delta time //
static float NewFrameStarted();
// Get the delta time of the frame. You'll have to multiply all movements and //
// accelerations by the delta time to keep the game speed undependant of the fps //
static float GetDeltaTime();
// Retrieve the fps //
static float GetFps();
// Called from the timer, don't touch ;) //
static void Tick();
// Sets the number of frames between which the delta time will be calculated //
// Pass AUTO to let OpenLayer to dynamically adjust the settings for //
// the current situation //
static void SetNumOfAveragedFrames( int averagedFrames );
private:
static float defaultFps;
static volatile int timer;
static int frameCount;
static float fps;
static float deltaTime;
static bool paused;
static int pausedTimer;
static int framesPerCheck;
static int quickFPC;
static int normalFPC;
static float actionLimit;
static bool useAdvanced;
};
}
#endif // OL_FPS_COUNTER_HPP
|