picogl.ui.backend.glut.prefer_apple_glut

Prefer Apple GLUT.framework over Homebrew freeglut on macOS.

Homebrew freeglut installs libglut.dylib (X11 + Mesa). On case-insensitive APFS, ctypes.util.find_library("GLUT") resolves that to /opt/homebrew/lib/libGLUT.dylib, so PyOpenGL’s Darwin platform loads freeglut instead of /System/Library/Frameworks/GLUT.framework.

freeglut then creates an X11 window with no CGL context, and PyOpenGL raises: Attempt to retrieve context when no valid context on glutDisplayFunc.

Import this module before import OpenGL.GLUT.

Attributes

_APPLE_GL

_APPLE_GLUT

_patched

Functions

prefer_apple_glut() → bool

Make PyOpenGL bind Cocoa GLUT instead of Homebrew freeglut.

Module Contents

picogl.ui.backend.glut.prefer_apple_glut._APPLE_GL = '/System/Library/Frameworks/OpenGL.framework/OpenGL'[source]
picogl.ui.backend.glut.prefer_apple_glut._APPLE_GLUT = '/System/Library/Frameworks/GLUT.framework/GLUT'[source]
picogl.ui.backend.glut.prefer_apple_glut._patched = False[source]
picogl.ui.backend.glut.prefer_apple_glut.prefer_apple_glut() → bool[source]

Make PyOpenGL bind Cocoa GLUT instead of Homebrew freeglut.