aboutsummaryrefslogtreecommitdiff
path: root/src/opengl/shaders.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/shaders.hpp')
-rw-r--r--src/opengl/shaders.hpp21
1 files changed, 21 insertions, 0 deletions
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 <GL/glew.h>
+#include <string>
+#include <vector>
+#include <fstream> // ifstream
+#include <sstream> // stringstream
+#include <iostream>
+
+# 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);