aboutsummaryrefslogtreecommitdiff
path: root/src/shader.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/shader.h')
-rw-r--r--src/shader.h25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/shader.h b/src/shader.h
new file mode 100644
index 0000000..0868a65
--- /dev/null
+++ b/src/shader.h
@@ -0,0 +1,25 @@
+#include "glfww.h"
+#ifndef __shader
+#define __shader
+static const char* vshader_src =
+ "#version 330\n"
+ "layout (location = 0) in vec3 pos;\n"
+ "layout (location = 1) in vec3 color;\n"
+ "out vec3 ncolor;\n"
+ "void main(){\n"
+ "ncolor = color;\n"
+ "gl_Position = vec4(pos,1.0);\n"
+ "};";
+static const char* fshader_src =
+ "#version 330\n"
+ "in vec3 ncolor;\n"
+ "out vec4 color;\n"
+ "void main(){\n"
+ //"gl_FragColor = vec4(1.0,0.0,1.0,1.0);\n"
+ "gl_FragColor = vec4(ncolor,1.0);\n"
+ "};";
+
+GLuint vshader_comp(const char*);
+GLuint fshader_comp(const char*);
+GLuint build_shader(GLuint, GLuint);
+#endif