From 6ecdbc879bb12dde9ea57d35fb482b6c1a4727f2 Mon Sep 17 00:00:00 2001 From: amy Date: Fri, 26 May 2023 17:27:46 +0000 Subject: a --- src/shader.h | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/shader.h (limited to 'src/shader.h') 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 -- cgit v1.2.3