Nugget
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
psyqo::Scene Class Reference

The Scene class. More...

#include <scene.hh>

Inheritance diagram for psyqo::Scene:
Inheritance graph
[legend]

Public Types

enum class  StartReason { Create , Resume }
 
enum class  TearDownReason { Destroy , Pause }
 

Public Member Functions

virtual void start (StartReason reason)
 Starts the scene. More...
 
virtual void frame ()
 Renders a frame. More...
 
virtual void teardown (TearDownReason reason)
 Tears down the scene. More...
 

Protected Member Functions

void pushScene (Scene *scene)
 Alias for Application::pushScene.
 
ScenepopScene ()
 Alias for Application::popScene.
 
psyqo::GPUgpu ()
 Alias for Application::gpu().
 

Friends

class Application
 

Detailed Description

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.

Member Function Documentation

◆ frame()

virtual void psyqo::Scene::frame ( )
inlinevirtual

Renders a frame.

This method will be called when the scene is active, every time a new frame is to be rendered.

◆ start()

virtual void psyqo::Scene::start ( StartReason  reason)
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.

Parameters
reasonThe reason why the scene is started. Create or Resume.

◆ teardown()

virtual void psyqo::Scene::teardown ( TearDownReason  reason)
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.

Parameters
reasonThe reason why the scene is being torn down. DESTROY or PAUSE.

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