[Bf-blender-cvs] [2ee9c60c205] soc-2019-openxr: Finish OpenXR GLX binding initialization

Julian Eisel noreply at git.blender.org
Wed Jun 19 21:14:16 CEST 2019


Commit: 2ee9c60c2058dba3d963983b7e427ffe9d2f2aac
Author: Julian Eisel
Date:   Wed Jun 19 21:11:21 2019 +0200
Branches: soc-2019-openxr
https://developer.blender.org/rB2ee9c60c2058dba3d963983b7e427ffe9d2f2aac

Finish OpenXR GLX binding initialization

Monado now opens a window here when asking it to start a session. That
seems to be the case because it doesn't detect the HMD as direct mode
capable yet. But that shouldn't be an issue from our side.

===================================================================

M	intern/ghost/intern/GHOST_ContextGLX.cpp
M	intern/ghost/intern/GHOST_XRSession.cpp

===================================================================

diff --git a/intern/ghost/intern/GHOST_ContextGLX.cpp b/intern/ghost/intern/GHOST_ContextGLX.cpp
index 4203a32f150..8bde9f69b02 100644
--- a/intern/ghost/intern/GHOST_ContextGLX.cpp
+++ b/intern/ghost/intern/GHOST_ContextGLX.cpp
@@ -273,6 +273,7 @@ GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext()
           m_window = (Window)glXCreatePbuffer(m_display, framebuffer_config[0], pbuffer_attribs);
         }
 
+        m_fbconfig = framebuffer_config[0];
         XFree(framebuffer_config);
       }
     }
diff --git a/intern/ghost/intern/GHOST_XRSession.cpp b/intern/ghost/intern/GHOST_XRSession.cpp
index f0c621e6307..f7f2095cc3c 100644
--- a/intern/ghost/intern/GHOST_XRSession.cpp
+++ b/intern/ghost/intern/GHOST_XRSession.cpp
@@ -74,9 +74,14 @@ void GHOST_XRGraphicsBinding::initFromGhostContext(GHOST_TGraphicsBinding type,
     case GHOST_kXRGraphicsOpenGL: {
 #if defined(WITH_X11)
       GHOST_ContextGLX *ctx_glx = static_cast<GHOST_ContextGLX *>(ghost_ctx);
+      XVisualInfo *visual_info = glXGetVisualFromFBConfig(ctx_glx->m_display, ctx_glx->m_fbconfig);
 
       oxr_binding.glx.type = XR_TYPE_GRAPHICS_BINDING_OPENGL_XLIB_KHR;
       oxr_binding.glx.xDisplay = ctx_glx->m_display;
+      oxr_binding.glx.glxFBConfig = ctx_glx->m_fbconfig;
+      oxr_binding.glx.glxDrawable = ctx_glx->m_window;
+      oxr_binding.glx.glxContext = ctx_glx->m_context;
+      oxr_binding.glx.visualid = visual_info->visualid;
 #elif defined(WIN32)
       GHOST_ContextWGL *ctx_wgl = static_cast<GHOST_ContextWGL *>(ghost_ctx);



More information about the Bf-blender-cvs mailing list