From f1444d38ed6c8a350cbeb6edd01306df42ccf2f6 Mon Sep 17 00:00:00 2001 From: sanine Date: Sun, 12 Mar 2023 00:44:46 -0600 Subject: add glGetString bind --- demo/fancy/main.lua | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'demo') diff --git a/demo/fancy/main.lua b/demo/fancy/main.lua index 19b3239..3defde6 100644 --- a/demo/fancy/main.lua +++ b/demo/fancy/main.lua @@ -24,6 +24,12 @@ glfw.MakeContextCurrent(w) gl.InitGlad() gl.Enable(gl.DEPTH_TEST) +-- query gl data +print("vendor", gl.GetString(gl.VENDOR)) +print("renderer", gl.GetString(gl.RENDERER)) +print("version", gl.GetString(gl.VERSION)) +print("glsl version", gl.GetString(gl.SHADING_LANGUAGE_VERSION)) + --window.setFramebufferSizeCallback(w, function(_, width, height) -- print(string.format("resize: (%d, %d)", width, height)) -- gl.Viewport(0, 0, width, height) @@ -33,7 +39,7 @@ gl.Enable(gl.DEPTH_TEST) --====== compile shaders ======-- local vertexShaderSource = [[ -#version 330 core +#version 410 core layout (location = 0) in vec3 aPos; layout (location = 1) in vec2 aTexCoord; @@ -53,7 +59,7 @@ void main() ]] local fragmentShaderSource = [[ -#version 330 core +#version 410 core out vec4 FragColor; in vec3 pos; -- cgit v1.2.1