|
GL Studio C++ Runtime API
|
#include <gls_es20_effect.h>
Public Member Functions | |
| GlsUniform * | GetStdUniform (StdUniforms_e uniform) |
| GlsUniform * | GetCustomUniform (GLint uniform) |
| GLuint | GetAttribLocation (StdAttribs_e attribute) |
| GLuint | CreateShader (const GLchar *vertexShader, const GLchar *fragmentShader) |
| GLint | CreateCustomUniform (const char *uniformName) |
| bool | IsInitialized (void) |
| void | UseProgram (void) |
| GLuint | GetProgramObject (void) |
| ~GlsEffect () | |
Protected Member Functions | |
| void | FreeShaders (GLuint vertObject, GLuint fragObject) |
| GLuint | LoadAndCompileShader (GLenum shaderType, const char *shaderSource) |
Protected Attributes | |
| GLuint | _programObject |
| GlsUniform | _stdUniforms [MAX_STD_UNIFORMS] |
| DynamicArray< GlsUniform, false > | _customUniforms |
| GLint | _attribLocations [MAX_STD_ATTRIBS] |
Friends | |
| class | GlsEffectFactoryImpl |
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 | ( | ) |
dtor
| GLint CreateCustomUniform | ( | const char * | uniformName | ) |
Create a custom uniform to add to this effect's list of custom uniforms
| [in] | uniformName | The string representing the name of this uniform |
| GLuint CreateShader | ( | const GLchar * | vertexShader, |
| const GLchar * | fragmentShader | ||
| ) |
Compile and link vertex and fragment shaders, creating a program object.
| [in] | vertexShader | The vertex shader. |
| [in] | fragmentShader | The fragment shader. |
|
protected |
Delete/destroy the shader program and its shaders
| GLuint GetAttribLocation | ( | StdAttribs_e | attribute | ) |
Get attribute location
| [in] | attribute | The standard attribute to query ( |
| GlsUniform* GetCustomUniform | ( | GLint | uniform | ) |
Get uniform data for one of the custom uniforms.
| [in] | uniform | The custom uniform's ID |
| GLuint GetProgramObject | ( | void | ) |
Get the program object associated with this effect.
| GlsUniform* GetStdUniform | ( | StdUniforms_e | uniform | ) |
Get uniform data for one of the standard uniforms.
| [in] | uniform | The standard uniform enum ( |
| bool IsInitialized | ( | void | ) |
Indicates if this effect was successfully loaded or not
|
protected |
Load and compile a new shader.
| [in] | shaderType | The type of shader this is |
| [in] | shaderSource | The code for the shader |
| void UseProgram | ( | void | ) |
Use the program for this effect.
|
friend |
Only the effect factory should be creating new effects.
|
protected |
The attributes for this effect.
|
protected |
Custom uniform types for custom shaders.
|
protected |
This effect's program object.
|
protected |
Standard uniform types. Index values can be acquired from the factory.