|
Beatmup
|
Basic GLSL program. More...
#include <program.h>
Public Member Functions | |
| AbstractProgram (const GraphicPipeline &gpu) | |
| ~AbstractProgram () | |
| void | enable (const GraphicPipeline &gpu) |
| Chunk * | getBinary () const |
| void | loadBinary (const Chunk &binary) |
| handle_t | findUniformLocation (const char *name) |
| Retrieves uniform variable location by its name. More... | |
| handle_t | findAttribLocation (const char *name) |
| Retrieves attribute location by its name. More... | |
| handle_t | getUniformLocation (const std::string &name) |
| Retrieves uniform variable location by its name. More... | |
| handle_t | getAttribLocation (const std::string &name) |
| Retrieves attribute location by its name. More... | |
| void | setInteger (const std::string &name, const int value, bool safe=false) |
| Assigns a value to a specific integer variable in the program. More... | |
| void | setUnsignedInteger (const std::string &name, const unsigned int value, bool safe=false) |
| void | setFloat (const std::string &name, const float value, bool safe=false) |
| Assigns a value to a specific floating point variable in the program. More... | |
| void | setVector2 (const std::string &name, const float x, const float y) |
| void | setVector3 (const std::string &name, const float x, const float y, const float z) |
| void | setVector4 (const std::string &name, const float x, const float y, const float z, const float w) |
| void | setVector4 (const std::string &name, const color4i &color, const float outRange=1.0f) |
| void | setMatrix2 (const std::string &name, const Matrix2 &mat) |
| void | setMatrix3 (const std::string &name, const Matrix2 &mat, const Point &pos) |
| void | setMatrix3 (const std::string &name, const AffineMapping &mapping) |
| void | setIntegerArray (const std::string &name, const int *values, const int length) |
| void | setIntegerArray (const std::string &name, const int firstValue, const int length) |
| void | setFloatArray (const std::string &name, const float *values, const int length) |
| void | setVec2Array (const std::string &name, const float *xy, const int length) |
| void | setVec4Array (const std::string &name, const float *xyzw, const int length) |
| void | bindSampler (GraphicPipeline &gpu, GL::TextureHandler &image, const char *uniformId, TextureParam param) |
| void | bindImage (GraphicPipeline &gpu, GL::TextureHandler &image, const char *uniformId, bool read, bool write) |
| void | bindAtomicCounter (GraphicPipeline &gpu, AtomicCounter &counter, int unit) |
Public Member Functions inherited from Beatmup::GL::RecycleBin::Item | |
| Item () | |
| virtual | ~Item () |
Protected Member Functions | |
| handle_t | getHandle () const |
| void | assertLinked () const |
| void | clearCaches () |
Private Member Functions | |
| AbstractProgram (const AbstractProgram &)=delete | |
| disabling copying constructor More... | |
Private Attributes | |
| std::map< std::string, handle_t > | uniformsCache |
| std::map< std::string, handle_t > | attribsCache |
| handle_t | handle |
|
privatedelete |
disabling copying constructor
| AbstractProgram::AbstractProgram | ( | const GraphicPipeline & | gpu | ) |
Definition at line 216 of file program.cpp.
| AbstractProgram::~AbstractProgram | ( | ) |
Definition at line 221 of file program.cpp.
|
inlineprotected |
|
protected |
Definition at line 226 of file program.cpp.
|
protected |
Definition at line 244 of file program.cpp.
| void AbstractProgram::enable | ( | const GraphicPipeline & | gpu | ) |
Definition at line 250 of file program.cpp.
| Chunk * AbstractProgram::getBinary | ( | ) | const |
Definition at line 257 of file program.cpp.
| void AbstractProgram::loadBinary | ( | const Chunk & | binary | ) |
| GL::handle_t AbstractProgram::findUniformLocation | ( | const char * | name | ) |
Retrieves uniform variable location by its name.
May be slow.
| [in] | name | The variable name |
Definition at line 278 of file program.cpp.
| GL::handle_t AbstractProgram::findAttribLocation | ( | const char * | name | ) |
Retrieves attribute location by its name.
May be slow.
| [in] | name | The attribute name |
Definition at line 283 of file program.cpp.
| GL::handle_t AbstractProgram::getUniformLocation | ( | const std::string & | name | ) |
Retrieves uniform variable location by its name.
Uses chache. Faster when called more than once.
| [in] | name | The variable name |
Definition at line 288 of file program.cpp.
| GL::handle_t AbstractProgram::getAttribLocation | ( | const std::string & | name | ) |
Retrieves attribute location by its name.
Uses chache. Faster when called more than once.
| [in] | name | The attribute name |
Definition at line 298 of file program.cpp.
| void AbstractProgram::setInteger | ( | const std::string & | name, |
| const int | value, | ||
| bool | safe = false |
||
| ) |
Assigns a value to a specific integer variable in the program.
| name | the variable name |
| value | the value to assign |
| safe | if true check if the target variable exists before assigning |
Definition at line 308 of file program.cpp.
| void AbstractProgram::setUnsignedInteger | ( | const std::string & | name, |
| const unsigned int | value, | ||
| bool | safe = false |
||
| ) |
Definition at line 323 of file program.cpp.
| void AbstractProgram::setFloat | ( | const std::string & | name, |
| const float | value, | ||
| bool | safe = false |
||
| ) |
Assigns a value to a specific floating point variable in the program.
| name | the variable name |
| value | the value to assign |
| safe | if true check if the target variable exists before assigning |
Definition at line 347 of file program.cpp.
| void AbstractProgram::setVector2 | ( | const std::string & | name, |
| const float | x, | ||
| const float | y | ||
| ) |
Definition at line 362 of file program.cpp.
| void AbstractProgram::setVector3 | ( | const std::string & | name, |
| const float | x, | ||
| const float | y, | ||
| const float | z | ||
| ) |
Definition at line 370 of file program.cpp.
| void AbstractProgram::setVector4 | ( | const std::string & | name, |
| const float | x, | ||
| const float | y, | ||
| const float | z, | ||
| const float | w | ||
| ) |
Definition at line 378 of file program.cpp.
| void AbstractProgram::setVector4 | ( | const std::string & | name, |
| const color4i & | color, | ||
| const float | outRange = 1.0f |
||
| ) |
Definition at line 386 of file program.cpp.
| void AbstractProgram::setMatrix2 | ( | const std::string & | name, |
| const Matrix2 & | mat | ||
| ) |
Definition at line 392 of file program.cpp.
| void AbstractProgram::setMatrix3 | ( | const std::string & | name, |
| const Matrix2 & | mat, | ||
| const Point & | pos | ||
| ) |
Definition at line 402 of file program.cpp.
| void AbstractProgram::setMatrix3 | ( | const std::string & | name, |
| const AffineMapping & | mapping | ||
| ) |
Definition at line 412 of file program.cpp.
| void AbstractProgram::setIntegerArray | ( | const std::string & | name, |
| const int * | values, | ||
| const int | length | ||
| ) |
Definition at line 417 of file program.cpp.
| void AbstractProgram::setIntegerArray | ( | const std::string & | name, |
| const int | firstValue, | ||
| const int | length | ||
| ) |
Definition at line 434 of file program.cpp.
| void AbstractProgram::setFloatArray | ( | const std::string & | name, |
| const float * | values, | ||
| const int | length | ||
| ) |
Definition at line 450 of file program.cpp.
| void AbstractProgram::setVec2Array | ( | const std::string & | name, |
| const float * | xy, | ||
| const int | length | ||
| ) |
Definition at line 458 of file program.cpp.
| void AbstractProgram::setVec4Array | ( | const std::string & | name, |
| const float * | xyzw, | ||
| const int | length | ||
| ) |
Definition at line 466 of file program.cpp.
| void AbstractProgram::bindSampler | ( | GraphicPipeline & | gpu, |
| GL::TextureHandler & | image, | ||
| const char * | uniformId, | ||
| TextureParam | param | ||
| ) |
Definition at line 474 of file program.cpp.
| void AbstractProgram::bindImage | ( | GraphicPipeline & | gpu, |
| GL::TextureHandler & | image, | ||
| const char * | uniformId, | ||
| bool | read, | ||
| bool | write | ||
| ) |
Definition at line 483 of file program.cpp.
| void AbstractProgram::bindAtomicCounter | ( | GraphicPipeline & | gpu, |
| AtomicCounter & | counter, | ||
| int | unit | ||
| ) |
Definition at line 493 of file program.cpp.
|
private |
|
private |