SimpleGL
1.1.0
A framework for platform independent rendering
|
This class provides an class for managing shaders. More...
#include <manager_gl.hpp>
Public Member Functions | |
void | remove (std::string name) override |
Removes and disposes a shader from the storage. More... | |
void | clear () override |
Removes all shaders and disposes them. More... | |
Shader * | loadShader (std::string path, std::string name, ShaderType type) |
Loads a shader from file and stores it. More... | |
ShaderProgram * | loadShaderProgram (std::string vertexPath, std::string fragmentPath, std::string vertexName, std::string fragmentName) |
Creates a shader program from a vertex shader file and a fragment shader file. More... | |
ShaderProgram * | createShaderProgram (std::string vertexName, std::string fragmentName) |
Creates a shader program from two stored shaders. More... | |
Public Member Functions inherited from sgl::Manager< Shader > | |
~Manager (void) | |
Deletes a manager and disposes all managed objects. More... | |
void | put (std::string name, Shader *value) |
Stores a object with specified name. More... | |
Shader * | get (std::string name) |
Gets a managed object from the storage. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from sgl::Manager< Shader > | |
Manager (void) | |
Initializes a new manager. More... | |
Protected Attributes inherited from sgl::Manager< Shader > | |
std::map< std::string, Shader * > | objects |
Contains the objects to manage. More... | |
This class provides an class for managing shaders.
Definition at line 56 of file manager_gl.hpp.
|
overridevirtual |
Removes all shaders and disposes them.
Reimplemented from sgl::Manager< Shader >.
Definition at line 76 of file manager_gl.cpp.
ShaderProgram * sgl::ShaderManager::createShaderProgram | ( | std::string | vertexName, |
std::string | fragmentName | ||
) |
Creates a shader program from two stored shaders.
vertexName | The name of the stored vertex shader. |
fragmentName | The name of the stored fragment shader. |
Definition at line 139 of file manager_gl.cpp.
Shader * sgl::ShaderManager::loadShader | ( | std::string | path, |
std::string | name, | ||
ShaderType | type | ||
) |
Loads a shader from file and stores it.
path | File path to the shader source. |
name | The name of the shader. |
type | The type of the shader, either VERTEX_SHADER or FRAGMENT_SHADER. |
Definition at line 87 of file manager_gl.cpp.
ShaderProgram * sgl::ShaderManager::loadShaderProgram | ( | std::string | vertexPath, |
std::string | fragmentPath, | ||
std::string | vertexName, | ||
std::string | fragmentName | ||
) |
Creates a shader program from a vertex shader file and a fragment shader file.
vertexPath | File path to the vertex shader source. |
fragmentPath | File path to the fragment shader source. |
vertexName | The name for the vertex shader. |
fragmentName | The name for the fragment shader. |
Definition at line 119 of file manager_gl.cpp.
|
overridevirtual |
Removes and disposes a shader from the storage.
name | The name of the shader. |
Reimplemented from sgl::Manager< Shader >.
Definition at line 67 of file manager_gl.cpp.