*.glsl: use version 130

This commit is contained in:
Zack Buhman 2025-12-11 18:21:12 -06:00
parent f8f81fd954
commit 60b3cca3c4
8 changed files with 11 additions and 9 deletions

View File

@ -37,8 +37,8 @@ int main()
glfwInit(); glfwInit();
glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API); glfwWindowHint(GLFW_CLIENT_API, GLFW_OPENGL_API);
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 0);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_ANY_PROFILE);
GLFWwindow* window = glfwCreateWindow(vp_width, vp_height, "advent-of-pixel-shaders", NULL, NULL); GLFWwindow* window = glfwCreateWindow(vp_width, vp_height, "advent-of-pixel-shaders", NULL, NULL);
if (window == NULL) { if (window == NULL) {

View File

@ -43,6 +43,8 @@ uint compile_shader(const void * vp,
glAttachShader(shader_program, vertex_shader); glAttachShader(shader_program, vertex_shader);
glAttachShader(shader_program, fragment_shader); glAttachShader(shader_program, fragment_shader);
glBindAttribLocation(shader_program, 0, "position");
glLinkProgram(shader_program); glLinkProgram(shader_program);
{ {

View File

@ -1,4 +1,4 @@
#version 330 core #version 130
out vec4 fragment_color; out vec4 fragment_color;

View File

@ -1,4 +1,4 @@
#version 330 core #version 130
uniform sampler2D input_sampler; uniform sampler2D input_sampler;
uniform vec4 input_dim; // w h halfpx_w halfpx_h uniform vec4 input_dim; // w h halfpx_w halfpx_h

View File

@ -1,4 +1,4 @@
#version 330 core #version 130
uniform sampler2D input_sampler; uniform sampler2D input_sampler;
uniform vec4 input_dim; // w h halfpx_w halfpx_h uniform vec4 input_dim; // w h halfpx_w halfpx_h

View File

@ -1,4 +1,4 @@
#version 330 core #version 130
uniform sampler2D input_sampler_a; uniform sampler2D input_sampler_a;
uniform sampler2D input_sampler_b; uniform sampler2D input_sampler_b;

View File

@ -1,4 +1,4 @@
#version 330 core #version 130
uniform sampler2D input_sampler; uniform sampler2D input_sampler;
uniform vec4 dim; // w h halfpx_w halfpx_h uniform vec4 dim; // w h halfpx_w halfpx_h

View File

@ -1,6 +1,6 @@
#version 330 core #version 130
layout (location = 0) in vec2 position; in vec2 position;
out vec2 f_position; out vec2 f_position;