17 #ifndef SPRITESHADER_H
18 #define SPRITESHADER_H
21 #include "SingletonInstancedShaderBase.h"
85 static std::string getVertexShaderCode();
86 static std::string getFragmentShaderCode();
93 float mOpacity = 1.0f;
96 static const char* VERTEX_SHADER;
97 static const char* FRAGMENT_SHADER;
100 #endif // SPRITESHADER_H
const std::vector< std::string > & getUniformNames() const
Returns the list of indexed uniforms.
Definition: Shader.h:104
void setOpacity(float value)
Sets the overall transparency of the rendered texture, with 0.0f completely transparent, and 1.0f fully opaque.
Header declaring and including types common to renderer classes such as Vector2. Also includes GL hea...
void setTexCoordScale(const Vector2 &value)
Sets the offset to apply to texture coordinates, shifting the source rectangle in the source texture...
float Matrix4[16]
4x4 float matrix, whose layout is compatible with GL.
Definition: RendererCommon.h:46
void setGlobalProjectionTransform(const Matrix4 &matrix)
Sets the projection matrix, which is a global uniform.
Shader use by Renderer to draw textured rectangles (sprites).
Definition: SpriteShader.h:33
std::shared_ptr< AttributeSet > AttributeSetPtr
Shared pointer typedef for AttributeSet.
Definition: PointerDeclarations.h:63
b2Vec2 Vector2
2D float vector, whose layout is compatible with GL.
Definition: RendererCommon.h:50
std::shared_ptr< Texture > TexturePtr
Shared pointer typedef for Texture.
Definition: PointerDeclarations.h:173
void setTexture(const TexturePtr &texture)
Sets the source Texture to apply to the drawn rectangle.
void setTransform(const Matrix4 &matrix)
Sets the model transform.
void setTexCoordOffset(const Vector2 &value)
Sets the scaling factor to apply to texture coordinates, shrinking or expanding the source rectangle ...
virtual void updateState() override
Implementation of InstancedShader::updateState().
Helper class to implement InstancedShader subclasses, by managing a shared Shader.
Definition: InstancedShaderBase.h:44
A helper to define singletons for InstancedShaders.
Definition: PointerDeclarations.h:45