Nymph Game Engine
Chaiscript based Game Engine
|
Class for shader manager. More...
#include <shader_manager.h>
Public Member Functions | |
ShaderManager ()=delete | |
ShaderManager (const std::string &shader_directory) | |
Shader Manager constructor. More... | |
~ShaderManager () | |
Destroys the object. More... | |
bool | loadShader (const std::string &name, const bool geometry_shader=false) |
Loads a shader. More... | |
bool | loadShader (const std::string &name, const std::string &vertex_filename, const std::string &fragment_filename, const std::string &geometry_filename) |
Loads a shader. More... | |
std::shared_ptr< Shader > | operator[] (const std::string &name) const |
looks up shader by name More... | |
std::shared_ptr< Shader > | getShader (const std::string &name) const |
Gets the shader. More... | |
void | setUniformForAllPrograms (const Uniform &u) |
Sets the uniform for all programs. More... | |
template<class T > | |
void | setUniformForAllPrograms (const std::string &name, const T &data) |
Sets the uniform for all programs. More... | |
Static Public Attributes | |
static char const * | VERTEX_EXTENSION = ".vert" |
static char const * | FRAGMENT_EXTENSION = ".frag" |
static char const * | GEOMETRY_EXTENSION = ".geom" |
Class for shader manager.
|
delete |
Graphics::ShaderManager::ShaderManager | ( | const std::string & | shader_directory | ) |
Shader Manager constructor.
Graphics::ShaderManager::~ShaderManager | ( | ) |
Destroys the object.
std::shared_ptr< Shader > Graphics::ShaderManager::getShader | ( | const std::string & | name | ) | const |
Gets the shader.
[in] | name | The name |
Referenced by generated::getShaderManagerModule(), and operator[]().
bool Graphics::ShaderManager::loadShader | ( | const std::string & | name, |
const bool | geometry_shader = false |
||
) |
Loads a shader.
[in] | name | The name |
[in] | geometry_shader | The geometry shader |
References FRAGMENT_EXTENSION, GEOMETRY_EXTENSION, and VERTEX_EXTENSION.
Referenced by generated::getShaderManagerModule().
bool Graphics::ShaderManager::loadShader | ( | const std::string & | name, |
const std::string & | vertex_filename, | ||
const std::string & | fragment_filename, | ||
const std::string & | geometry_filename | ||
) |
Loads a shader.
[in] | name | The name |
[in] | vertex_filename | The vertex filename |
[in] | fragment_filename | The fragment filename |
[in] | geometry_filename | The geometry filename |
std::shared_ptr< Shader > Graphics::ShaderManager::operator[] | ( | const std::string & | name | ) | const |
void Graphics::ShaderManager::setUniformForAllPrograms | ( | const Uniform & | u | ) |
Sets the uniform for all programs.
[in] | u | The uniform to set |
Referenced by generated::getShaderManagerModule().
void Graphics::ShaderManager::setUniformForAllPrograms | ( | const std::string & | name, |
const T & | data | ||
) |
Sets the uniform for all programs.
[in] | name | The name |
[in] | data | The data |
T | The data type for the uniform |
|
static |
Fragment Shader Extension
Referenced by loadShader().
|
static |
Geometry Shader Extension
Referenced by loadShader().
|
static |
Vertex Shader Extension
Referenced by loadShader().