Nugget
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
psyqo::Scene Class Reference

The Scene class. More...

#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.
 
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 Enumeration Documentation

◆ StartReason

enum class psyqo::Scene::StartReason
strong
Enumerator
Create 
Resume 

◆ TearDownReason

enum class psyqo::Scene::TearDownReason
strong
Enumerator
Destroy 
Pause 

Constructor & Destructor Documentation

◆ ~Scene()

virtual psyqo::Scene::~Scene ( )
virtualdefault

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.

◆ gpu()

psyqo::GPU & psyqo::Scene::gpu ( )
inlineprotected

Alias for Application::gpu().

◆ popScene()

Scene * psyqo::Scene::popScene ( )
inlineprotected

◆ pushScene()

void psyqo::Scene::pushScene ( Scene scene)
inlineprotected

◆ 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.

Friends And Related Symbol Documentation

◆ Application

friend class Application
friend

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