UniShader
1.0.0a
Interface for GPGPU and working with shader programs
|
Shader input class. More...
#include <ShaderInput.h>
Classes | |
class | SignalID |
Signal identifier enum. More... | |
Public Types | |
typedef SafePtr< ShaderInput > | Ptr |
Safe pointer. | |
typedef SafePtr< const ShaderInput > | PtrConst |
Safe pointer. | |
Public Member Functions | |
ShaderInput (ShaderProgram &program) | |
virtual const std::string & | getClassName () const |
Get name of this class. | |
Attribute::Ptr | addAttribute (std::string name) |
Add new attribute. | |
Uniform::Ptr | addUniform (std::string name) |
Add new uniform. | |
Attribute::Ptr | getAttribute (std::string name) |
Get attribute. | |
Uniform::Ptr | getUniform (std::string name) |
Get uniform. | |
void | removeAttribute (std::string name) |
Remove attribute. | |
void | removeUniform (std::string name) |
Remove uniform. | |
void | prepare () |
Prepare. | |
void | activate () |
Activate. | |
bool | isActive () |
Is active? | |
void | deactivate () |
Deactivate. | |
virtual bool | handleSignal (unsigned int signalID, const ObjectBase *callerPtr) |
Handle incoming signal. |
Shader input class.
Shader input manages all input operations for shader program.
void ShaderInput::activate | ( | ) |
Activate.
Activate input by modyfying OpenGL context and make it availible for shader program.
Attribute::Ptr ShaderInput::addAttribute | ( | std::string | name | ) |
Add new attribute.
Create and add new attribute to shader input. If attribute with same name already exists, pointer to that attribute is returned.
name | Name of attribute. |
Uniform::Ptr ShaderInput::addUniform | ( | std::string | name | ) |
Add new uniform.
Create and add new uniform to shader input. If uniform with same name already exists, pointer to that uniform is returned.
name | Name of uniform. |
void ShaderInput::deactivate | ( | ) |
Deactivate.
Return OpenGL context states modified by this class to their default state.
Attribute::Ptr ShaderInput::getAttribute | ( | std::string | name | ) |
Get attribute.
Return pointer to previously added attribute. If attribute with the name doesn't exists, null pointer is returned.
name | Name of attribute. |
Uniform::Ptr ShaderInput::getUniform | ( | std::string | name | ) |
Get uniform.
Return pointer to previously added uniform. If uniform with the name doesn't exists, null pointer is returned.
name | Name of uniform. |
virtual bool ShaderInput::handleSignal | ( | unsigned int | signalID, |
const ObjectBase * | callerPtr | ||
) | [virtual] |
Handle incoming signal.
signalID | Signal identifier. |
callerPtr | Pointer to object sending signal. |
Implements SignalReceiver.
bool ShaderInput::isActive | ( | ) |
Is active?
Return if shader input is active.
void ShaderInput::prepare | ( | ) |
Prepare.
Prepare input and underlying classes for use.
void ShaderInput::removeAttribute | ( | std::string | name | ) |
Remove attribute.
Destroy attribute and remove it from shader input. If attribute with the name doesn't exists, function returns silently.
name | Name of attribute. |
void ShaderInput::removeUniform | ( | std::string | name | ) |
Remove uniform.
Destroy uniform and remove it from shader input. If uniform with the name doesn't exists, function returns silently.
name | Name of uniform. |