summaryrefslogtreecommitdiffhomepage
path: root/tile-shader.hpp
blob: 3a2b6d3754a15bcbecacb4056d19db54855accbe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once
#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 {

struct tile_shader : GL::AbstractShaderProgram
{
    typedef GL::Attribute<0, Vector3> Position;
    typedef GL::Attribute<1, Vector2> TextureCoordinates;

    explicit tile_shader();

    tile_shader& set_projection(const Math::Matrix4<float>& mat, float y_scale);

    tile_shader& bindTexture(GL::Texture2D& texture);

private:
    enum: Int { TextureUnit = 0 };

    Int _projection_uniform, _y_scale_uniform;
};

} // namespace Magnum::Examples