GameEngine::GameApp Class Reference

#include <GameApp.h>

Collaboration diagram for GameEngine::GameApp:

Collaboration graph
[legend]
List of all members.

Detailed Description

GameApp is the main game application class and controls the running of the game loop.

Definition at line 42 of file GameApp.h.

Public Member Functions

 GameApp ()
virtual ~GameApp ()
void start ()
void stop ()
Ogre::RenderWindow *const getRenderWindow () const
Ogre::Root *const getRenderer () const

Protected Member Functions

virtual boost::shared_ptr<
BaseGame
createGameAndViews ()=0
virtual void loadGame ()=0
void onUpdate (const double &dt)
void mainLoop ()
bool frameStarted (const Ogre::FrameEvent &evt)
bool frameEnded (const Ogre::FrameEvent &evt)
void setupResources ()
bool loadConfiguration ()

Protected Attributes

EventManagermEventManager
Ogre::Root * mRenderer
Ogre::RenderWindow * mWindow
InputManagermInputManager
SoundManagermSoundManager
boost::shared_ptr< BaseGamemGame
double mTimeSinceLastFrame
bool mRender
bool mInitialised

Static Protected Attributes

static const int TICK_LIMIT = 200


Constructor & Destructor Documentation

GameEngine::GameApp::GameApp (  ) 

Constructor

Definition at line 25 of file GameApp.cpp.

GameEngine::GameApp::~GameApp (  )  [virtual]

Destructor

Definition at line 36 of file GameApp.cpp.


Member Function Documentation

void GameEngine::GameApp::start (  ) 

Start the game

Definition at line 53 of file GameApp.cpp.

void GameEngine::GameApp::stop (  ) 

Stop the game

Definition at line 107 of file GameApp.cpp.

Ogre::RenderWindow* const GameEngine::GameApp::getRenderWindow (  )  const [inline]

Get the window in which the game is displayed

Returns:
the game window

Definition at line 66 of file GameApp.h.

Ogre::Root* const GameEngine::GameApp::getRenderer (  )  const [inline]

Get the main 3D rendering object

Returns:
the 3D rendering object

Definition at line 71 of file GameApp.h.

virtual boost::shared_ptr<BaseGame> GameEngine::GameApp::createGameAndViews (  )  [protected, pure virtual]

Create the game object

Returns:
The game object created

virtual void GameEngine::GameApp::loadGame (  )  [protected, pure virtual]

Load the game

void GameEngine::GameApp::onUpdate ( const double &  dt  )  [protected]

Update the game state and systems, called before each frame is rendered

Parameters:
dt time passed since the last frame was rendered

Definition at line 127 of file GameApp.cpp.

void GameEngine::GameApp::mainLoop (  )  [protected]

The main game loop

Definition at line 113 of file GameApp.cpp.

bool GameEngine::GameApp::frameStarted ( const Ogre::FrameEvent &  evt  )  [protected]

Implementation of Ogre::FrameListener interface, called by Ogre before each frame is rendered

Parameters:
evt The frame event
Returns:
false to tell Ogre to stop rendering, true otherwise

Definition at line 139 of file GameApp.cpp.

bool GameEngine::GameApp::frameEnded ( const Ogre::FrameEvent &  evt  )  [protected]

Implementation of Ogre::FrameListener interface, called by Ogre after each frame is rendered

Parameters:
evt The frame event
Returns:
false to tell Ogre to stop rendering, true otherwise

Definition at line 145 of file GameApp.cpp.

void GameEngine::GameApp::setupResources (  )  [protected]

Prepare for loading of any required game resources

Definition at line 153 of file GameApp.cpp.

bool GameEngine::GameApp::loadConfiguration (  )  [protected]

Load the game config files. Currently this just displays the Ogre config dialog, but an improved version should load directly from a file if possible.

Returns:
true if configuartion was loaded, false if failed / cancelled by user

Definition at line 178 of file GameApp.cpp.


Member Data Documentation

EventManager* GameEngine::GameApp::mEventManager [protected]

Definition at line 75 of file GameApp.h.

Ogre::Root* GameEngine::GameApp::mRenderer [protected]

Definition at line 77 of file GameApp.h.

Ogre::RenderWindow* GameEngine::GameApp::mWindow [protected]

Definition at line 78 of file GameApp.h.

InputManager* GameEngine::GameApp::mInputManager [protected]

Definition at line 80 of file GameApp.h.

SoundManager* GameEngine::GameApp::mSoundManager [protected]

Definition at line 81 of file GameApp.h.

boost::shared_ptr<BaseGame> GameEngine::GameApp::mGame [protected]

Definition at line 83 of file GameApp.h.

double GameEngine::GameApp::mTimeSinceLastFrame [protected]

Definition at line 85 of file GameApp.h.

bool GameEngine::GameApp::mRender [protected]

Definition at line 86 of file GameApp.h.

bool GameEngine::GameApp::mInitialised [protected]

Definition at line 87 of file GameApp.h.

const int GameEngine::GameApp::TICK_LIMIT = 200 [static, protected]

Definition at line 145 of file GameApp.h.


The documentation for this class was generated from the following files:
Generated on Thu Apr 19 09:48:43 2007 for GameEngine by  doxygen 1.5.2