Alpha Engine: AEGameStateMgr.h File Reference

AlphaEngine

AEGameStateMgr.h File Reference

Header file for the game state manager. More...

Go to the source code of this file.

Macros

#define AE_GS_RESTART   0xFFFFFFFE
 Special GameState: Restart. More...
 
#define AE_GS_QUIT   0xFFFFFFFF
 Special GameState: Quit. More...
 

Functions

void AEGameStateMgrAdd (u32 gameStateIdx, void(*pLoad)(), void(*pInit)(), void(*pUpdate)(), void(*pDraw)(), void(*pFree)(), void(*pUnload)())
 Create a new GameState and add it to GameStateManager. More...
 
void AEGameStateMgrInit (u32 gameStateInit)
 Initialize the GameStateManager. More...
 
void AEGameStateMgrUpdate ()
 Update the GameStateManager. More...
 

Variables

u32 gAEGameStateInit
 Initial GameState. More...
 
u32 gAEGameStateCurr
 Current GameState. More...
 
u32 gAEGameStatePrev
 Previous GameState. More...
 
u32 gAEGameStateNext
 Next GameState. More...
 
void(* AEGameStateLoad )(void)
 Function pointer for load. More...
 
void(* AEGameStateInit )(void)
 Function pointer for init. More...
 
void(* AEGameStateUpdate )(void)
 Function pointer for update. More...
 
void(* AEGameStateDraw )(void)
 Function pointer for draw. More...
 
void(* AEGameStateFree )(void)
 Function pointer for free. More...
 
void(* AEGameStateUnload )(void)
 Function pointer for unload. More...
 

Detailed Description

Header file for the game state manager.

Project: Alpha Engine
Author
Sun Tjen Fam
Date
October 10, 2007
Copyright
Copyright (C) 2013 DigiPen Institute of Technology. Reproduction or disclosure of this file or its contents without the prior written consent of DigiPen Institute of Technology is prohibited.

Definition in file AEGameStateMgr.h.

Macro Definition Documentation

#define AE_GS_QUIT   0xFFFFFFFF

Special GameState: Quit.

Definition at line 24 of file AEGameStateMgr.h.

#define AE_GS_RESTART   0xFFFFFFFE

Special GameState: Restart.

Definition at line 23 of file AEGameStateMgr.h.

Function Documentation

void AEGameStateMgrAdd ( u32  gameStateIdx,
void(*)()  pLoad,
void(*)()  pInit,
void(*)()  pUpdate,
void(*)()  pDraw,
void(*)()  pFree,
void(*)()  pUnload 
)

Create a new GameState and add it to GameStateManager.

The new GameState is identified as gameStateIdx and will contain the 6 function pointers passed in.

Parameters
[in]gameStateIdxID of the newly created GameState.
[in]pLoadFunction pointer to the load function of the new GameState.
[in]pInitFunction pointer to the init function of the new GameState.
[in]pUpdateFunction pointer to the update function of the new GameState.
[in]pDrawFunction pointer to the draw function of the new GameState.
[in]pFreeFunction pointer to the free function of the new GameState.
[in]pUnloadFunction pointer to the unload function of the new GameState.
Return values
voidNo return.
void AEGameStateMgrInit ( u32  gameStateInit)

Initialize the GameStateManager.

Set the initial GameState and start the GameStateManager with that GameState.

Warning
This function should be called AFTER all the GameStates have been added to the GameStateManager.
Parameters
[in]gameStateInitID of the initial GameState.
Return values
voidNo return.
void AEGameStateMgrUpdate ( )

Update the GameStateManager.

Call this function when the GameState changes to set the function pointers for the new state.

Return values
voidNo return.

Variable Documentation

void(* AEGameStateDraw)(void)

Function pointer for draw.

void(* AEGameStateFree)(void)

Function pointer for free.

void(* AEGameStateInit)(void)

Function pointer for init.

void(* AEGameStateLoad)(void)

Function pointer for load.

void(* AEGameStateUnload)(void)

Function pointer for unload.

void(* AEGameStateUpdate)(void)

Function pointer for update.

u32 gAEGameStateCurr

Current GameState.

u32 gAEGameStateInit

Initial GameState.

u32 gAEGameStateNext

Next GameState.

u32 gAEGameStatePrev

Previous GameState.

Generated on Sat Jan 4 2014 02:06:22 for Alpha Engine by   doxygen 1.8.5