#include <StkShaderProgramManager.h>
ShaderProgramManager - Short description. Detailed description.
◆ addDirectory()
void ShaderProgramManager::addDirectory |
( |
const std::string & |
path, |
|
|
const std::string & |
prefix = "" |
|
) |
| |
Add a directory of shader files to the manager. This method will scan the given directory for files matching the pattern ShaderName_vtx.glsl, ShaderName_frag.glsl and ShaderName_geo.glsl. These are registered under the name Prefix:ShaderName or just ShaderName if prefix is empty.
◆ addShaderProgram()
std::shared_ptr< ShaderProgram > ShaderProgramManager::addShaderProgram |
( |
const std::string & |
name, |
|
|
const std::string & |
vtx_filename, |
|
|
const std::string & |
frag_filename, |
|
|
const std::string & |
geo_filename = "" |
|
) |
| |
Add a shader program entry. This method will register the given shader with the given name, vertex and fragment shader files.
◆ clearShaders()
void ShaderProgramManager::clearShaders |
( |
| ) |
|
Cleanup all shaders. This should be called before deleting the last OpenGL context.
◆ getShaderProgram()
std::shared_ptr< ShaderProgram > ShaderProgramManager::getShaderProgram |
( |
const std::string & |
name | ) |
const |
Get shader program by name. This method will return the shader program registered on the given name.
◆ getShaderProgramName()
std::string STK::ShaderProgramManager::getShaderProgramName |
( |
const ShaderProgram * |
program | ) |
const |
|
inline |
Get the registered name of the shader program
◆ linkShaders()
void ShaderProgramManager::linkShaders |
( |
| ) |
|
Compile and link all shader files. This can be called after registering shader files with addDirectory() or addShaderProgram() to avoid compiling shaders on the first bind() which may cause stuttering in the first frames.
- Note
- You need a valid OpenGL context before calling this method.
The documentation for this class was generated from the following files:
- Native/SilentToolkit/StkScene/StkShaderProgramManager.h
- Native/SilentToolkit/StkScene/StkShaderProgramManager.cpp