macOS fltk OpenGL implementation does not support v410

38 views
Skip to first unread message

Gonzalo Garramuno

unread,
Aug 15, 2022, 8:46:29 PM8/15/22
to fltkc...@googlegroups.com
Currently, trying to compile a v410 shader ( which is valid macOS OpenGL on my machine and works with glfw and qt ), results in the following output:

ERROR: 0: #version 410
1:
2: in vec3 vPos;
3: in vec2 vTexture;
4: out vec2 fTexture;
5:
6: struct Transform
7: {
8: mat4 mvp;
9: };
10:
11: uniform Transform transform;
12:
13: void main()
14: {
15: gl_Position = transform.mvp * vec4(vPos, 1.0);
16: fTexture = vTexture;
17: }
ERROR: 0:1: '' : version '410' is not supported

The code, as mentioned works on glfw and qt on macOS as on fltk on linux.

Printing:

glString( GL_VERSION )

Returns for macOS fltk:
2.1 ATI-4.8.101

While on macOS glfw, it returns:
4.1 ATI-4.8.101

Any ideas what might be selecting the lowest OpenGL standard?



Gonzalo Garramuno
ggar...@gmail.com

imacarthur

unread,
Aug 16, 2022, 4:32:45 AM8/16/22
to fltk.coredev
I think that may be normal?
In my experience, a lot of GL implementations only seem to expose a fairly basic API level unless I specifically use GLEW to get at the more advanced extensions.
Though, I think that later macOS ports can expose higher API levels without GLEW... Not sure.

If you build the examples, what do OpenGL3-glut-test and OpenGL3test do on your machine? 

For me (on this WIn10 box with GLEW) they expose... (hold on, testing!) 
Using GLEW 2.2.0
GL_VERSION=4.6.0 NVIDIA 431.98
Shading Language Version=4.60

Though how useful or relevant that is for a macOS test I can not guess!


 

Manolo

unread,
Aug 16, 2022, 6:05:02 AM8/16/22
to fltk.coredev

Under macOS, you MUST add the FL_OPENGL3 flag to your Fl_GlWindow::mode() calls to get a context for GL version 3 or above. If you don't, you're stuck with GL 2.

Manolo

unread,
Aug 16, 2022, 6:06:46 AM8/16/22
to fltk.coredev
and also, GLEW is not useful under macOS.

Manolo

unread,
Aug 16, 2022, 6:08:29 AM8/16/22
to fltk.coredev
rather
# include <OpenGL/gl3.h>
is the macOS solution to get access to the GL 3 and GL 4 APIs.

Gonzalo Garramuno

unread,
Aug 16, 2022, 1:21:42 PM8/16/22
to fltkc...@googlegroups.com


> El 16 ago. 2022, a las 07:05, Manolo <manol...@gmail.com> escribió:
>
> See https://fltk.gitlab.io/fltk/opengl.html#opengl3
>
> Under macOS, you MUST add the FL_OPENGL3 flag to your Fl_GlWindow::mode() calls to get a context for GL version 3 or above. If you don't, you're stuck with GL 2.
>

Thank you, Manolo. Your answers are always to the point and solve my issues!!!


Gonzalo Garramuno
ggar...@gmail.com




Reply all
Reply to author
Forward
0 new messages