Commit 4893989640174cec4077aee0034f5ab5c1323cea

Thomas de Grivel 2024-01-28T13:07:51

fix shaders -> GLSL v330

diff --git a/libc3/window/sdl2/gl_ortho.c b/libc3/window/sdl2/gl_ortho.c
index 00b4349..b8ec10a 100644
--- a/libc3/window/sdl2/gl_ortho.c
+++ b/libc3/window/sdl2/gl_ortho.c
@@ -18,33 +18,33 @@
 #include "gl_square.h"
 
 static const char * g_gl_ortho_vertex_shader_src =
-  "#version 420 core\n"
+  "#version 330 core\n"
   "layout (location = 0) in vec3 iPos;\n"
   "layout (location = 1) in vec3 iNormal;\n"
   "layout (location = 2) in vec2 iTexCoord;\n"
-  "layout (location = 0) out vec2 oTexCoord;\n"
-  "layout (location = 1) out vec3 oFragNormal;\n"
+  "out vec3 fragNormal;\n"
+  "out vec2 texCoord;\n"
   "uniform mat4 uProjectionMatrix;\n"
   "uniform mat4 uViewMatrix;\n"
   "uniform mat4 uModelMatrix;\n"
   "void main() {\n"
   "  gl_Position = vec4(uProjectionMatrix * uViewMatrix * \n"
   "                     uModelMatrix * vec4(iPos, 1.0));\n"
-  "  oTexCoord = iTexCoord;\n"
-  "  oFragNormal = vec3(mat3(transpose(inverse(uModelMatrix))) *\n"
-  "                     iNormal);\n"
+  "  texCoord = iTexCoord;\n"
+  "  fragNormal = vec3(mat3(transpose(inverse(uModelMatrix))) *\n"
+  "                    iNormal);\n"
   "}\n";
 
 static const char * g_gl_ortho_fragment_shader_src =
-  "#version 420 core\n"
-  "layout (location = 0) in vec2 iTexCoord;\n"
-  "layout (location = 1) in vec3 iFragNormal;\n"
+  "#version 330 core\n"
+  "in vec3 fragNormal;\n"
+  "in vec2 texCoord;\n"
   "out vec4 oFragColor;\n"
   "uniform vec4 uColor;\n"
   "uniform bool uEnableTex2D;\n"
   "uniform sampler2D uTex2D;\n"
   "void main() {\n"
-  "  vec4 texColor = texture(uTex2D, iTexCoord);\n"
+  "  vec4 texColor = texture(uTex2D, texCoord);\n"
   "  if (uEnableTex2D) {\n"
   "    oFragColor = vec4(texColor[0] * uColor[0],\n"
   "                      texColor[1] * uColor[1],\n"