summaryrefslogtreecommitdiffhomepage
path: root/shaders
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-10-09 01:21:51 +0200
committerStanislaw Halik <sthalik@misaki.pl>2022-10-09 01:21:51 +0200
commitd5212f948304b575b494b2065f14e934aaa426e1 (patch)
treeb533247df458138895f3b11b4c74fed8647d9fcb /shaders
parent70dc294b8ac3a62b9c61a75e0aec3064eef72122 (diff)
a
Diffstat (limited to 'shaders')
-rw-r--r--shaders/tile-shader.cpp3
-rw-r--r--shaders/tile-shader.hpp8
2 files changed, 6 insertions, 5 deletions
diff --git a/shaders/tile-shader.cpp b/shaders/tile-shader.cpp
index aeba4929..4648b263 100644
--- a/shaders/tile-shader.cpp
+++ b/shaders/tile-shader.cpp
@@ -3,6 +3,7 @@
#include <algorithm>
#include <Corrade/Containers/Reference.h>
#include <Corrade/Utility/Resource.h>
+#include <Magnum/Math/Vector4.h>
#include <Magnum/GL/Context.h>
#include <Magnum/GL/Shader.h>
#include <Magnum/GL/Version.h>
@@ -43,7 +44,7 @@ tile_shader& tile_shader::set_camera_offset(Vector2 camera_offset)
return *this;
}
-tile_shader& tile_shader::set_tint(const Color4& tint)
+tile_shader& tile_shader::set_tint(const Vector4& tint)
{
if (tint != tint_)
setUniform(TintUniform, tint_ = tint);
diff --git a/shaders/tile-shader.hpp b/shaders/tile-shader.hpp
index 2dd7e607..c0f0c656 100644
--- a/shaders/tile-shader.hpp
+++ b/shaders/tile-shader.hpp
@@ -2,7 +2,7 @@
#include <Magnum/GL/AbstractShaderProgram.h>
#include <Magnum/Math/Vector2.h>
#include <Magnum/Math/Vector3.h>
-#include <Magnum/Math/Color.h>
+#include <Magnum/Math/Vector4.h>
namespace Magnum::Examples {
@@ -17,14 +17,14 @@ struct tile_shader : GL::AbstractShaderProgram
tile_shader& set_scale(const Vector2& scale);
Vector2 camera_offset() const { return camera_offset_; }
tile_shader& set_camera_offset(Vector2 camera_offset);
- Color4 tint () const { return tint_; }
- tile_shader& set_tint(const Color4& tint);
+ Vector4 tint() const { return tint_; }
+ tile_shader& set_tint(const Vector4& tint);
static constexpr Vector2 project(Vector3 pt);
private:
Vector2 scale_, camera_offset_;
- Color4 tint_;
+ Vector4 tint_;
enum { ScaleUniform = 0, OffsetUniform = 1, TintUniform = 2, };
};