System manager for saving and accessing external shader resources. More...

#include <ShaderAssets.h>

Detailed Description

System manager for saving and accessing external shader resources.

The ShaderAssets is a singleton that allows the user to resuse saved external shader resources throughout their project.

Shaders are saved via the Load() functions in the IonEngine::LoadResources() function. They can then be accessed by using the Get() functions and the associated key that the user defined upon loading.

Public Types

typedef std::string ShaderKey
 

Static Public Member Functions

static void Load (const ShaderKey &Shader_Map_Key, ShaderBase *Shader)
 Function saves a shader created from the desired path. More...
 
static ShaderBase * Get (const ShaderKey &Shader_Map_Key)
 Function returns shader pointer based off of the passed in key. More...
 

Member Typedef Documentation

typedef std::string ShaderAssets::ShaderKey

Typedef of an std::string for an easier to read name.

Member Function Documentation

static ShaderBase* ShaderAssets::Get ( const ShaderKey Shader_Map_Key)
inlinestatic

Function returns shader pointer based off of the passed in key.

This Get() function uses it's Shader_Map_Key parameter to search the shader map and return the shader saved under the same key string.

Parameters
Shader_Map_KeyAn std::string for use as a key to access the stored shader
Returns
Pointer to shader at stored key
static void ShaderAssets::Load ( const ShaderKey Shader_Map_Key,
ShaderBase *  Shader 
)
inlinestatic

Function saves a shader created from the desired path.

This Load() function stores a shader pointer in the ShaderAssets map. The Shader_Map_Key parameter is a key string for access later when using the Get() command.

Parameters
Shader_Map_KeyAn std::string for use as a storage key
ShaderA ShaderBase pointer to store