summaryrefslogtreecommitdiffhomepage
path: root/tile-shader.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'tile-shader.hpp')
-rw-r--r--tile-shader.hpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/tile-shader.hpp b/tile-shader.hpp
index 68a2c0e5..03c32cc5 100644
--- a/tile-shader.hpp
+++ b/tile-shader.hpp
@@ -31,20 +31,20 @@
#include <Magnum/GL/AbstractShaderProgram.h>
#include <Magnum/GL/Texture.h>
#include <Magnum/Math/Color.h>
+#include <Magnum/Math/Vector2.h>
+#include <Magnum/Math/Matrix4.h>
namespace Magnum::Examples {
-class tile_shader : public GL::AbstractShaderProgram {
-public:
+struct tile_shader : GL::AbstractShaderProgram
+{
typedef GL::Attribute<0, Vector3> Position;
typedef GL::Attribute<1, Vector2> TextureCoordinates;
explicit tile_shader();
- tile_shader& setColor(const Color3& color) {
- setUniform(_colorUniform, color);
- return *this;
- }
+ auto& set_color(const Color3& color) { setUniform(_color_uniform, color); return *this; }
+ auto& set_projection(const Math::Matrix4<float>& mat) { setUniform(_projection_uniform, mat); return *this; }
tile_shader& bindTexture(GL::Texture2D& texture) {
texture.bind(TextureUnit);
@@ -54,7 +54,7 @@ public:
private:
enum: Int { TextureUnit = 0 };
- Int _colorUniform;
+ Int _color_uniform, _projection_uniform;
};
} // namespace Magnum::Examples