Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLSL version on Mac OS X #9

Open
biochem-fan opened this issue Apr 4, 2022 · 0 comments
Open

GLSL version on Mac OS X #9

biochem-fan opened this issue Apr 4, 2022 · 0 comments

Comments

@biochem-fan
Copy link

In case someone is having the same trouble as mine:

Apparently GTK-3 (installed via Homebrew) on Mac OS X Big Sur (Mac Book Pro 2015, Intel Iris Graphics 6100) requires a higher version of GLSL. The original code failed to compile:

Shader compilation failed: ERROR: 0:1: '' :  version '130' is not supported

410 worked.

diff --git a/glarea-app-window.c b/glarea-app-window.c
index cd78360..f7708b2 100644
--- a/glarea-app-window.c
+++ b/glarea-app-window.c
@@ -100,6 +100,8 @@ create_shader (int          shader_type,
                GError     **error,
                guint       *shader_out)
 {
+  printf("Supported GLSL version: %s\n", (char *)glGetString(GL_SHADING_LANGUAGE_VERSION));
+
   guint shader = glCreateShader (shader_type);
   glShaderSource (shader, 1, &source, NULL);
   glCompileShader (shader);
diff --git a/glarea-fragment.glsl b/glarea-fragment.glsl
index c331ad2..273ec33 100644
--- a/glarea-fragment.glsl
+++ b/glarea-fragment.glsl
@@ -1,4 +1,4 @@
-#version 130
+#version 410
 
 smooth in vec4 vertexColor;
 
diff --git a/glarea-vertex.glsl b/glarea-vertex.glsl
index 83dda48..9c36b3c 100644
--- a/glarea-vertex.glsl
+++ b/glarea-vertex.glsl
@@ -1,4 +1,4 @@
-#version 130
+#version 410
 
 in vec3 position;
 in vec3 color;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant