picogl.ui.backend.glut.prefer_apple_glut ======================================== .. py:module:: picogl.ui.backend.glut.prefer_apple_glut .. autoapi-nested-parse:: 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 ---------- .. autoapisummary:: picogl.ui.backend.glut.prefer_apple_glut._APPLE_GL picogl.ui.backend.glut.prefer_apple_glut._APPLE_GLUT picogl.ui.backend.glut.prefer_apple_glut._patched Functions --------- .. autoapisummary:: picogl.ui.backend.glut.prefer_apple_glut.prefer_apple_glut Module Contents --------------- .. py:data:: _APPLE_GL :value: '/System/Library/Frameworks/OpenGL.framework/OpenGL' .. py:data:: _APPLE_GLUT :value: '/System/Library/Frameworks/GLUT.framework/GLUT' .. py:data:: _patched :value: False .. py:function:: prefer_apple_glut() -> bool Make PyOpenGL bind Cocoa GLUT instead of Homebrew freeglut.