Resource management class for shaders.
More...
#include <ShaderManager.h>
Resource management class for shaders.
- Author
- Stanislaw Jaroszynski
- Date
- August, 2018
Definition at line 18 of file ShaderManager.h.
◆ CompileNewShaderFromFile()
static Shader * VAPoR::ShaderManager::CompileNewShaderFromFile |
( |
const std::string & |
path, |
|
|
const std::vector< std::string > & |
defines = {} |
|
) |
| |
|
static |
- Parameters
-
[in] | path | to GLSL source code file |
- Return values
-
Shader* | is returned on success |
nullptr | is returned on failure |
◆ GetShader()
ShaderProgram * VAPoR::ShaderManager::GetShader |
( |
const std::string & |
name | ) |
|
◆ GetShaderDependencies()
static std::vector< std::string > VAPoR::ShaderManager::GetShaderDependencies |
( |
const std::string & |
path | ) |
|
|
static |
◆ GetShaderTypeFromPath()
static unsigned int VAPoR::ShaderManager::GetShaderTypeFromPath |
( |
const std::string & |
path | ) |
|
|
static |
Returns an OpenGL shader type enum based on the file extension. Valid extensions are .vert, .frag, and .geom
- Parameters
-
[in] | path | to GLSL source code file |
◆ GetSmartShader()
◆ LoadResourceByKey()
int VAPoR::ShaderManager::LoadResourceByKey |
( |
const std::string & |
key | ) |
|
|
virtual |
◆ PreProcessShader()
static std::string VAPoR::ShaderManager::PreProcessShader |
( |
const std::string & |
path, |
|
|
const std::vector< std::string > & |
defines = {} |
|
) |
| |
|
static |
Implements the following preprocessor directives:
- #pragma auto_version This sets the GLSL version to the highest available
- #include FileName.glsl c-style include without quotes. Path is relative to shader base path This will also update line numbers with the #line directive
- #define X Each item in the defines list is added to the GLSL code after the #version directive
- Parameters
-
[in] | path | to GLSL source code file |
[in] | defines | list of definitions to be added to source |
The documentation for this class was generated from the following file: