aboutsummaryrefslogtreecommitdiff
path: root/include/mglpp/graphics/Shader.hpp
blob: 4e94a7e8208bb69426255ec2dd553814247db342 (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
#ifndef MGLPP_SHADER_HPP
#define MGLPP_SHADER_HPP

#include "../system/vec.hpp"

extern "C" {
#include <mgl/graphics/shader.h>
}

namespace mgl {
    class Shader {
    public:
        enum Type {
            Vertex,
            Fragment,
            Geometry
        };

        Shader();
        ~Shader();

        bool load_from_file(const char *filepath, Type type);
        bool set_uniform(const char *name, vec2f value);

        // If |shader| is nullptr then no shader is used
        static void use(Shader *shader);
    private:
        mgl_shader_program shader_program;
    };
}

#endif /* MGLPP_SHADER_HPP */