diff options
Diffstat (limited to 'shaders')
-rw-r--r-- | shaders/tile-shader.cpp | 2 | ||||
-rw-r--r-- | shaders/tile-shader.hpp | 1 | ||||
-rw-r--r-- | shaders/tile-shader.vert | 3 |
3 files changed, 5 insertions, 1 deletions
diff --git a/shaders/tile-shader.cpp b/shaders/tile-shader.cpp index 12bc0a6d..87238f5a 100644 --- a/shaders/tile-shader.cpp +++ b/shaders/tile-shader.cpp @@ -30,6 +30,8 @@ tile_shader::tile_shader() set_tint({1, 1, 1, 1}); } +tile_shader::~tile_shader() = default; + tile_shader& tile_shader::set_scale(const Vector2& scale) { if (scale != _scale) diff --git a/shaders/tile-shader.hpp b/shaders/tile-shader.hpp index 93f78a1c..6cb81c7e 100644 --- a/shaders/tile-shader.hpp +++ b/shaders/tile-shader.hpp @@ -12,6 +12,7 @@ struct tile_shader : GL::AbstractShaderProgram typedef GL::Attribute<1, Vector2> TextureCoordinates; explicit tile_shader(); + ~tile_shader() override; Vector2 scale() const { return _scale; } tile_shader& set_scale(const Vector2& scale); diff --git a/shaders/tile-shader.vert b/shaders/tile-shader.vert index 8b3f2dba..2b622317 100644 --- a/shaders/tile-shader.vert +++ b/shaders/tile-shader.vert @@ -5,11 +5,12 @@ layout (location = 1) uniform vec2 offset; layout (location = 0) in vec4 position; layout (location = 1) in vec2 texcoords; +layout (location = 2) in float foo = 1; noperspective out vec2 frag_texcoords; void main() { float cx = 1/scale.x, cy = 1/scale.y; float x = -position.y, y = -position.x, z = position.z; - gl_Position = vec4((x-y+offset.x)*cx, (x+y+z*2)*cy*.59-offset.y*cy, 0, 1); + gl_Position = vec4((x-y+offset.x)*cx, (x+y+z*2)*cy*.59-offset.y*cy*foo, 0, 1); frag_texcoords = texcoords; } |