diff --git a/src/main.c b/src/main.c index 6cdf547..832dfb5 100644 --- a/src/main.c +++ b/src/main.c @@ -37,8 +37,8 @@ int main() glfwInit(); glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); - glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); - glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0); + glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_ANY_PROFILE); GLFWwindow* window = glfwCreateWindow(vp_width, vp_height, "advent-of-pixel-shaders", NULL, NULL); if (window == NULL) { diff --git a/src/opengl.c b/src/opengl.c index ef37465..f3620a4 100644 --- a/src/opengl.c +++ b/src/opengl.c @@ -43,6 +43,8 @@ uint compile_shader(const void * vp, glAttachShader(shader_program, vertex_shader); glAttachShader(shader_program, fragment_shader); + + glBindAttribLocation(shader_program, 0, "position"); glLinkProgram(shader_program); { diff --git a/src/solution/2025/01/solution.fs.glsl b/src/solution/2025/01/solution.fs.glsl index b45e357..b69cb42 100644 --- a/src/solution/2025/01/solution.fs.glsl +++ b/src/solution/2025/01/solution.fs.glsl @@ -1,4 +1,4 @@ -#version 330 core +#version 130 out vec4 fragment_color; diff --git a/src/solution/2025/03/parse_input.fs.glsl b/src/solution/2025/03/parse_input.fs.glsl index fec9d31..d29ef5a 100644 --- a/src/solution/2025/03/parse_input.fs.glsl +++ b/src/solution/2025/03/parse_input.fs.glsl @@ -1,4 +1,4 @@ -#version 330 core +#version 130 uniform sampler2D input_sampler; uniform vec4 input_dim; // w h halfpx_w halfpx_h diff --git a/src/solution/2025/03/solution.fs.glsl b/src/solution/2025/03/solution.fs.glsl index 2bce4f9..c6358eb 100644 --- a/src/solution/2025/03/solution.fs.glsl +++ b/src/solution/2025/03/solution.fs.glsl @@ -1,4 +1,4 @@ -#version 330 core +#version 130 uniform sampler2D input_sampler; uniform vec4 input_dim; // w h halfpx_w halfpx_h diff --git a/src/solution/2025/04/count.fs.glsl b/src/solution/2025/04/count.fs.glsl index 4830b8f..02f4302 100644 --- a/src/solution/2025/04/count.fs.glsl +++ b/src/solution/2025/04/count.fs.glsl @@ -1,4 +1,4 @@ -#version 330 core +#version 130 uniform sampler2D input_sampler_a; uniform sampler2D input_sampler_b; diff --git a/src/solution/2025/04/simulate.fs.glsl b/src/solution/2025/04/simulate.fs.glsl index 86cc126..e129593 100644 --- a/src/solution/2025/04/simulate.fs.glsl +++ b/src/solution/2025/04/simulate.fs.glsl @@ -1,4 +1,4 @@ -#version 330 core +#version 130 uniform sampler2D input_sampler; uniform vec4 dim; // w h halfpx_w halfpx_h diff --git a/src/solution/generic.vs.glsl b/src/solution/generic.vs.glsl index e1b1518..38964bc 100644 --- a/src/solution/generic.vs.glsl +++ b/src/solution/generic.vs.glsl @@ -1,6 +1,6 @@ -#version 330 core +#version 130 -layout (location = 0) in vec2 position; +in vec2 position; out vec2 f_position;