aboutsummaryrefslogtreecommitdiff
path: root/include/RenderBackend/OpenGL/Uniform.hpp
blob: d6e6e647e47259994b160886cbb388f1fbdd1276 (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
#pragma once

#include "../../Result.hpp"
#include "../../types.hpp"
#include "../../utils.hpp"
#include "../../Vec.hpp"
#include "Texture2D.hpp"

#include <glm/gtc/type_ptr.hpp>

namespace amalgine {
    class Uniform {
        DISABLE_COPY(Uniform)
        friend class ShaderFrame;
        friend class Result<Uniform>;
    public:
        Uniform(Uniform&&) = default;
        ~Uniform();

        void set(float value);
        void set(const vec3f &value);
        void set(const glm::mat4 &value);
        void set(const Texture2D &texture);
    private:
        Uniform(){}
        Uniform(i32 uniform_id, u32 shader_program_id);
        void use();
    private:
        i32 uniform_id;
        u32 program_id;
    };
}