diff options
author | lonkaars <loek@pipeframe.xyz> | 2024-05-18 15:48:21 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2024-05-18 15:48:21 +0200 |
commit | def25f92deb08587a9248ae529d3dbd39f9f772c (patch) | |
tree | a1a0d2f36ef60c72fb88aa253873df66f2c12653 | |
parent | 08529a4a8e685637c1e733a6fff528a813d9a95c (diff) |
update to opengl 4.60
-rw-r--r-- | main.c | 3 | ||||
-rw-r--r-- | shader.frag | 5 | ||||
-rw-r--r-- | shader.vert | 2 |
3 files changed, 7 insertions, 3 deletions
@@ -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() { |