diff options
author | amy <[email protected]> | 2023-05-26 17:27:46 +0000 |
---|---|---|
committer | amy <[email protected]> | 2023-05-26 17:27:46 +0000 |
commit | 6ecdbc879bb12dde9ea57d35fb482b6c1a4727f2 (patch) | |
tree | 0a364e002fe87572b9de76741e00e1c2453e9c37 /src/shader.h | |
parent | f24f476724d5585e253b7e9b7f1b767fe5c8bb6c (diff) |
a
Diffstat (limited to 'src/shader.h')
-rw-r--r-- | src/shader.h | 25 |
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 |