SLProject 4.0.000
|
Encapsulation of an OpenGL shader object. More...
#include <SLGLShader.h>
Public Member Functions | |
SLGLShader () | |
Default constructor. More... | |
SLGLShader (const SLstring &filename, SLShaderType type) | |
Ctor with shader filename & shader type. More... | |
~SLGLShader () override | |
void | load (const SLstring &filename) |
SLGLShader::load loads a shader file into string _shaderSource. More... | |
void | loadFromMemory (const SLstring &program) |
SLGLShader::load loads a shader file from memory into memory. More... | |
SLstring | typeName () |
Returns the shader type as string. More... | |
SLShaderType | type () |
SLuint | shaderID () const |
SLstring | code () |
void | code (SLstring strCode) |
void | file (SLstring strFile) |
Public Member Functions inherited from SLObject | |
SLObject (const SLstring &Name="", const SLstring &url="") | |
virtual | ~SLObject () |
void | name (const SLstring &Name) |
void | url (const SLstring &url) |
const SLstring & | name () const |
const SLstring & | url () const |
Static Public Member Functions | |
static SLstring | removeComments (SLstring src) |
SLGLShader::removeComments for C/C++ comments removal from shader code. More... | |
Protected Attributes | |
SLShaderType | _type |
Shader type enumeration. More... | |
SLuint | _shaderID |
Program Object. More... | |
SLstring | _code |
ASCII Source-Code. More... | |
SLstring | _file |
Path & filename of shader. More... | |
Protected Attributes inherited from SLObject | |
SLstring | _name |
name of an object More... | |
SLstring | _url |
uniform resource locator More... | |
Private Member Functions | |
SLbool | createAndCompile (SLVLight *lights) |
SLGLShader::createAndCompile creates & compiles the OpenGL shader object. More... | |
SLstring | preprocessPragmas (SLstring code, SLVLight *lights) |
Replaces our own pragma directives in GLSL code. More... | |
Friends | |
class | SLGLProgram |
Encapsulation of an OpenGL shader object.
The SLGLShader class represents a shader object of the OpenGL Shading Language (GLSL). It can load & compile an GLSL shader file and is later on attached to an OpenGL program (SLGLProgram). Instances of SLShader are owned and deleted by their program (SLGLProgram).
SLGLShader::SLGLShader | ( | ) |
Default constructor.
SLGLShader::SLGLShader | ( | const SLstring & | filename, |
SLShaderType | shaderType | ||
) |
Ctor with shader filename & shader type.
If the shader filename does not belong to an existing file the shader code will be generated at a later stage by SLGLProgramGenerated.
filename | Path and filename of the shader to be loaded or generated. |
shaderType | Shader type: ST_vertex, ST_fragment and ST_geometry. |
|
override |
|
inline |
|
inline |
SLGLShader::createAndCompile creates & compiles the OpenGL shader object.
|
inline |
void SLGLShader::load | ( | const SLstring & | filename | ) |
SLGLShader::load loads a shader file into string _shaderSource.
void SLGLShader::loadFromMemory | ( | const SLstring & | program | ) |
SLGLShader::load loads a shader file from memory into memory.
Replaces our own pragma directives in GLSL code.
SLGLShader::removeComments for C/C++ comments removal from shader code.
|
inline |
|
inline |
SLstring SLGLShader::typeName | ( | ) |
Returns the shader type as string.
|
friend |
|
protected |
ASCII Source-Code.
|
protected |
Path & filename of shader.
|
protected |
Program Object.
|
protected |
Shader type enumeration.