![]() |
Gamedev Framework (gf)
0.14.0
A C++14 framework for 2D games
|
A scene manager. More...
#include <gf/SceneManager.h>
Public Member Functions | |
SceneManager (StringRef title, Vector2i size) | |
Constructor. More... | |
void | run () |
Run the scene manager until completion. More... | |
void | pushScene (Scene &scene) |
Add a scene on top of the stack. More... | |
void | popScene () |
Remove the top scene from the non-empty stack. More... | |
void | replaceScene (Scene &scene) |
Replace the top scene with a new scene. More... | |
const RenderTarget & | getRenderer () const |
Get the renderer associated to the scene. More... | |
A scene manager.
A scene manager handles several scenes, organised into a stack. It has a window and a renderer and use them to handle the scenes.
The top of the stack is the active scene. The manager runs the active scene while the stack is not empty. All the scene in the stack receive inputs, are updated and are rendered, beginning from the base of the stack until the top.
Constructor.
title | The title of the window |
size | The size of the window |
|
inline |
Get the renderer associated to the scene.
void gf::SceneManager::popScene | ( | ) |
Remove the top scene from the non-empty stack.
void gf::SceneManager::pushScene | ( | Scene & | scene | ) |
Add a scene on top of the stack.
scene | The scene to add |
|
inline |
Replace the top scene with a new scene.
It is equivalent to popping the current top scene and pushing the new scene.
scene | The scene to add |
void gf::SceneManager::run | ( | ) |
Run the scene manager until completion.