From def25f92deb08587a9248ae529d3dbd39f9f772c Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sat, 18 May 2024 15:48:21 +0200 Subject: update to opengl 4.60 --- main.c | 3 +++ shader.frag | 5 +++-- shader.vert | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/main.c b/main.c index 408a243..16e49fb 100644 --- a/main.c +++ b/main.c @@ -63,6 +63,9 @@ void test(const char* label, GLuint shader) { int main(int argc, char** argv) { // initialize window glfwInit(); + glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4); + glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 6); + glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_VISIBLE, GLFW_FALSE); GLFWwindow* window = glfwCreateWindow(800, 600, "test", NULL, NULL); glfwMakeContextCurrent(window); diff --git a/shader.frag b/shader.frag index f417dc1..082d27b 100644 --- a/shader.frag +++ b/shader.frag @@ -1,8 +1,9 @@ -#version 330 core +#version 460 core uniform float test; +layout(location = 0) out vec4 color; void main() { vec2 uv = gl_FragCoord.xy / ivec2(800, 600); - gl_FragColor = vec4(uv.xy, test, 1.0); + color = vec4(uv.xy, test, 1.0); } diff --git a/shader.vert b/shader.vert index f9cf360..ea0bea6 100644 --- a/shader.vert +++ b/shader.vert @@ -1,4 +1,4 @@ -#version 330 core +#version 460 core layout (location = 0) in vec3 vert; void main() { -- cgit v1.2.3