#include <IApplication.h>
Public Member Functions | |
IApplication () | |
Constructor. | |
virtual | ~IApplication () |
Destructor. | |
virtual bool | onLoadWorld ()=0 |
This method is called when loading the game world. | |
virtual void | onUnloadWorld ()=0 |
This method is called when unloading the game world. | |
virtual void | onRenderWorld () |
This method is called when it's time to pass any rendering command to the engine. | |
virtual void | onUpdateWorld (float fElapsedTime)=0 |
This method is called when it's time to update the objects in the game world. | |
bool | loadState (int key, IApplicationState *pState) |
This method is responsible for loading the given IApplicationState along with registering it into our hashtable. | |
void | unloadStates () |
This is an internal method to clean up all the states. | |
IApplicationState * | getCurrentState () |
This just returns the current IApplicationState that the engine is working with. | |
void | setCurrentState (int key) |
Set the current state to the one specified by the key identifier param key - key to set current state to. | |
virtual void | onKeyEvent (SDL_KeyboardEvent *pEvent) |
This method is overrideable to provide quick keyboard access to the current state. | |
virtual void | onMouseEvent (SDL_Event *pEvent) |
This method is overrideable to provide quick mouse access to the current state. | |
Protected Attributes | |
std::map< int, IApplicationState * > | m_oStates |
a hashmap container of our IApplicationState pointers | |
IApplicationState * | m_pCurrentState |
a handle to our current IApplicationState instance |
You should stick state-specific objects into an IApplicationState instance, but any object that needs to be referenced by all the internal states should be thrown into here
|
This just returns the current IApplicationState that the engine is working with.
|
|
This method is responsible for loading the given IApplicationState along with registering it into our hashtable.
|
|
This method is overrideable to provide quick keyboard access to the current state.
|
|
This method is called when loading the game world. In here we should be loading all of the internal IApplicationState instances along with any "global level" objects
|
|
This method is overrideable to provide quick mouse access to the current state.
|
|
This method is called when unloading the game world. Basically any object that we created at a global level should be cleaned up here. Note that the IApplicationState instances are cleanup automatically, so you do not need to worry about them. |
|
This method is called when it's time to update the objects in the game world.
|