Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #569 (🐛 Bug) #570

Merged
merged 1 commit into from
Nov 21, 2024
Merged
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
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
Loading