-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathprogram.hpp
54 lines (30 loc) · 1.11 KB
/
program.hpp
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
43
44
45
46
47
48
49
50
51
52
53
54
#ifndef REMATRIX_PROGRAM_HPP
#define REMATRIX_PROGRAM_HPP
#include <GL/glew.h>
#include "decl.hpp"
#include "matrix.hpp"
namespace rematrix {
struct program {
program();
program(const vertex_shader& v, const fragment_shader& f);
program(program&& other) noexcept;
~program();
program& operator=(program&& other) noexcept;
void link(const vertex_shader& v, const fragment_shader& f);
void use();
void bind_attrib_location(GLuint index, const char* name);
void bind_frag_data_location(GLuint color_number, const char* name);
GLint attrib_location(const GLchar* name) const;
GLint uniform_location(const GLchar* name) const;
void set_uniform(GLint location, GLint i);
void set_uniform(GLint location, GLfloat x);
void set_uniform(GLint location, GLint i1, GLint i2);
void set_uniform(GLint location, const vec3& v);
void set_uniform(GLint location, const vec4& v);
void set_uniform(GLint location, const mat4& m);
void set_uniform(GLint location, bool b);
private:
GLuint id_ { 0 };
};
} // namespace rematrix
#endif // REMATRIX_PROGRAM_HPP