aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphics/Shader.hpp
blob: d37d2c1d0e5c425fab422e4ce7241935303351f7 (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
#ifndef ENGINE_SHADER_H
#define ENGINE_SHADER_H

class Shader {
	GLuint shader_id;
	GLchar *error_log;

public:
	Shader() : shader_id(0), error_log(0) { }
	~Shader();

	int Compile(const char *path, GLenum shaderType);
	char *GetError() { return error_log; }
	GLuint GetID() { return shader_id; }
};

class ShaderManager {
	GLuint program_id;
	GLchar *error_log;

public:
	ShaderManager() : program_id(0), error_log(0) { }
	~ShaderManager();

	int Link(Shader *arr, int nsize);
	char *GetError() { return error_log; }
	GLuint GetID() { return program_id; }
	void Use();
};

#endif /* ENGINE_SHADER_H */