picogl.ui.backend.glut.prefer_glx ================================= .. py:module:: picogl.ui.backend.glut.prefer_glx .. autoapi-nested-parse:: Prefer GLX over EGL for PyOpenGL on Linux. Under Wayland, PyOpenGL often selects the EGL platform. freeglut still creates GLX contexts, so ``GetCurrentContext()`` returns 0 and ``glutDisplayFunc`` raises: Attempt to retrieve context when no valid context Set ``PYOPENGL_PLATFORM=glx`` **before** importing OpenGL. Import this module before ``import OpenGL`` / ``OpenGL.GLUT``. Attributes ---------- .. autoapisummary:: picogl.ui.backend.glut.prefer_glx._patched Functions --------- .. autoapisummary:: picogl.ui.backend.glut.prefer_glx.prefer_glx Module Contents --------------- .. py:data:: _patched :value: False .. py:function:: prefer_glx() -> bool Force PyOpenGL onto the GLX platform on Linux when unset.