#include <gls_es20_effect.h>
|
void | FreeShaders (GLuint vertObject, GLuint fragObject) |
|
GLuint | LoadAndCompileShader (GLenum shaderType, const char *shaderSource) |
|
std::size_t | HashShader (const GLchar *vertexShader, const GLchar *fragmentShader) |
|
|
class | GlsEffectFactoryImpl |
|
class | std::map< GLuint, GlsEffect > |
|
class | DynamicArray< GlsEffect, false > |
|
The GlsEffect Class. This class stores program objects and lists of uniforms. Because all construction methods are private, Effects can be only created with the friend Factory class.
◆ ~GlsEffect()
◆ CreateCustomUniform()
GLint CreateCustomUniform |
( |
const char * |
uniformName | ) |
|
Create a custom uniform to add to this effect's list of custom uniforms
- Parameters
-
[in] | uniformName | The string representing the name of this uniform |
- Returns
- the ID corresponding to this custom uniform's position in the array, or -1 on failure
◆ CreateShader()
GLuint CreateShader |
( |
const GLchar * |
vertexShader, |
|
|
const GLchar * |
fragmentShader |
|
) |
| |
Compile and link vertex and fragment shaders, creating a program object.
- Parameters
-
[in] | vertexShader | The vertex shader. |
[in] | fragmentShader | The fragment shader. |
- Returns
- The newly created program object, or 0 on error.
◆ FreeShaders()
void FreeShaders |
( |
GLuint |
vertObject, |
|
|
GLuint |
fragObject |
|
) |
| |
|
protected |
Delete/destroy the shader program and its shaders.
- Parameters
-
vertObject | GL index of the vertex shader program. |
fragObject | GL index of the fragment shader program. |
- Precondition
- none
- Postcondition
- shaders are deleted
-
_programObject == 0
◆ GetAttribLocation()
Get attribute location
- Parameters
-
[in] | attribute | The standard attribute to query ( |
- See also
- StdAttribs_e)
- Precondition
- attribute is a valid StdAttribs_e
- Returns
- The attribute's location
◆ GetCustomUniform()
Get uniform data for one of the custom uniforms.
- Parameters
-
[in] | uniform | The custom uniform's ID |
- Returns
- the uniform
◆ GetProgramObject()
GLuint GetProgramObject |
( |
| ) |
|
Get the program object associated with this effect.
- Returns
- the program object
◆ GetStdUniform()
Get uniform data for one of the standard uniforms.
- Parameters
-
[in] | uniform | The standard uniform enum ( |
- See also
- StdUniforms_e)
- Precondition
- uniform is a valid StdUniforms_e
- Returns
- the uniform
◆ HashShader()
std::size_t HashShader |
( |
const GLchar * |
vertexShader, |
|
|
const GLchar * |
fragmentShader |
|
) |
| |
|
protected |
Hashes the shader programs, used to determine the filename of the precompiled shader for platforms that do not support inline shader compilation.
- Parameters
-
vertexShader | The vertex shader program source code. |
fragmentShader | The fragment shader program source code. |
- Returns
- A hash of the shader programs.
◆ IsInitialized()
Indicates if this effect was successfully loaded or not
- Returns
- true if the effect has been successfully loaded
◆ LoadAndCompileShader()
GLuint LoadAndCompileShader |
( |
GLenum |
shaderType, |
|
|
const char * |
shaderSource |
|
) |
| |
|
protected |
Load and compile a new shader.
- Parameters
-
[in] | shaderType | The type of shader this is |
[in] | shaderSource | The code for the shader |
- Precondition
- shaderType is GL_VERTEX_SHADER or GL_FRAGMENT_SHADER
- Returns
- The shader object's ID or 0 on failure.
◆ UseProgram()
Use the program for this effect.
◆ GlsEffectFactoryImpl
friend class GlsEffectFactoryImpl |
|
friend |
Only the effect factory should be creating new effects.
◆ _attribLocations
GLint _attribLocations[MAX_STD_ATTRIBS] |
|
protected |
The attributes for this effect.
◆ _customUniforms
Custom uniform types for custom shaders.
◆ _programObject
This effect's program object.
◆ _stdUniforms
Standard uniform types. Index values can be acquired from the factory.
The documentation for this class was generated from the following file: