From f719c5875bd610999882504d74ce5407a33f7096 Mon Sep 17 00:00:00 2001 From: Riley King-Saunders Date: Thu, 10 Jul 2025 00:46:00 +1000 Subject: [PATCH] Updated shader to now require a vertex buffer to be bound --- bin/shaders/src/simple.vert | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/bin/shaders/src/simple.vert b/bin/shaders/src/simple.vert index 985d702..bae2cb7 100644 --- a/bin/shaders/src/simple.vert +++ b/bin/shaders/src/simple.vert @@ -1,21 +1,11 @@ #version 450 +layout(location = 0) in vec2 in_position; +layout(location = 1) in vec3 in_colour; layout(location = 0) out vec3 fragColour; -vec2 positions[3] = vec2[]( - vec2(0.0, -0.5), - vec2(0.5, 0.5), - vec2(-0.5, 0.5) -); - -vec3 colours[3] = vec3[]( - vec3(1.0, 0.0, 0.0), - vec3(0.0, 1.0, 0.0), - vec3(0.0, 0.0, 1.0) -); - void main() { - gl_Position = vec4(positions[gl_VertexIndex], 0.0, 1.0); - fragColour = colours[gl_VertexIndex]; + gl_Position = vec4(in_position, 0.0, 1.0); + fragColour = in_colour; } \ No newline at end of file