Skip to content

MacOS support#160

Open
nicoabie wants to merge 6 commits intoparoj:masterfrom
nicoabie:macos
Open

MacOS support#160
nicoabie wants to merge 6 commits intoparoj:masterfrom
nicoabie:macos

Conversation

@nicoabie
Copy link
Copy Markdown

@nicoabie nicoabie commented Apr 26, 2025

would like feedback if possible if this continues to be running on linux or I broke something.

@paroj
Copy link
Copy Markdown
Owner

paroj commented Apr 29, 2025

take a look at #161 where I assume you install freeglut with brew.

It allows successfully compiling the tutorials, however it requires X11 to run..

@nicoabie
Copy link
Copy Markdown
Author

Hey thanks a lot for taking the time for doing that!
Probably you saw me struggling with the linux builds and yes I'm was not very sure of what I was doing.

I tested #161 doing a brew install freeglut.

The first issue I found is ERROR: Internal error <FBConfig with necessary capabilities not found> in function fgOpenWindow and that is because X11 does not like GLUT_STENCIL see

#if defined(__APPLE__) && !defined(USE_COCOA)

After removing GLUT_STENCIL and running again Tut01 I get a segmentation fault.

I run cmake -DOPENGL_gl_LIBRARY=/opt/homebrew/lib/libGL.dylib .. then cmake --build . --config Release

Same segmentation fault

I comment out glutInitContextVersion (3, 3); because in my branch I saw macos didn't like that and then I get

Your OpenGL version is 0, 0. You must have at least OpenGL 3.3 to run this tutorial.

Commenting that glload code out another seg fault whereas in my branch it picked up the mesa implementation.

What I was going to attempt before looking into this PR was remove glload in favor of glad https://www.khronos.org/opengl/wiki/OpenGL_Loading_Library also it seems possible to use include(FetchContent) in cmake to not have the libs code in the repository and have a better tracking of deps versions.

I'm new to all this so I could be wrong but trying to give a hand so let me know your thoughts and how can I be of help.

@paroj
Copy link
Copy Markdown
Owner

paroj commented Apr 30, 2025

it seems that freeglut does not work with recent OSX because of X11.

As SDL2 is a better choice for starting a OpenGL project anyway, I would rather port the framework to that instead of trying to fix freeglut.

@nicoabie
Copy link
Copy Markdown
Author

In my PR I'm able to run lastest commit of freeglut (not latest release) both with X11 and Cocoa

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

Successfully merging this pull request may close these issues.

2 participants