diff --git a/runtime/shaders/basic.f.glsl b/runtime/shaders/basic.f.glsl index b51cfff..a3339ee 100644 --- a/runtime/shaders/basic.f.glsl +++ b/runtime/shaders/basic.f.glsl @@ -1,3 +1,5 @@ +#version 410 + uniform vec4 color; void main(void) diff --git a/runtime/shaders/basic.v.glsl b/runtime/shaders/basic.v.glsl index a281dd3..0cb046b 100644 --- a/runtime/shaders/basic.v.glsl +++ b/runtime/shaders/basic.v.glsl @@ -1,10 +1,12 @@ +#version 410 + /* Viewport width and height */ uniform ivec2 viewport_size; /* Position of lower left corner of glyph */ uniform ivec2 position; /* Vertex coordinates: x, y */ -attribute vec2 coords; +layout(location = 0) in vec2 coords; /** * Map coordinates such that: @@ -17,5 +19,5 @@ vec2 map_to_screen(vec2 position) void main(void) { - gl_Position = vec4(map_to_screen((vec2)position + coords), 0, 1); + gl_Position = vec4(map_to_screen(vec2(position) + coords), 0, 1); } diff --git a/runtime/shaders/rect.v.glsl b/runtime/shaders/rect.v.glsl index 2c551b1..83cf721 100644 --- a/runtime/shaders/rect.v.glsl +++ b/runtime/shaders/rect.v.glsl @@ -1,3 +1,5 @@ +#version 410 + /* Viewport width and height */ uniform ivec2 viewport_size; /* Position of lower left corner of rectangle */ @@ -6,7 +8,7 @@ uniform ivec2 position; uniform ivec2 size; /* Vertex coordinates: x, y (0 or 1) */ -attribute ivec2 coords; +layout(location = 0) in ivec2 coords; /** * Map coordinates such that: @@ -19,5 +21,5 @@ vec2 map_to_screen(vec2 position) void main(void) { - gl_Position = vec4(map_to_screen((vec2)(position + coords * size)), 0, 1); + gl_Position = vec4(map_to_screen(vec2(position + coords * size)), 0, 1); } diff --git a/runtime/shaders/text.f.glsl b/runtime/shaders/text.f.glsl index 0494621..4f7b074 100644 --- a/runtime/shaders/text.f.glsl +++ b/runtime/shaders/text.f.glsl @@ -1,5 +1,7 @@ +#version 410 + /* Texture coordinate: s, t */ -varying vec2 texture_coord_v; +in vec2 texture_coord_v; /* Texture unit */ uniform sampler2D texture; diff --git a/runtime/shaders/text.v.glsl b/runtime/shaders/text.v.glsl index 5851094..1901809 100644 --- a/runtime/shaders/text.v.glsl +++ b/runtime/shaders/text.v.glsl @@ -1,13 +1,15 @@ +#version 410 + /* Viewport width and height */ uniform ivec2 viewport_size; /* Position of lower left corner of glyph */ uniform ivec2 position; /* Vertex coordinates: x, y, s, t */ -attribute vec4 coords; +layout(location = 0) in vec4 coords; /* Output texture coordinate: s, t */ -varying vec2 texture_coord_v; +out vec2 texture_coord_v; /** * Map coordinates such that: @@ -20,6 +22,6 @@ vec2 map_to_screen(vec2 position) void main(void) { - gl_Position = vec4(map_to_screen((vec2)position + coords.xy), 0, 1); + gl_Position = vec4(map_to_screen(vec2(position) + coords.xy), 0, 1); texture_coord_v = coords.zw; }