summaryrefslogtreecommitdiff
path: root/include/mbgl/shader/icon_shader.hpp
blob: b97b3c2be3263e49a9ff399fa5913664662afb98 (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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#ifndef MBGL_SHADER_SHADER_ICON
#define MBGL_SHADER_SHADER_ICON

#include <mbgl/shader/shader.hpp>

namespace mbgl {

class IconShader : public Shader {
public:
    IconShader();

    void bind(char *offset);

    void setImage(int32_t image);
    void setColor(const std::array<float, 4>& color);
    void setDimension(const std::array<float, 2>& dimension);
    void setSize(float size);
    void setRatio(float ratio);

private:
    int32_t a_pos = -1;
    int32_t a_tex = -1;

    int32_t image = -1;
    int32_t u_image = -1;

    std::array<float, 4> color = {{}};
    int32_t u_color = -1;

    std::array<float, 2> dimension = {{}};
    int32_t u_dimension = -1;

    float size = 0;
    int32_t u_size = -1;

    float ratio = 0;
    int32_t u_ratio = -1;
};

}

#endif