Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <eiseljulian@gmail.com>2019-06-28 17:24:24 +0300
committerJulian Eisel <eiseljulian@gmail.com>2019-06-28 17:24:24 +0300
commit231dbd53bf30f59c0dfc8cd928e0e046c57d87d2 (patch)
tree77fe086dab326e5a356ce77e35d255a6849def88 /source/blender/windowmanager/intern/wm_xr.c
parentd3e48fb096d865118c32453b38a85bb7ba37cb2f (diff)
Support Window-less (offscreen) VR session on Windows
Uses the new wmSurface type (non-window drawable container) to manage the OpenGL, DirectX and GPU module contexts. The draw callback of the XR surface calls the GHOST_Xr session drawing routines. What you should see when starting a VR session now (using the WMR runtime): The Windows Mixed Reality Portal pops up, and a blue background is drawn on the HMD. This is from the blue color clear call we do in the drawing preparations of the GHOST_Xr session drawing.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_xr.c')
-rw-r--r--source/blender/windowmanager/intern/wm_xr.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/windowmanager/intern/wm_xr.c b/source/blender/windowmanager/intern/wm_xr.c
index e02aee7beb2..cad02fc20c2 100644
--- a/source/blender/windowmanager/intern/wm_xr.c
+++ b/source/blender/windowmanager/intern/wm_xr.c
@@ -104,14 +104,15 @@ wmSurface *wm_xr_session_surface_create(wmWindowManager *wm, unsigned int gpu_bi
wm_window_clear_drawable(wm);
wm_surface_clear_drawable();
+ surface->ghost_ctx = WM_opengl_context_create();
+ WM_opengl_context_activate(surface->ghost_ctx);
switch (gpu_binding_type) {
case GHOST_kXrGraphicsOpenGL:
- surface->ghost_ctx = WM_opengl_context_create();
- WM_opengl_context_activate(surface->ghost_ctx);
break;
#ifdef WIN32
case GHOST_kXrGraphicsD3D11:
+ surface->secondary_ghost_ctx = WM_directx_context_create();
break;
#endif
}