92 template<
typename... Args >
159 GLuint geometryOutputType );
179 void SetParameter(
int aParameterNumber,
float aValue )
const;
180 void SetParameter(
int aParameterNumber,
int aValue )
const;
182 void SetParameter(
int aParameterNumber,
float f0,
float f1,
float f2,
float f3 )
const;
190 int GetAttribute(
const std::string& aAttributeName )
const;
198 static std::string
ReadSource(
const std::string& aShaderSourceName );
Provide the access to the OpenGL shaders.
static std::string ReadSource(const std::string &aShaderSourceName)
Read the shader source file.
bool active
Is any of shaders used?
bool LoadShaderFromFile(SHADER_TYPE aShaderType, const std::string &aShaderSourceName)
Load one of the built-in shaders and compiles it.
bool IsLinked() const
Return true if shaders are linked correctly.
bool isProgramCreated
Flag for program creation.
std::deque< GLuint > shaderNumbers
Shader number list.
void SetParameter(int aParameterNumber, float aValue) const
Set a parameter of the shader.
GLuint geomInputType
Output type [e.g. GL_LINES, GL_TRIANGLES, GL_QUADS etc.].
bool loadShaderFromStringArray(SHADER_TYPE aShaderType, const char **aArray, size_t aSize)
Compile vertex of fragment shader source code into the program.
std::deque< GLint > parameterLocation
Location of the parameter.
GLuint programNumber
Shader program number.
bool Link()
Link the shaders.
void Use()
Use the shader.
bool isShaderLinked
Is the shader linked?
void ConfigureGeometryShader(GLuint maxVertices, GLuint geometryInputType, GLuint geometryOutputType)
Configure the geometry shader - has to be done before linking!
bool LoadShaderFromStrings(SHADER_TYPE aShaderType, Args &&... aArgs)
Add a shader and compile the shader sources.
bool IsActive() const
Return the current state of the shader.
void shaderInfo(GLuint aShader)
Get the shader information.
void programInfo(GLuint aProgram)
Get the shader program information.
int AddParameter(const std::string &aParameterName)
Add a parameter to the parameter queue.
GLuint maximumVertices
The maximum of vertices to be generated.
int GetAttribute(const std::string &aAttributeName) const
Get an attribute location.
void Deactivate()
Deactivate the shader and use the default OpenGL program.
const char * translateStringArg(const std::string &str)
The Cairo implementation of the graphics abstraction layer.
SHADER_TYPE
Type definition for the shader.
@ SHADER_TYPE_VERTEX
Vertex shader.
@ SHADER_TYPE_FRAGMENT
Fragment shader.
@ SHADER_TYPE_GEOMETRY
Geometry shader.