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

#include "../../Result.hpp"
#include "../../types.hpp"
#include "../../utils.hpp"
#include "../../Vec.hpp"
#include "DeviceMemory.hpp"
#include <vector>
#include <memory>

namespace amalgine {
    class Shader;

    class ShaderProgram
    {
        DISABLE_COPY(ShaderProgram)
    public:
        ~ShaderProgram();
        static Result<std::unique_ptr<ShaderProgram>> build(const std::vector<Shader*> &shaders);
        int set_uniform(const char *name, const vec3f &value);
        int set_vertex_input(const char *name, const DeviceMemory &data);

        void use();
    private:
        ShaderProgram(u32 shader_program_id);
    private:
        u32 program_id;
    };
}