GCP Assignment 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
MainState Class Reference

The main state of the program. More...

#include <MainState.h>

Inheritance diagram for MainState:
Inheritance graph
Collaboration diagram for MainState:
Collaboration graph

Public Member Functions

 MainState (StateManager *stateManager, SDL_Window *window, int screenWidth, int screenHeight)
 Constructs a MainState. More...
 
 ~MainState ()
 Destructs a MainState object. More...
 
bool input ()
 Handles the MainState input. More...
 
void update (float dt)
 A function to update the MainState. More...
 
void draw ()
 A function to draw to the screen. More...
 
- Public Member Functions inherited from State
 State (StateManager *stateManager, SDL_Window *window, int screenWidth, int screenHeight)
 Constructs a State object. More...
 
virtual ~State ()
 A virtual destructor for the State object. More...
 
SDL_Window * getWindow ()
 Gets the window. More...
 

Private Member Functions

void loadingScreen ()
 Draws a LoadingScreen. More...
 
void init10MatQuats ()
 Initialise 10 sets of matrixs and quats. More...
 
void init100MatQuats ()
 Initialise 100 sets of matrixs and quats. More...
 
void init1000MatQuats ()
 Initialise 1000 sets of matrixs and quats. More...
 
void init10000MatQuats ()
 Initialise 10000 sets of matrixs and quats. More...
 
void performanceTest ()
 Runs the performance test. More...
 
void memoryTest ()
 Runs the memory test. More...
 
void xAxisMatRotationTest ()
 Runs the matrix performance test of the X axis. More...
 
void yAxisMatRotationTest ()
 Runs the matrix performance test of the Y axis. More...
 
void zAxisMatRotationTest ()
 Runs the matrix performance test of the Z axis. More...
 
void xAxisQuatRotationTest ()
 Runs the quat performance test of the X axis. More...
 
void yAxisQuatRotationTest ()
 Runs the quat performance test of the Y axis. More...
 
void zAxisQuatRotationTest ()
 Runs the quat performance test of the Z axis. More...
 

Private Attributes

std::unordered_map< std::string, Object * > objects
 
std::unordered_map< std::string, Shader * > shaders
 
MainStateUIuserInterface
 The MainStateUI. More...
 
Samsam
 The 3D model. More...
 
Cameracamera
 The Camera for the program. More...
 
std::vector< Maths::Mat4matrix
 The array of matrix's to use. More...
 
std::vector< Maths::Quaternionquats
 The array of quaternion's to use. More...
 
Core::PerformanceTesttester
 The performance tester. More...
 

Additional Inherited Members

- Protected Attributes inherited from State
StateManagerstateManager
 A pointer to the state manager. More...
 
SDL_Window * window
 The window to display to. More...
 
int screenWidth
 The width of the screen. More...
 
int screenHeight
 The height of the screen. More...
 

Detailed Description

The main state of the program.

Constructor & Destructor Documentation

◆ MainState()

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

Constructs a MainState.

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:

◆ ~MainState()

MainState::~MainState ( )

Destructs a MainState object.

Member Function Documentation

◆ draw()

void MainState::draw ( )
virtual

A function to draw to the screen.

Implements State.

Here is the call graph for this function:

◆ init10000MatQuats()

void MainState::init10000MatQuats ( )
private

Initialise 10000 sets of matrixs and quats.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init1000MatQuats()

void MainState::init1000MatQuats ( )
private

Initialise 1000 sets of matrixs and quats.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init100MatQuats()

void MainState::init100MatQuats ( )
private

Initialise 100 sets of matrixs and quats.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ init10MatQuats()

void MainState::init10MatQuats ( )
private

Initialise 10 sets of matrixs and quats.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ input()

bool MainState::input ( )
virtual

Handles the MainState input.

Returns
If false then quit the MainMenu State.

Implements State.

Here is the call graph for this function:

◆ loadingScreen()

void MainState::loadingScreen ( )
private

Draws a LoadingScreen.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ memoryTest()

void MainState::memoryTest ( )
private

Runs the memory test.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ performanceTest()

void MainState::performanceTest ( )
private

Runs the performance test.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

void MainState::update ( float  dt)
virtual

A function to update the MainState.

Parameters
dtThe delta time.

Implements State.

◆ xAxisMatRotationTest()

void MainState::xAxisMatRotationTest ( )
private

Runs the matrix performance test of the X axis.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ xAxisQuatRotationTest()

void MainState::xAxisQuatRotationTest ( )
private

Runs the quat performance test of the X axis.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yAxisMatRotationTest()

void MainState::yAxisMatRotationTest ( )
private

Runs the matrix performance test of the Y axis.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ yAxisQuatRotationTest()

void MainState::yAxisQuatRotationTest ( )
private

Runs the quat performance test of the Y axis.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zAxisMatRotationTest()

void MainState::zAxisMatRotationTest ( )
private

Runs the matrix performance test of the Z axis.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zAxisQuatRotationTest()

void MainState::zAxisQuatRotationTest ( )
private

Runs the quat performance test of the Z axis.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ camera

Camera* MainState::camera
private

The Camera for the program.

◆ matrix

std::vector<Maths::Mat4> MainState::matrix
private

The array of matrix's to use.

◆ objects

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

The loaded Object files (left over from PGG, not really needed as only have one object and shader but is a lot of work to remove)

◆ quats

std::vector<Maths::Quaternion> MainState::quats
private

The array of quaternion's to use.

◆ sam

Sam* MainState::sam
private

The 3D model.

◆ shaders

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

The loaded Shader files (left over from PGG, not really needed as only have one object and shader but is a lot of work to remove)

◆ tester

Core::PerformanceTest* MainState::tester
private

The performance tester.

◆ userInterface

MainStateUI* MainState::userInterface
private

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