AGX Dynamics  2.37.3.2
GraphicsThrottler Class Reference

#include <GraphicsThrottler.h>

Public Member Functions

 GraphicsThrottler (double fps=0.0f)
 Construct a new Graphics Throttler object. More...
 
double getTargetFPS ()
 Get the target fps, if <= 0 no throttling is done. More...
 
void rendered (double wall_clock)
 Reset timer to wall_clock. More...
 
void reset ()
 Reset the last rendered time and start from scratch. More...
 
void setTargetFPS (double fps)
 Set the target fps to a new value. More...
 
bool shouldRenderGraphics (double wall_clock, double timestep, bool auto_reset=true)
 Returns whether rendering should be done or not. More...
 

Detailed Description

Definition at line 19 of file GraphicsThrottler.h.

Constructor & Destructor Documentation

◆ GraphicsThrottler()

GraphicsThrottler::GraphicsThrottler ( double  fps = 0.0f)

Construct a new Graphics Throttler object.

Parameters
fpsTarget frames per second, if <= 0 no throttling will be done

Member Function Documentation

◆ getTargetFPS()

double GraphicsThrottler::getTargetFPS ( )

Get the target fps, if <= 0 no throttling is done.

◆ rendered()

void GraphicsThrottler::rendered ( double  wall_clock)

Reset timer to wall_clock.

Next render will happen 1/fps s from wall_clock

Parameters
wall_clockwallclock time in seconds

◆ reset()

void GraphicsThrottler::reset ( )

Reset the last rendered time and start from scratch.

Next frame will be rendered.

◆ setTargetFPS()

void GraphicsThrottler::setTargetFPS ( double  fps)

Set the target fps to a new value.

Next render will happen 1/fpx s from wall_clock

Parameters
fpstarget frames per second, if <= 0 no throttling will be done

◆ shouldRenderGraphics()

bool GraphicsThrottler::shouldRenderGraphics ( double  wall_clock,
double  timestep,
bool  auto_reset = true 
)

Returns whether rendering should be done or not.

Parameters
wall_clockwallclock time in seconds
auto_resetwhether to perform rendered() call automatically or not.
timestepthe simulation timestep
Returns
true it's time to render
false when it's not time to render

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