Ver Fonte

Add version directives to GLSL shaders

Although not technically required, I believe it is best practice for
shaders to specify which version of the GLSL spec they conform to.

Closes #864.
A. Tombs há 9 anos atrás
pai
commit
1b17a5293c
2 ficheiros alterados com 4 adições e 0 exclusões
  1. 2 0
      tests/cursor.c
  2. 2 0
      tests/sharing.c

+ 2 - 0
tests/cursor.c

@@ -47,6 +47,7 @@
 #define CURSOR_FRAME_COUNT 60
 #define CURSOR_FRAME_COUNT 60
 
 
 static const char* vertex_shader_text =
 static const char* vertex_shader_text =
+"#version 110\n"
 "uniform mat4 MVP;\n"
 "uniform mat4 MVP;\n"
 "attribute vec2 vPos;\n"
 "attribute vec2 vPos;\n"
 "void main()\n"
 "void main()\n"
@@ -55,6 +56,7 @@ static const char* vertex_shader_text =
 "}\n";
 "}\n";
 
 
 static const char* fragment_shader_text =
 static const char* fragment_shader_text =
+"#version 110\n"
 "void main()\n"
 "void main()\n"
 "{\n"
 "{\n"
 "    gl_FragColor = vec4(1.0);\n"
 "    gl_FragColor = vec4(1.0);\n"

+ 2 - 0
tests/sharing.c

@@ -38,6 +38,7 @@
 #include "linmath.h"
 #include "linmath.h"
 
 
 static const char* vertex_shader_text =
 static const char* vertex_shader_text =
+"#version 110\n"
 "uniform mat4 MVP;\n"
 "uniform mat4 MVP;\n"
 "attribute vec2 vPos;\n"
 "attribute vec2 vPos;\n"
 "varying vec2 texcoord;\n"
 "varying vec2 texcoord;\n"
@@ -48,6 +49,7 @@ static const char* vertex_shader_text =
 "}\n";
 "}\n";
 
 
 static const char* fragment_shader_text =
 static const char* fragment_shader_text =
+"#version 110\n"
 "uniform sampler2D texture;\n"
 "uniform sampler2D texture;\n"
 "uniform vec3 color;\n"
 "uniform vec3 color;\n"
 "varying vec2 texcoord;\n"
 "varying vec2 texcoord;\n"