diff options
author | Christoph Helma <helma@in-silico.ch> | 2017-09-04 15:18:37 +0200 |
---|---|---|
committer | Christoph Helma <helma@in-silico.ch> | 2017-09-04 15:18:37 +0200 |
commit | f2b6eee6299e520b508e403e0084b2d2cf93ff57 (patch) | |
tree | 345914cee15f47179171ea08c2fc356da9eeb643 | |
parent | 280848fdf7dc9568064360087f458618f82ba555 (diff) |
hardcoded vertex shader
-rw-r--r-- | sv.c | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -24,7 +24,14 @@ int bars; typedef struct Shad { GLuint id; - char vertex[40]; + /* + static const char vertex_src[] = { + "#version 450 core\n" + "const vec2 quadVertices[4] = { vec2(-1.0, -1.0), vec2(1.0, -1.0), vec2(-1.0, 1.0), vec2(1.0, 1.0) };\n" + "void main() { gl_Position = vec4(quadVertices[gl_VertexID], 0.0, 1.0); }\n" + }; + */ + //char vertex[40]; char fragment[40]; time_t mtime; int new; @@ -68,9 +75,7 @@ void screenshot() { } } } - if (0 == stbi_write_png(output_file, width, height, 4, pixels, width * 4)) { - printf("can't create file %s",output_file); - } + if (0 == stbi_write_png(output_file, width, height, 4, pixels, width * 4)) { printf("can't create file %s",output_file); } } static void error_callback(int error, const char* description) { fputs(description, stderr); } @@ -242,7 +247,7 @@ void *watchShader() { int main(int argc, char **argv) { createWindow(); - strncpy(shader.vertex,"shader.vert",40); + //strncpy(shader.vertex,"shader.vert",40); strncpy(shader.fragment,"shader.frag",40); shader.new = 1; unsigned int VAO; |