State_t Struct Reference
[Operating States]

A set of function pointers to functions that implement an operating state. More...

#include <states.h>


Data Fields

StateFunc init
 The function called to initalize the state.
StateFunc run
 The function called repeatedly to operate the state.
StateFunc uninit
 The function that uninitalizes a state in preperation for changing states or program termination.


Detailed Description

A set of function pointers to functions that implement an operating state.

Author:
Jeff Jackowski

Definition at line 122 of file states.h.


Field Documentation

StateFunc State_t::init

The function called to initalize the state.

It will be called before the run function. It can be set to NULL if no initalization is required.

Returns:
STATE_CODES::STATE_OK if the initialization succeeded, otherwise another state code for the next state or an error condition.

Definition at line 129 of file states.h.

Referenced by RunState().

StateFunc State_t::run

The function called repeatedly to operate the state.

It is expected to capture and respond to events, render graphics, and deal with frame rate issues.

Returns:
A value defined in STATE_CODES for the next state, a non-recoverable error, or program termination. If the next state is the current state, the state's init and uninit functions will not be called.

Definition at line 139 of file states.h.

Referenced by RunState().

StateFunc State_t::uninit

The function that uninitalizes a state in preperation for changing states or program termination.

It can be set to NULL if no uninitalization is required. If the state's run function ended with a non-recoverable error, its uninitalize function will still be called.

Returns:
STATE_CODES::STATE_OK on success, anything else on failure.

Definition at line 147 of file states.h.

Referenced by RunState().


The documentation for this struct was generated from the following file:
Generated on Mon May 28 04:41:44 2007 for Retro Tank Super Attack by  doxygen 1.5.2