Engine::Scene Class Reference

A scene is something that occupies a MainLoop. More...

#include <Scene.h>

Inheritance diagram for Engine::Scene:

Engine::GameScene Engine::LoadScene< T, Q > UI::CarSelectScene UI::TitleScene List of all members.

Public Member Functions

 Scene ()
virtual ~Scene ()
virtual void take_input (InputReport &report)=0
 Take input from an input device.
virtual void update_logic (unsigned int milliseconds_elapsed)=0
 Process any status changes that occur due to elapsed time.
virtual void draw ()=0
 Draw the scene using OpenGL commands.
virtual void do_sound ()=0
 Update the audio.
virtual void attach_main_loop (MainLoop &main_loop)
 Attach a Main loop object.

Protected Attributes

MainLoopmain_loop
 pointer to the main_loop to contact if we should end.

Detailed Description

A scene is something that occupies a MainLoop.

It should update it self every frame depending on the time taken, and respond to user input. It will also get to draw things every frame.

Only one Scene may be active in a MainLoop at any one time.

Definition at line 28 of file Scene.h.


Constructor & Destructor Documentation

Engine::Scene::Scene (  ) 

Definition at line 17 of file Scene.cpp.

Engine::Scene::~Scene (  )  [virtual]

Definition at line 21 of file Scene.cpp.


Member Function Documentation

void Engine::Scene::attach_main_loop ( MainLoop main_loop  )  [virtual]

Attach a Main loop object.

If the scene wishes to end, it can notify the main loop obect by calling exit.

Reimplemented in UI::TitleScene.

Definition at line 25 of file Scene.cpp.

virtual void Engine::Scene::do_sound (  )  [pure virtual]

Update the audio.

Implemented in Engine::GameScene, Engine::LoadScene< T, Q >, UI::CarSelectScene, UI::TitleScene, and Engine::LoadScene< Engine::GameScene, Engine::ReplayReader >.

virtual void Engine::Scene::draw (  )  [pure virtual]

Draw the scene using OpenGL commands.

Must go from any state to ready for a buffer swap.

Implemented in Engine::GameScene, Engine::LoadScene< T, Q >, UI::CarSelectScene, UI::TitleScene, and Engine::LoadScene< Engine::GameScene, Engine::ReplayReader >.

virtual void Engine::Scene::take_input ( InputReport report  )  [pure virtual]

Take input from an input device.

Parameters:
report An input report, which may be freed immediately after the call returns.

Implemented in Engine::GameScene, Engine::LoadScene< T, Q >, UI::CarSelectScene, UI::TitleScene, and Engine::LoadScene< Engine::GameScene, Engine::ReplayReader >.

virtual void Engine::Scene::update_logic ( unsigned int  milliseconds_elapsed  )  [pure virtual]

Process any status changes that occur due to elapsed time.

Parameters:
milliseconds_elapsed time in milliseconds since last update_logic.

Implemented in Engine::GameScene, Engine::LoadScene< T, Q >, UI::CarSelectScene, UI::TitleScene, and Engine::LoadScene< Engine::GameScene, Engine::ReplayReader >.


Member Data Documentation

MainLoop* Engine::Scene::main_loop [protected]

pointer to the main_loop to contact if we should end.

Definition at line 60 of file Scene.h.


The documentation for this class was generated from the following files:
Get Racer at SourceForge.net. Fast, secure and Free Open Source software downloads

Generated at Mon Sep 6 00:41:17 2010 by Doxygen version 1.4.7 for Racer version svn335.