Jamie Slowgrove - MGP Assignment 2 - JAM
 All Classes Namespaces Files Functions Variables Macros
Public Member Functions | Protected Attributes | List of all members
JAM_State Class Referenceabstract

Creates a State object. Creates a State object to be inherited. More...

#include <State.h>

Inheritance diagram for JAM_State:
Inheritance graph
Collaboration diagram for JAM_State:
Collaboration graph

Public Member Functions

 JAM_State (JAM_StateManager *stateManager, SDL_Renderer *renderer, int screenWidth, int screenHeight)
 
virtual ~JAM_State ()
 
virtual bool input ()=0
 
virtual void update (float deltaTime)=0
 
virtual void draw ()=0
 

Protected Attributes

JAM_StateManagerstateManager
 
SDL_Renderer * renderer
 
int screenWidth
 
int screenHeight
 

Detailed Description

Creates a State object. Creates a State object to be inherited.

Author
Jamie Slowgrove Reference ~ This is a modified version of my PGG Assignment 1 State class.

Constructor & Destructor Documentation

JAM_State::JAM_State ( JAM_StateManager stateManager,
SDL_Renderer *  renderer,
int  screenWidth,
int  screenHeight 
)

Constructs the State object.

Parameters
stateManagerA pointer to the StateManager.
rendererA pointer to the renderer in use.
screenWidthThe screen width.
screenHeightThe screen height.
JAM_State::~JAM_State ( )
virtual

A virtual destructor for the State object.

Member Function Documentation

virtual void JAM_State::draw ( )
pure virtual

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

Implemented in Game.

virtual bool JAM_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.

virtual void JAM_State::update ( float  deltaTime)
pure virtual

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

Parameters
dtThe delta time.

Implemented in Game.

Member Data Documentation

SDL_Renderer* JAM_State::renderer
protected

The render to display to.

int JAM_State::screenHeight
protected

The height of the screen.

int JAM_State::screenWidth
protected

The width of the screen.

JAM_StateManager* JAM_State::stateManager
protected

A pointer to the state manager.


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