Gamedev Framework (gf)  0.11.0
A C++14 framework for 2D games
Public Member Functions | List of all members
gf::FixedTimestepModel Class Reference

Fixed timestep model. More...

#include <gf/Models.h>

Inheritance diagram for gf::FixedTimestepModel:
Inheritance graph

Public Member Functions

 FixedTimestepModel (Model &model, Time timestep=gf::seconds(1/60.0f))
 Constructor. More...
virtual void update (Time time) override
 Update the model's state. More...
- Public Member Functions inherited from gf::Model
virtual ~Model ()
 Destructor. More...

Detailed Description

Fixed timestep model.

This model takes another model that needs a fixed timestep and provides it event if the original timestep is not fixed. This may be useful for physics model, for example.

Constructor & Destructor Documentation

◆ FixedTimestepModel()

gf::FixedTimestepModel::FixedTimestepModel ( Model model,
Time  timestep = gf::seconds(1/60.0f) 


modelThe original model
timestepThe fixed timestep

Member Function Documentation

◆ update()

virtual void gf::FixedTimestepModel::update ( Time  time)

Update the model's state.

Models are updated each frame. The time between two frames is given as a parameter to help in the update. This time is in seconds.

timeThe time since the last update
See also

Reimplemented from gf::Model.