Nugget
|
#include <psyqo/scene.hh>
Public Types | |
enum class | StartReason { Create , Resume } |
enum class | TearDownReason { Destroy , Pause } |
Public Member Functions | |
virtual void | start (StartReason reason) |
Starts the scene. | |
virtual void | frame () |
Renders a frame. | |
virtual void | teardown (TearDownReason reason) |
Tears down the scene. | |
virtual | ~Scene ()=default |
Protected Member Functions | |
void | pushScene (Scene *scene) |
Alias for Application::pushScene . | |
Scene * | popScene () |
Alias for Application::popScene . | |
psyqo::GPU & | gpu () |
Alias for Application::gpu() . | |
Friends | |
class | Application |
The Scene class.
This class is the base class for all scenes. Rendering is supposed to be done by the scenes. Only one scene can be active at a time. There is a helper stack system for managing the scenes. See the Application
class for more information.
|
strong |
|
strong |
|
virtualdefault |
|
inlinevirtual |
Renders a frame.
This method will be called when the scene is active, every time a new frame is to be rendered.
|
inlineprotected |
Alias for Application::gpu()
.
|
inlineprotected |
Alias for Application::popScene
.
Alias for Application::pushScene
.
|
inlinevirtual |
Starts the scene.
This method will be called when the scene is started. It is meant to set the environment in a suitable manner. A scene starts when it becomes the active scene, either when being pushed or when the previous scene is popped. The argument will indicate whether the scene is started because it just got pushed, or because another one is getting popped.
reason | The reason why the scene is started. Create or Resume. |
|
inlinevirtual |
Tears down the scene.
This method will be called when the scene is no longer the active scene. It is meant to clean up the environment, basically reversing the effects of start
. The argument will indicate whether the scene is being popped, or if another scene is pushed on the stack.
reason | The reason why the scene is being torn down. DESTROY or PAUSE. |
|
friend |