SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
ShaderManager Class Reference

Manages the loading, retrieval, and deletion of ShaderObject objects. More...

#include <ShaderManager.h>

Static Public Member Functions

static ShaderObject * Get (const std::string &key)
 Retrieves a ShaderObject object by its key.
 
static void Load (const std::string &key, const std::string &path)
 Loads a ShaderObject object from a file path.
 

Static Public Attributes

static const std::string defaultSpriteShaderKey = AssetDefaults::DefaultSpriteShaderKey
 Default key for sprite shaders.
 

Private Member Functions

 ShaderManager (const ShaderManager &)=delete
 
ShaderManageroperator= (const ShaderManager &)=delete
 
void privDelete ()
 
ShaderObject * privGet (const std::string &key)
 
void privLoad (const std::string &key, const std::string &path)
 

Static Private Member Functions

static ShaderManagerInstance ()
 
static void Delete ()
 Deletes all managed ShaderObject objects.
 

Private Attributes

const std::string defaultPath
 Default path for loading shaders.
 
std::map< std::string, ShaderObject * > storageMap
 Map storing ShaderObject objects associated with their keys.
 

Static Private Attributes

static ShaderManagerptrInstance = nullptr
 
static const std::string defaultShaderKey = AssetDefaults::DefaultShaderKey
 Default key for shaders.
 

Friends

class ShaderManagerAttorney
 

Detailed Description

Manages the loading, retrieval, and deletion of ShaderObject objects.

The ShaderManager class is responsible for managing ShaderObject objects, including loading shaders from files, retrieving shaders by key, and deleting all managed shaders. It follows the Singleton design pattern.

Member Function Documentation

◆ Get()

static ShaderObject * ShaderManager::Get ( const std::string & key)
inlinestatic

Retrieves a ShaderObject object by its key.

Parameters
keyThe key associated with the ShaderObject object.
Returns
A pointer to the ShaderObject object, or nullptr if the key is not found.
Here is the caller graph for this function:

◆ Load()

static void ShaderManager::Load ( const std::string & key,
const std::string & path )
inlinestatic

Loads a ShaderObject object from a file path.

Parameters
keyThe key to associate with the ShaderObject object.
pathThe file path to load the shader from.

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