Skip to content

Commit

Permalink
Merge pull request #570 from mishmish66/master
Browse files Browse the repository at this point in the history
Fixes #569 (🐛 Bug)
  • Loading branch information
kevin-thankyou-lin authored Nov 21, 2024
2 parents ac8df07 + f69ac66 commit 74c6aac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions robosuite/renderers/context/egl_context.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ def __init__(self, max_width, max_height, device_id=0):
del max_width, max_height # unused
num_configs = ctypes.c_long()
config_size = 1
config = EGL.EGLConfig()
config_ptr = EGL.EGLConfig() # Makes an opaque pointer
EGL.eglReleaseThread()
global EGL_DISPLAY
if EGL_DISPLAY is None:
Expand All @@ -126,14 +126,14 @@ def __init__(self, max_width, max_height, device_id=0):
"required for creating a headless rendering context."
)
atexit.register(EGL.eglTerminate, EGL_DISPLAY)
EGL.eglChooseConfig(EGL_DISPLAY, EGL_ATTRIBUTES, ctypes.byref(config), config_size, num_configs)
EGL.eglChooseConfig(EGL_DISPLAY, EGL_ATTRIBUTES, config_ptr, config_size, num_configs)
if num_configs.value < 1:
raise RuntimeError(
"EGL failed to find a framebuffer configuration that matches the "
"desired attributes: {}".format(EGL_ATTRIBUTES)
)
EGL.eglBindAPI(EGL.EGL_OPENGL_API)
self._context = EGL.eglCreateContext(EGL_DISPLAY, config, EGL.EGL_NO_CONTEXT, None)
self._context = EGL.eglCreateContext(EGL_DISPLAY, config_ptr, EGL.EGL_NO_CONTEXT, None)
if not self._context:
raise RuntimeError("Cannot create an EGL context.")

Expand Down

0 comments on commit 74c6aac

Please sign in to comment.