-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshader.hpp
54 lines (39 loc) · 1.13 KB
/
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
45
46
47
48
49
50
51
52
53
54
#ifndef SHADER_HPP
#define SHADER_HPP
#include "gl_object.hpp"
#include <string>
namespace plush {
/**
* An OpenGL shader.
*/
class Shader : public GLObject {
protected:
friend class ShaderProgram;
Shader(GLenum shaderType);
Shader(GLenum shaderType, const std::string &filename);
public:
~Shader();
/**
* Loads and compiles the shader from the source string.
* Previous shader binary is removed.
* Throws GLError on failure (typically when the source has errors).
*/
void loadFromString(const std::string &text);
/**
* Loads and compiles the shader from the source file.
* Previous shader binary is removed.
*/
void load(const std::string &filename);
};
class FragmentShader : public Shader {
public:
FragmentShader();
FragmentShader(const std::string &filename);
};
class VertexShader : public Shader {
public:
VertexShader();
VertexShader(const std::string &filename);
};
}
#endif