Level H Engine
Static Public Member Functions | Static Private Attributes | List of all members
ResourceManager Class Reference

Contains static variables and functions for use with resource manager. More...

#include <ResourceManager.h>

Collaboration diagram for ResourceManager:
Collaboration graph

Static Public Member Functions

static void deleteResources ()
 A static function to delete all the resources. More...
 
static void deleteAllMeshes ()
 A static function to delete all the meshes. More...
 
static void deleteAllShaders ()
 A static function to delete all the shaders. More...
 
static void deleteAllAudio ()
 A static function to delete all the audio. More...
 
static void deleteAllMusic ()
 A static function to delete all the music. More...
 
static void deleteAllSprites ()
 A static function to delete all the sprites. More...
 
static void deleteMesh (std::string id)
 A static function to delete the mesh. More...
 
static void deleteShader (std::string id)
 A static function to delete the shader. More...
 
static void deleteMusic (std::string id)
 A static function to delete the music. More...
 
static void deleteAudio (std::string id)
 A static function to delete the audio. More...
 
static void deleteSprite (std::string id)
 A static function to delete the sprite. More...
 
static void stopMusic (std::string id)
 A static function to stop the music. More...
 
static void stopAllMusic ()
 A static function to stop all music. More...
 
static std::string initialiseHeightmap (std::string heightmapFileName)
 A static function to initialise a heightmap. More...
 
static std::string initialiseHeightmap (std::string heightmapFileName, std::string textureFileName)
 A static function to initialise a heightmap. More...
 
static std::string initialisePrimitive (Primitives::PrimativeType primType)
 A static function to initialise a primative. More...
 
static std::string initialiseMesh (std::string objFileName)
 A static function to initialise a mesh without a texture. More...
 
static std::string initialiseMesh (std::string objFileName, std::string textureFileName)
 A static function to initialise a mesh. More...
 
static std::string initialiseShader (std::string vertexShaderFileName, std::string fragmentShaderFileName)
 A static function to initialise a shader. More...
 
static std::string initialiseAudio (std::string audioFileName)
 A static function to initialise an audio file. More...
 
static std::string initialiseMusic (std::string musicFileName)
 A static function to initialise a music file. More...
 
static std::string initialiseSprite (std::string spriteFileName)
 A static function to initialise a sprite. More...
 
static MeshgetMesh (std::string id)
 A static function to get a mesh. More...
 
static ShadergetShaders (std::string id)
 A static function to get an shaders. More...
 
static AudiogetAudio (std::string id)
 A static function to get an audio. More...
 
static MusicgetMusic (std::string id)
 A static function to get an music. More...
 
static SpritegetSprite (std::string id)
 A static function to get a sprite. More...
 

Static Private Attributes

static std::unordered_map< std::string, Mesh * > meshes
 The loaded Mesh files. More...
 
static std::unordered_map< std::string, Shader * > shaders
 The loaded Shader files. More...
 
static std::unordered_map< std::string, Audio * > audio
 The loaded Audio files. More...
 
static std::unordered_map< std::string, Music * > music
 The loaded Music files. More...
 
static std::unordered_map< std::string, Sprite * > sprites
 The loaded Sprite files. More...
 

Detailed Description

Contains static variables and functions for use with resource manager.

Member Function Documentation

◆ deleteAllAudio()

void ResourceManager::deleteAllAudio ( )
static

A static function to delete all the audio.

Here is the caller graph for this function:

◆ deleteAllMeshes()

void ResourceManager::deleteAllMeshes ( )
static

A static function to delete all the meshes.

Here is the caller graph for this function:

◆ deleteAllMusic()

void ResourceManager::deleteAllMusic ( )
static

A static function to delete all the music.

Here is the caller graph for this function:

◆ deleteAllShaders()

void ResourceManager::deleteAllShaders ( )
static

A static function to delete all the shaders.

Here is the caller graph for this function:

◆ deleteAllSprites()

void ResourceManager::deleteAllSprites ( )
static

A static function to delete all the sprites.

Here is the caller graph for this function:

◆ deleteAudio()

static void ResourceManager::deleteAudio ( std::string  id)
inlinestatic

A static function to delete the audio.

Parameters
idThe ID of the file.

◆ deleteMesh()

static void ResourceManager::deleteMesh ( std::string  id)
inlinestatic

A static function to delete the mesh.

Parameters
idThe ID of the file.

◆ deleteMusic()

static void ResourceManager::deleteMusic ( std::string  id)
inlinestatic

A static function to delete the music.

Parameters
idThe ID of the file.

◆ deleteResources()

void ResourceManager::deleteResources ( )
static

A static function to delete all the resources.

Here is the call graph for this function:

◆ deleteShader()

static void ResourceManager::deleteShader ( std::string  id)
inlinestatic

