Skip to content

Commit

Permalink
OpenXR - Linux - Improve X11 graphics binding
Browse files Browse the repository at this point in the history
  • Loading branch information
MadDeCoDeR committed Jan 18, 2025
1 parent fcdb87a commit 4b01f07
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion neo/sys/sdl/sdl_glimp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,14 @@ void* GetOpenXRGraphicsBinding()
case SDL_SYSWM_X11: {
x11Binding = {XR_TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR};
x11Binding.xDisplay = windowInfo.info.x11.display;
x11Binding.visualid = windowInfo.info.x11.window;
XWindowAttributes xattrs;
XGetWindowAttributes(windowInfo.info.x11.display, windowInfo.info.x11.window, &xattrs);
x11Binding.visualid = XVisualIDFromVisual(xattrs.visual);
GLXContext context = (GLXContext)SDL_GL_GetCurrentContext();
x11Binding.glxContext = context;
x11Binding.glxDrawable = glXGetCurrentDrawable();
int elements = 0;
x11Binding.glxFBConfig = glXGetFBConfigs(x11Binding.xDisplay, 0, &elements)[0];
return &x11Binding;
}
case SDL_SYSWM_WAYLAND: {
Expand Down

0 comments on commit 4b01f07

Please sign in to comment.