Ketchup Engine
Loading...
Searching...
No Matches
ShaderManager Class Reference

#include <ShaderManager.h>

Collaboration diagram for ShaderManager:
Collaboration graph

Public Types

using MapKey = std::string
 
using StorageMap = std::unordered_map< MapKey, ShaderObject * >
 

Static Public Member Functions

static void Load (MapKey k, const char *path)
 Loads a shader from path and associates it with Key k.
 
static ShaderObject * Get (MapKey k)
 Gets the ShaderObject associated with the given MapKey.
 

Static Public Attributes

static const MapKey spriteKey = "sprite"
 
static const MapKey colorConstantKey = "colorConstant"
 

Private Member Functions

 ShaderManager ()
 
 ShaderManager (const ShaderManager &)=delete
 
ShaderManageroperator= (const ShaderManager &)=delete
 
 ~ShaderManager ()
 
void privLoad (MapKey k, const char *path)
 

Static Private Member Functions

static ShaderManagerInstance ()
 
static void Free ()
 

Private Attributes

StorageMap shaders
 

Static Private Attributes

static ShaderManagerp_instance
 

Friends

class ShaderManagerAttorney
 

Member Typedef Documentation

◆ MapKey

using ShaderManager::MapKey = std::string

◆ StorageMap

using ShaderManager::StorageMap = std::unordered_map<MapKey, ShaderObject*>

Constructor & Destructor Documentation

◆ ShaderManager() [1/2]

ShaderManager::ShaderManager ( )
private

◆ ShaderManager() [2/2]

ShaderManager::ShaderManager ( const ShaderManager )
privatedelete

◆ ~ShaderManager()

ShaderManager::~ShaderManager ( )
private

Member Function Documentation

◆ Free()

void ShaderManager::Free ( )
staticprivate

◆ Get()

ShaderObject * ShaderManager::Get ( MapKey  k)
static

Gets the ShaderObject associated with the given MapKey.

Haru, 3/8/2023.

Parameters
kThe MapKey (string).
Returns
A pointer to the ShaderObject.

◆ Instance()

ShaderManager * ShaderManager::Instance ( )
staticprivate

◆ Load()

void ShaderManager::Load ( MapKey  k,
const char *  path 
)
static

Loads a shader from path and associates it with Key k.

Haru, 3/8/2023.

Parameters
kA MapKey (string) to associate the shader with.
pathPathname of the file.

◆ operator=()

ShaderManager & ShaderManager::operator= ( const ShaderManager )
privatedelete

◆ privLoad()

void ShaderManager::privLoad ( MapKey  k,
const char *  path 
)
private

Friends And Related Function Documentation

◆ ShaderManagerAttorney

friend class ShaderManagerAttorney
friend

Member Data Documentation

◆ colorConstantKey

const ShaderManager::MapKey ShaderManager::colorConstantKey = "colorConstant"
static

◆ p_instance

ShaderManager * ShaderManager::p_instance
staticprivate

◆ shaders

StorageMap ShaderManager::shaders
private

◆ spriteKey

const ShaderManager::MapKey ShaderManager::spriteKey = "sprite"
static

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