From e29a9115d185d0b752868a36c8d56f6020bc4134 Mon Sep 17 00:00:00 2001 From: Loic Guegan Date: Sun, 5 Jul 2020 18:55:39 +0200 Subject: Create basics source files --- src/opengl/shaders.hpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 src/opengl/shaders.hpp (limited to 'src/opengl/shaders.hpp') diff --git a/src/opengl/shaders.hpp b/src/opengl/shaders.hpp new file mode 100644 index 0000000..ba7da09 --- /dev/null +++ b/src/opengl/shaders.hpp @@ -0,0 +1,21 @@ +#include +#include +#include +#include // ifstream +#include // stringstream +#include + +# ifndef NDEBUG +#define SHADERS_RESOURCES "../resources/shaders/" +#else +#define SHADERS_RESOURCES "resources/shaders/" +#endif +/** + * Compile a shader: + * - Shader should contains both vertex and fragment code + * - Vertex code should begin with: // ----- Vertex Shader ----- + * - Fragment code should begin with: // ----- Fragment Shader ----- + * @param shader_path + * @return The generated program id + */ +GLuint CompileShader(std::string shader_path); -- cgit v1.2.3