GCP Assignment 1
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
UI Class Referenceabstract

A class for the 2D user interfaces. More...

#include <UI.h>

Inheritance diagram for UI:
Inheritance graph
Collaboration diagram for UI:
Collaboration graph

Public Member Functions

 UI (std::string vertexShaderFileName, std::string fragmentShaderFileName, std::unordered_map< std::string, Shader *> &shaders)
 Constructs the UI object. More...
 
 UI (std::unordered_map< std::string, Shader *> &shaders)
 Constructs the UI object. More...
 
 ~UI ()
 Destructs the UI object. More...
 
virtual void update (float dt)=0
 A pure virtual function to update the UI. More...
 
virtual void draw ()=0
 A pure virtual function to draw to the screen. More...
 

Protected Member Functions

void initialiseShaders (std::string vertexShaderFileName, std::string fragmentShaderFileName, std::unordered_map< std::string, Shader *> &shaders)
 Initialise the shaders. More...
 

Protected Attributes

Shadershader
 The shader for the UI. More...
 

Detailed Description

A class for the 2D user interfaces.

Constructor & Destructor Documentation

◆ UI() [1/2]

UI::UI ( std::string  vertexShaderFileName,
std::string  fragmentShaderFileName,
std::unordered_map< std::string, Shader *> &  shaders 
)

Constructs the UI object.

Parameters
vertexShaderFileNameThe name of the vertex shader file.
fragmentShaderFileNameThe name of the fragment shader file.
shadersA reference to the loaded Shader files
Here is the call graph for this function:

◆ UI() [2/2]

UI::UI ( std::unordered_map< std::string, Shader *> &  shaders)

Constructs the UI object.

Parameters
shadersA reference to the loaded Shader files
Here is the call graph for this function:

◆ ~UI()

UI::~UI ( )

Destructs the UI object.

Member Function Documentation

◆ draw()

virtual void UI::draw ( )
pure virtual

A pure virtual function to draw to the screen.

Implemented in LoadingScreen, and MainStateUI.

◆ initialiseShaders()

void UI::initialiseShaders ( std::string  vertexShaderFileName,
std::string  fragmentShaderFileName,
std::unordered_map< std::string, Shader *> &  shaders 
)
protected

Initialise the shaders.

Parameters
vertexShaderFileNameThe name of the vertex shader file.
fragmentShaderFileNameThe name of the fragment shader file.
shadersA reference to the loaded Shader files
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update()

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

A pure virtual function to update the UI.

Parameters
dtThe delta time.

Implemented in LoadingScreen, and MainStateUI.

Member Data Documentation

◆ shader

Shader* UI::shader
protected

The shader for the UI.


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