Jamie Slowgrove - PGG Assignment 1 - SDL
 All Classes Functions
Public Member Functions | Protected Attributes | List of all members
State Class Referenceabstract

Creates a State object. Creates a State object to be inherited. Made using information from http://blog.nuclex-games.com/tutorials/cxx/game-state-management/ and Peter Allen. More...

#include <state.h>

Inheritance diagram for State:
Inheritance graph
Collaboration diagram for State:
Collaboration graph

Public Member Functions

 State (StateManager *, SDL_Renderer *)
 
virtual ~State ()
 
virtual bool HandleSDLEvents ()=0
 
virtual void Update (float deltaTime)=0
 
virtual void Draw ()=0
 
std::string GetStateName ()
 

Protected Attributes

StateManagerstateManager
 
SDL_Renderer * renderer
 
std::string name
 

Detailed Description

Creates a State object. Creates a State object to be inherited. Made using information from http://blog.nuclex-games.com/tutorials/cxx/game-state-management/ and Peter Allen.

Constructor & Destructor Documentation

State::State ( StateManager inStateManager,
SDL_Renderer *  inRenderer 
)

Constructs a State object Constructs a State object

Parameters
StateManager* a pointer to the StateManager
SDL_Renderer* a pointer to the renderer in use.
State::~State ( )
virtual

A virtual destructor for the State object A virtual destructor for the State object

Member Function Documentation

virtual void State::Draw ( )
pure virtual

A virtual function to draw to the screen A virtual function to draw to the screen using the renderer

Implemented in GameState, MenuState, WinLoseState, CreditsState, and HelpState.

std::string State::GetStateName ( )

Getter # State name

Returns
the name of the State.
virtual bool State::HandleSDLEvents ( )
pure virtual

A virtual function to handle the SDL events A virtual function to handle the SDL events for use with the State

Returns
bool if false then quit State

Implemented in GameState, MenuState, WinLoseState, CreditsState, and HelpState.

virtual void State::Update ( float  deltaTime)
pure virtual

A virtual function to update the State A virtual function to update the State to allow the State to run

Parameters
floatthe delta time

Implemented in GameState, MenuState, WinLoseState, CreditsState, and HelpState.


The documentation for this class was generated from the following files: