From 533abb2b643a0f8e1d41e0d570e08e3df5339f80 Mon Sep 17 00:00:00 2001 From: Joursoir Date: Tue, 23 Mar 2021 08:45:12 +0000 Subject: add shader subsystem --- src/graphics/Shader.hpp | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 src/graphics/Shader.hpp (limited to 'src/graphics/Shader.hpp') diff --git a/src/graphics/Shader.hpp b/src/graphics/Shader.hpp new file mode 100644 index 0000000..81841ad --- /dev/null +++ b/src/graphics/Shader.hpp @@ -0,0 +1,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 *source, 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 */ -- cgit v1.2.3-18-g5258