Jamie Slowgrove - PGG Assignment 2
 All Classes Namespaces Files Functions Variables Typedefs Macros
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MainMenu Class Reference

Creates an MainMenu object that inherits State and runs the MainMenu. More...

#include <MainMenu.h>

Inheritance diagram for MainMenu:
Inheritance graph
Collaboration diagram for MainMenu:
Collaboration graph

Public Member Functions

 MainMenu (StateManager *stateManager, SDL_Window *window, int screenWidth, int screenHeight)
 
 ~MainMenu ()
 
bool input ()
 
void update (float dt)
 
void draw ()
 
- Public Member Functions inherited from State
 State (StateManager *stateManager, SDL_Window *window, int screenWidth, int screenHeight)
 
virtual ~State ()
 
SDL_Window * getWindow ()
 

Private Member Functions

void loadingScreen ()
 

Private Attributes

std::unordered_map
< std::string, Object * > 
objects
 
std::unordered_map
< std::string, Shader * > 
shaders
 
Audiomusic
 
MenuEntitysam
 
Cameracamera
 
MainMenuUIuserInterface
 
glm::vec2 mouse
 
int playKey
 
int credKey
 
int exitKey
 
int pressed
 
std::vector< ParticleEffect * > particleEffects
 

Additional Inherited Members

- Protected Attributes inherited from State
StateManagerstateManager
 
SDL_Window * window
 
int screenWidth
 
int screenHeight
 

Detailed Description

Creates an MainMenu object that inherits State and runs the MainMenu.

Author
Jamie Slowgrove DISCLAMER - This uses bits from my PGG assignment 1 menu class.

Constructor & Destructor Documentation

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

Constructs a MainMenu object.

Parameters
stateManagerA pointer to the StateManager.
windowA pointer to the window.
screenWidthThe screen width.
screenHeightThe screen height.

Here is the call graph for this function:

MainMenu::~MainMenu ( )

Destructs an MainMenu object.

Here is the call graph for this function:

Member Function Documentation

void MainMenu::draw ( )
virtual

A function to draw to the screen.

Implements State.

Here is the call graph for this function:

bool MainMenu::input ( )
virtual

Handles the MainMenu input.

Returns
If false then quit the MainMenu State.

Implements State.

Here is the call graph for this function:

void MainMenu::loadingScreen ( )
private

Draws a LoadingScreen.

Here is the call graph for this function:

Here is the caller graph for this function:

void MainMenu::update ( float  dt)
virtual

A function to update the MainMenu.

Parameters
dtThe delta time.

Implements State.

Here is the call graph for this function:

Member Data Documentation

Camera* MainMenu::camera
private

The Camera for the MainMenu

int MainMenu::credKey
private
int MainMenu::exitKey
private
glm::vec2 MainMenu::mouse
private

Current Mouse position

Audio* MainMenu::music
private

The background music

std::unordered_map<std::string, Object*> MainMenu::objects
private

The loaded Object files

std::vector<ParticleEffect*> MainMenu::particleEffects
private

The ParticleEffects for the main menu

int MainMenu::playKey
private

variables for if menu keys are highlighted, can be 0 or 1

int MainMenu::pressed
private

which key is pressed, 0 for none

MenuEntity* MainMenu::sam
private

The Entities

std::unordered_map<std::string, Shader*> MainMenu::shaders
private

The loaded Shader files

MainMenuUI* MainMenu::userInterface
private

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