20 #include "AttributeSet.h"
65 virtual bool isValid()
const = 0;
81 virtual void begin() = 0;
85 virtual void end() = 0;
179 float value4,
float* stateValue);
209 std::vector<std::string> mUniformNames;
const std::vector< std::string > & getUniformNames() const
Returns the list of indexed uniforms.
Definition: Shader.h:104
Shader(const AttributeSetPtr &attributes, const std::vector< std::string > &uniformNames)
Construct a Shader with the given list of attributes and uniforms.
void setIndexedUniform3f(int index, bool global, float value1, float value2, float value3, float *stateValue)
Set the value of a 3D float vector uniform at the given index.
Header declaring and including types common to renderer classes such as Vector2. Also includes GL hea...
void setIndexedUniform1i(int index, bool global, int value, int *stateValue)
Set the value of an integer scalar uniform at the given index.
virtual bool isCurrent() const =0
Returns whether or not this shader is bound.
virtual bool isValid() const =0
Returns whether or not this shader is valid (compiled and linked) and can be used for rendering...
virtual void compile()=0
Compiles this shader, if not already compiled.
float Matrix4[16]
4x4 float matrix, whose layout is compatible with GL.
Definition: RendererCommon.h:46
virtual int getAttributeLocation(int index) const =0
Returns the location of an indexed Attribute.
Shader program abstract base class.
Definition: Shader.h:47
void setIndexedUniform2f(int index, bool global, const Vector2 &value, Vector2 *stateValue)
Set the value of a 2D float vector uniform at the given index.
virtual GLuint getProgramId() const =0
Returns the GL program id for this shader.
virtual bool isCompiled() const =0
Returns whether or not this shader has been processed for compilation.
virtual void begin()=0
Binds this shader, updating state as necessary.
std::shared_ptr< AttributeSet > AttributeSetPtr
Shared pointer typedef for AttributeSet.
Definition: PointerDeclarations.h:63
virtual void end()=0
Unbinds this shader if bound by a corresponding call to begin().
b2Vec2 Vector2
2D float vector, whose layout is compatible with GL.
Definition: RendererCommon.h:50
void setIndexedUniform1f(int index, bool global, float value, float *stateValue)
Set the value of a float scalar uniform at the given index.
virtual std::string getErrorLog() const =0
Retrieves the string describing compilation errors, if the call to compile() failed and isValid() is ...
virtual int getUniformLocation(int index) const =0
Returns the location of an indexed uniform.
void setIndexedUniformMatrix4f(int index, bool global, bool transpose, const Matrix4 &value, Matrix4 *stateValue)
Set the value of a 4x4 float matrix uniform at the given index.
const AttributeSetPtr & getAttributes() const
Returns the list of indexed Attributes for this shader, as an AttributeSet.
Definition: Shader.h:100
void setIndexedUniform4f(int index, bool global, float value1, float value2, float value3, float value4, float *stateValue)
Set the value of a 4D float vector uniform at the given index.