summaryrefslogtreecommitdiff
path: root/include/llmr/shader/icon_shader.hpp
blob: daf37b374ad250d69a317096f1c583c7394e2db5 (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 LLMR_SHADER_SHADER_ICON
#define LLMR_SHADER_SHADER_ICON

#include <llmr/shader/shader.hpp>

namespace llmr {

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