Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions python/mujoco/rendering/classic/gl_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
_SYSTEM = platform.system()
_MUJOCO_GL = os.environ.get('MUJOCO_GL', '').lower().strip()
if _MUJOCO_GL not in ('disable', 'disabled', 'off', 'false', '0'):
_VALID_MUJOCO_GL = ('enable', 'enabled', 'on', 'true', '1' , 'glfw', '')
_VALID_MUJOCO_GL = ('enable', 'enabled', 'on', 'true', '1', 'glfw', '')
if _SYSTEM == 'Linux':
_VALID_MUJOCO_GL += ('glx', 'egl', 'osmesa')
elif _SYSTEM == 'Windows':
Expand All @@ -41,7 +41,15 @@
from mujoco.egl import GLContext as _GLContext
GLContext = _GLContext
elif _SYSTEM == 'Darwin':
from mujoco.cgl import GLContext as _GLContext
if _MUJOCO_GL == 'glfw':
from mujoco.glfw import GLContext as _GLContext
elif _MUJOCO_GL == 'cgl':
from mujoco.cgl import GLContext as _GLContext
else:
try:
from mujoco.cgl import GLContext as _GLContext
except (AttributeError, OSError):
from mujoco.glfw import GLContext as _GLContext
GLContext = _GLContext
else:
from mujoco.glfw import GLContext as _GLContext
Expand Down