diff options
-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() { |