Otclient  14/8/2020
AdaptativeFrameCounter Class Reference

#include <adaptativeframecounter.h>

Public Types

enum  { MINIMUM_MICROS_SLEEP = 4000 }
 

Public Member Functions

 AdaptativeFrameCounter ()
 
bool shouldProcessNextFrame ()
 
void processNextFrame ()
 
bool update ()
 
void setMaxFps (int maxFps)
 
bool isFpsLimitActive ()
 
int getMaximumSleepMicros ()
 
float getFrameDelayHit ()
 
int getLastFps ()
 
int getPartialFps ()
 
int getMaxFps ()
 
int getFrames ()
 
float getMediumFrameDelay ()
 

Detailed Description

Class that help counting and limiting frames per second in a application, to make fps limit work as desired, this class requires 2 platforms prerequisites:

  • the platform must have timer with a precision of at least 1ms
  • the platform sleep must have a precision of at least 4ms

Definition at line 34 of file adaptativeframecounter.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MINIMUM_MICROS_SLEEP 

Definition at line 37 of file adaptativeframecounter.h.

Constructor & Destructor Documentation

◆ AdaptativeFrameCounter()

AdaptativeFrameCounter::AdaptativeFrameCounter ( )

Definition at line 26 of file adaptativeframecounter.cpp.

Here is the call graph for this function:

Member Function Documentation

◆ getFrameDelayHit()

float AdaptativeFrameCounter::getFrameDelayHit ( )

Definition at line 110 of file adaptativeframecounter.cpp.

◆ getFrames()

int AdaptativeFrameCounter::getFrames ( )
inline

Definition at line 55 of file adaptativeframecounter.h.

◆ getLastFps()

int AdaptativeFrameCounter::getLastFps ( )
inline

Definition at line 52 of file adaptativeframecounter.h.

Here is the caller graph for this function:

◆ getMaxFps()

int AdaptativeFrameCounter::getMaxFps ( )
inline

Definition at line 54 of file adaptativeframecounter.h.

Here is the caller graph for this function:

◆ getMaximumSleepMicros()

int AdaptativeFrameCounter::getMaximumSleepMicros ( )

Definition at line 103 of file adaptativeframecounter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getMediumFrameDelay()

float AdaptativeFrameCounter::getMediumFrameDelay ( )
inline

Definition at line 56 of file adaptativeframecounter.h.

◆ getPartialFps()

int AdaptativeFrameCounter::getPartialFps ( )
inline

Definition at line 53 of file adaptativeframecounter.h.

◆ isFpsLimitActive()

bool AdaptativeFrameCounter::isFpsLimitActive ( )
inline

Definition at line 48 of file adaptativeframecounter.h.

◆ processNextFrame()

void AdaptativeFrameCounter::processNextFrame ( )

Definition at line 54 of file adaptativeframecounter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setMaxFps()

void AdaptativeFrameCounter::setMaxFps ( int  maxFps)

Definition at line 90 of file adaptativeframecounter.cpp.

Here is the caller graph for this function:

◆ shouldProcessNextFrame()

bool AdaptativeFrameCounter::shouldProcessNextFrame ( )

Definition at line 43 of file adaptativeframecounter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

bool AdaptativeFrameCounter::update ( )

Definition at line 63 of file adaptativeframecounter.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: