-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathshader.hpp
44 lines (28 loc) · 803 Bytes
/
shader.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
#ifndef REMATRIX_SHADER_HPP
#define REMATRIX_SHADER_HPP
#include <GL/glew.h>
#include "decl.hpp"
namespace rematrix {
struct shader {
shader(GLenum type, const char* src = nullptr);
shader(shader&& other) noexcept;
~shader();
shader& operator=(shader&& other) noexcept;
void compile(const char* src);
GLuint id() const
{
return id_;
}
private:
GLuint id_ { 0 };
};
//----------------------------------------------------------------------------
struct vertex_shader : shader {
vertex_shader(const char* src = nullptr);
};
//----------------------------------------------------------------------------
struct fragment_shader : shader {
fragment_shader(const char* src = nullptr);
};
} // namespace rematrix
#endif // REMATRIX_SHADER_HPP