Gamedev Framework (gf)
0.3.0
A C++11 framework for 2D games
|
A collection of models. More...
#include <gf/ModelContainer.h>
Public Member Functions | |
void | update (float dt) |
Update the models. More... | |
void | addModel (Model &model) |
Add a model to the collection. More... | |
Model * | removeModel (Model *model) |
Remove a model from the collection. More... | |
A collection of models.
gf::ModelContainer represents a collection of models that are updated automatically.
The model manager is not responsible for the memory of the models. The models must be allocated by the user and not deleted while they are handled by the model manager.
Generally, you only need one model manager in your game. You create it at the beginning of the game and put all your models in it. Then you can call gf::ModelContainer::update() in your game loop.
void gf::ModelContainer::addModel | ( | Model & | model | ) |
Add a model to the collection.
The model must not be deleted while it is handled by the model manager.
model | A model |
Remove a model from the collection.
model | The model to remove |
nullptr
if the model was not present void gf::ModelContainer::update | ( | float | dt | ) |
Update the models.
dt | The time (in seconds) since the last update |