Jamie Slowgrove - PGG Assignment 2
 All Classes Namespaces Files Functions Variables Typedefs Macros
Public Member Functions | Protected Attributes | List of all members
State Class Referenceabstract

Creates a State object. Creates a State object to be inherited. DISCLAMER - This is a modified version of my PGG Assignment 1 state class. More...

#include <State.h>

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

Public Member Functions

 State (StateManager *stateManager, SDL_Window *window, int screenWidth, int screenHeight)
 
virtual ~State ()
 
virtual bool input ()=0
 
virtual void update (float dt)=0
 
virtual void draw ()=0
 
SDL_Window * getWindow ()
 

Protected Attributes

StateManagerstateManager
 
SDL_Window * window
 
int screenWidth
 
int screenHeight
 

Detailed Description

Creates a State object. Creates a State object to be inherited. DISCLAMER - This is a modified version of my PGG Assignment 1 state class.

Author
Jamie Slowgrove

Constructor & Destructor Documentation

State::State ( StateManager stateManager,
SDL_Window *  window,
int  screenWidth,
int  screenHeight 
)

Constructs a State object.

Parameters
stateManagerA pointer to the StateManager.
windowA pointer to the window in use.
screenWidthThe screen width.
screenHeightThe screen height.
State::~State ( )
virtual

A virtual destructor for the State object.

Member Function Documentation

virtual void State::draw ( )
pure virtual

A pure virtual function to draw to the screen using the window.

Implemented in Game, MainMenu, EndGame, Credits, and Help.

SDL_Window * State::getWindow ( )

Getter # Gets the window

Returns
A pointer to the window
virtual bool State::input ( )
pure virtual

A pure virtual function to handle the user input for use with the State.

Returns
If false then quit State.

Implemented in Game, MainMenu, EndGame, Credits, and Help.

virtual void State::update ( float  dt)
pure virtual

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

Parameters
dtThe delta time.

Implemented in Game, MainMenu, EndGame, Credits, and Help.

Member Data Documentation

int State::screenHeight
protected

The height of the screen

int State::screenWidth
protected

The width of the screen

StateManager* State::stateManager
protected

A pointer to the state manager

SDL_Window* State::window
protected

The window to display to


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