A static function to delete the shader.

Parameters
idThe ID of the file.

◆ deleteSprite()

static void ResourceManager::deleteSprite ( std::string  id)
inlinestatic

A static function to delete the sprite.

Parameters
idThe ID of the file.
Here is the call graph for this function:

◆ getAudio()

static Audio* ResourceManager::getAudio ( std::string  id)
inlinestatic

A static function to get an audio.

Parameters
idThe ID of the file.
Here is the caller graph for this function:

◆ getMesh()

static Mesh* ResourceManager::getMesh ( std::string  id)
inlinestatic

A static function to get a mesh.

Parameters
idThe ID of the file.
Here is the caller graph for this function:

◆ getMusic()

static Music* ResourceManager::getMusic ( std::string  id)
inlinestatic

A static function to get an music.

Parameters
idThe ID of the file.
Here is the caller graph for this function:

◆ getShaders()

static Shader* ResourceManager::getShaders ( std::string  id)
inlinestatic

A static function to get an shaders.

Parameters
idThe ID of the file.
Here is the caller graph for this function:

◆ getSprite()

static Sprite* ResourceManager::getSprite ( std::string  id)
inlinestatic

A static function to get a sprite.

Parameters
idThe ID of the file.
Here is the caller graph for this function:

◆ initialiseAudio()

std::string ResourceManager::initialiseAudio ( std::string  audioFileName)
static

A static function to initialise an audio file.

Parameters
audioFileNameThe name of the audio file.
Returns
The ID of the loaded file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialiseHeightmap() [1/2]

std::string ResourceManager::initialiseHeightmap ( std::string  heightmapFileName)
static

A static function to initialise a heightmap.

Parameters
heightmapFileNameThe name of the heightmap file.
Returns
The ID of the loaded file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialiseHeightmap() [2/2]

std::string ResourceManager::initialiseHeightmap ( std::string  heightmapFileName,
std::string  textureFileName 
)
static

A static function to initialise a heightmap.

Parameters
heightmapFileNameThe name of the heightmap file.
textureFileNameThe name of the heightmap texture file.
Returns
The ID of the loaded file.
Here is the call graph for this function:

◆ initialiseMesh() [1/2]

std::string ResourceManager::initialiseMesh ( std::string  objFileName)
static

A static function to initialise a mesh without a texture.

Parameters
objFileNameThe name of the obj file.
Returns
The ID of the loaded file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialiseMesh() [2/2]

std::string ResourceManager::initialiseMesh ( std::string  objFileName,
std::string  textureFileName 
)
static

A static function to initialise a mesh.

Parameters
objFileNameThe name of the obj file.
materialFileNameThe name of the texture
Returns
The ID of the loaded file.
Here is the call graph for this function:

◆ initialiseMusic()

std::string ResourceManager::initialiseMusic ( std::string  musicFileName)
static

A static function to initialise a music file.

Parameters
musicFileNameThe name of the music file.
Returns
The ID of the loaded file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialisePrimitive()

std::string ResourceManager::initialisePrimitive ( Primitives::PrimativeType  primType)
static

A static function to initialise a primative.

Parameters
primTypeThe primitive type to use.
Returns
The ID of the loaded file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialiseShader()

std::string ResourceManager::initialiseShader ( std::string  vertexShaderFileName,
std::string  fragmentShaderFileName 
)
static

A static function to initialise a shader.

Parameters
vertexShaderFileNameThe name of the vertex shader file.
fragmentShaderFileNameThe name of the fragment shader file.
Returns
The ID of the loaded file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ initialiseSprite()

std::string ResourceManager::initialiseSprite ( std::string  spriteFileName)
static

A static function to initialise a sprite.

Parameters
spriteFileNameThe name of the sprite.
Returns
The ID of the loaded file.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ stopAllMusic()

void ResourceManager::stopAllMusic ( )
static

A static function to stop all music.

Here is the caller graph for this function:

◆ stopMusic()

void ResourceManager::stopMusic ( std::string  id)
static

A static function to stop the music.

Parameters
idThe ID of the file.
Here is the caller graph for this function:

Member Data Documentation

◆ audio

std::unordered_map< std::string, Audio * > ResourceManager::audio
staticprivate

The loaded Audio files.

◆ meshes

std::unordered_map< std::string, Mesh * > ResourceManager::meshes
staticprivate

The loaded Mesh files.

◆ music

std::unordered_map< std::string, Music * > ResourceManager::music
staticprivate

The loaded Music files.

◆ shaders

std::unordered_map< std::string, Shader * > ResourceManager::shaders
staticprivate

The loaded Shader files.

◆ sprites

std::unordered_map< std::string, Sprite * > ResourceManager::sprites
staticprivate

The loaded Sprite files.


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