ork::Module Class Reference
[render]
A module made of a vertex, a tesselation, a geometry, and a fragment shader parts.
More...
#include <Module.h>
List of all members.
Public Member Functions |
| Module (int version, const char *source) |
| Creates a new module whose parts are all grouped in a single compilation unit, but separated with preprocessor directives (see Module).
|
| Module (int version, const char *vertex, const char *fragment) |
| Creates a new module whose parts are defined in separate compilation units.
|
| Module (int version, const char *vertex, const char *geometry, const char *fragment) |
| Creates a new module whose parts are defined in separate compilation units.
|
| Module (int version, const char *vertex, const char *tessControl, const char *tessEvaluation, const char *geometry, const char *fragment) |
| Creates a new module whose parts are defined in separate compilation units.
|
virtual | ~Module () |
| Deletes this module.
|
int | getVertexShaderId () const |
| Returns the id of the vertex shader part of this module.
|
int | getTessControlShaderId () const |
| Returns the id of the tessellation control shader part of this shader.
|
int | getTessEvalShaderId () const |
| Returns the id of the tessellation evaluation shader part of this shader.
|
int | getGeometryShaderId () const |
| Returns the id of the geometry shader part of this shader.
|
int | getFragmentShaderId () const |
| Returns the id of the fragment shader part of this shader.
|
const set< Program * > & | getUsers () const |
| Returns the programs that use this Module.
|
void | setFeedbackMode (bool interleaved) |
| Sets the format to use when a Program using this module is used in transform feedback.
|
void | addFeedbackVarying (const string &name) |
| Adds an output varying variable that must be recorded in transform feedback mode.
|
void | addInitialValue (ptr< Value > value) |
| Adds an initial value for the given uniform variable.
|
Protected Member Functions |
| Module () |
| Creates an uninitialized module.
|
void | init (int version, const char *source) |
| Initializes this module, with parts that are all grouped in a single compilation unit, but separated with preprocessor directives (see Module).
|
void | init (int version, const char *vertexHeader, const char *vertex, const char *tessControlHeader, const char *tessControl, const char *tessEvaluationHeader, const char *tessEvaluation, const char *geometryHeader, const char *geometry, const char *fragmentHeader, const char *fragment) |
| Initializes this module.
|
virtual void | swap (ptr< Module > s) |
| Swaps this module with the given one.
|
Detailed Description
A module made of a vertex, a tesselation, a geometry, and a fragment shader parts.
All parts are optional. These parts must be defined either each in its own GLSL compilation unit, or all grouped in a single compilation unit but separated with the following preprocessor directives:
... common code ...
#ifdef _VERTEX_
... vertex shader code ...
#endif
#ifdef _TESS_CONTROL_
... tessellation control shader code ...
#endif
#ifdef _TESS_EVAL_
... tessellation evaluation shader code ...
#endif
#ifdef _GEOMETRY_
... geometry shader code ...
#endif
#ifdef _FRAGMENT_
... fragment shader code ...
#endif
A module can specify some initial values for its uniform variables, and can also specify which output varying variable must be recorded in transform feedback mode.
Constructor & Destructor Documentation
ork::Module::Module |
( |
int |
version, |
|
|
const char * |
source | |
|
) |
| | |
Creates a new module whose parts are all grouped in a single compilation unit, but separated with preprocessor directives (see Module).
- Parameters:
-
| version | the GLSL version used for the source code. |
| source | the source code of the module. |
ork::Module::Module |
( |
int |
version, |
|
|
const char * |
vertex, |
|
|
const char * |
fragment | |
|
) |
| | |
Creates a new module whose parts are defined in separate compilation units.
- Parameters:
-
| version | the GLSL version used for the source code. |
| vertex | the vertex shader source code (maybe NULL). |
| fragment | the fragment shader source code (maybe NULL). |
ork::Module::Module |
( |
int |
version, |
|
|
const char * |
vertex, |
|
|
const char * |
geometry, |
|
|
const char * |
fragment | |
|
) |
| | |
Creates a new module whose parts are defined in separate compilation units.
- Parameters:
-
| version | the GLSL version used for the source code. |
| vertex | the vertex shader source code (maybe NULL). |
| geometry | the geometry shader source code (maybe NULL). |
| fragment | the fragment shader source code (maybe NULL). |
ork::Module::Module |
( |
int |
version, |
|
|
const char * |
vertex, |
|
|
const char * |
tessControl, |
|
|
const char * |
tessEvaluation, |
|
|
const char * |
geometry, |
|
|
const char * |
fragment | |
|
) |
| | |
Creates a new module whose parts are defined in separate compilation units.
- Parameters:
-
| version | the GLSL version used for the source code. |
| vertex | the vertex shader source code (maybe NULL). |
| tessControl | the tessellation control shader source code (maybe NULL). |
| tessEvaluation | the tessellation evaluation shader source code (maybe NULL). |
| geometry | the geometry shader source code (maybe NULL). |
| fragment | the fragment shader source code (maybe NULL). |
virtual ork::Module::~Module |
( |
|
) |
[virtual] |
ork::Module::Module |
( |
|
) |
[protected] |
Creates an uninitialized module.
Member Function Documentation
void ork::Module::addFeedbackVarying |
( |
const string & |
name |
) |
|
Adds an output varying variable that must be recorded in transform feedback mode.
The order of these variables is important: they are recorded in the same order as they as declared with this method.
- Parameters:
-
| name | the name of an output varying variable to record. |
void ork::Module::addInitialValue |
( |
ptr< Value > |
value |
) |
|
Adds an initial value for the given uniform variable.
- Parameters:
-
| value | an initial value for an uniform of this module. |
int ork::Module::getFragmentShaderId |
( |
|
) |
const |
Returns the id of the fragment shader part of this shader.
int ork::Module::getGeometryShaderId |
( |
|
) |
const |
Returns the id of the geometry shader part of this shader.
int ork::Module::getTessControlShaderId |
( |
|
) |
const |
Returns the id of the tessellation control shader part of this shader.
int ork::Module::getTessEvalShaderId |
( |
|
) |
const |
Returns the id of the tessellation evaluation shader part of this shader.
const set<Program*>& ork::Module::getUsers |
( |
|
) |
const |
Returns the programs that use this Module.
int ork::Module::getVertexShaderId |
( |
|
) |
const |
Returns the id of the vertex shader part of this module.
- Returns:
- the id of the vertex shader part of this module, or -1 if this module does not have a vertex shader.
void ork::Module::init |
( |
int |
version, |
|
|
const char * |
vertexHeader, |
|
|
const char * |
vertex, |
|
|
const char * |
tessControlHeader, |
|
|
const char * |
tessControl, |
|
|
const char * |
tessEvaluationHeader, |
|
|
const char * |
tessEvaluation, |
|
|
const char * |
geometryHeader, |
|
|
const char * |
geometry, |
|
|
const char * |
fragmentHeader, |
|
|
const char * |
fragment | |
|
) |
| | [protected] |
Initializes this module.
- Parameters:
-
| version | the GLSL version used for the source code. |
| vertexHeader | an optional header for the the vertex shader source code (maybe NULL). |
| vertex | the vertex shader source code (maybe NULL). |
| tessControlHeader | an optional header for the the tessellation control shader source code (maybe NULL). |
| tessControl | the tessellation control shader source code (maybe NULL). |
| tessEvaluationHeader | an optional header for the the tessellation evaluation shader source code (maybe NULL). |
| tessEvaluation | the tessellation evaluation shader source code (maybe NULL). |
| geometryHeader | an optional header for the the geometry shader source code (maybe NULL). |
| geometry | the geometry shader source code (maybe NULL). |
| fragmentHeader | an optional header for the the fragment shader source code (maybe NULL). |
| fragment | the fragment shader source code (maybe NULL). |
void ork::Module::init |
( |
int |
version, |
|
|
const char * |
source | |
|
) |
| | [protected] |
Initializes this module, with parts that are all grouped in a single compilation unit, but separated with preprocessor directives (see Module).
- Parameters:
-
| version | the GLSL version used for the source code. |
| source | the source code of the module. |
void ork::Module::setFeedbackMode |
( |
bool |
interleaved |
) |
|
Sets the format to use when a Program using this module is used in transform feedback.
- Parameters:
-
| interleaved | true to interleave the recorded output varying variables in a single buffer, or false to record each output variable in a separate buffer. |
virtual void ork::Module::swap |
( |
ptr< Module > |
s |
) |
[protected, virtual] |
Swaps this module with the given one.