diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2019-06-21 22:51:03 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2019-06-21 23:27:40 +0300 |
commit | 24146563a01665dca292f16cc1385c23fcb53c82 (patch) | |
tree | 9c035ad97d2e81c012a0b8fbed5d14f263929a27 /source | |
parent | 2ee9c60c2058dba3d963983b7e427ffe9d2f2aac (diff) |
Cleanup: Use CamelCase for XR functions/types
Also silence warnings.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesdna/DNA_windowmanager_types.h | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm.c | 2 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 33 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_window.c | 2 |
4 files changed, 19 insertions, 22 deletions
diff --git a/source/blender/makesdna/DNA_windowmanager_types.h b/source/blender/makesdna/DNA_windowmanager_types.h index e420ec27f7f..a67eb7388d7 100644 --- a/source/blender/makesdna/DNA_windowmanager_types.h +++ b/source/blender/makesdna/DNA_windowmanager_types.h @@ -42,7 +42,7 @@ struct wmKeyMap; struct wmMsgBus; struct wmOperator; struct wmOperatorType; -struct GHOST_XRContext; +struct GHOST_XrContext; /* forwards */ struct PointerRNA; @@ -180,7 +180,7 @@ typedef struct wmWindowManager { struct wmMsgBus *message_bus; //#ifdef WITH_OPENXR - struct GHOST_XRContext *xr_context; + struct GHOST_XrContext *xr_context; //#endif } wmWindowManager; diff --git a/source/blender/windowmanager/intern/wm.c b/source/blender/windowmanager/intern/wm.c index ddb4dfe2a4a..913b939bb87 100644 --- a/source/blender/windowmanager/intern/wm.c +++ b/source/blender/windowmanager/intern/wm.c @@ -379,7 +379,7 @@ void wm_close_and_free(bContext *C, wmWindowManager *wm) #ifdef WITH_OPENXR if (wm->xr_context != NULL) { - GHOST_XR_context_destroy(wm->xr_context); + GHOST_XrContextDestroy(wm->xr_context); } #endif diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 7debf2ce5c6..a5b0687f05d 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -3539,17 +3539,17 @@ static void WM_OT_stereo3d_set(wmOperatorType *ot) } #ifdef WITH_OPENXR -static void *xr_session_gpu_binding_context_create(GHOST_TGraphicsBinding graphics_lib) +static void *xr_session_gpu_binding_context_create(GHOST_TXrGraphicsBinding graphics_lib) { # ifndef WIN32 - BLI_assert(graphics_lib == GHOST_kXRGraphicsOpenGL); + BLI_assert(graphics_lib == GHOST_kXrGraphicsOpenGL); # endif switch (graphics_lib) { - case GHOST_kXRGraphicsOpenGL: + case GHOST_kXrGraphicsOpenGL: return WM_opengl_context_create(); # ifdef WIN32 - case GHOST_kXRGraphicsD3D11: { + case GHOST_kXrGraphicsD3D11: { wmWindowManager *wm = G_MAIN->wm.first; for (wmWindow *win = wm->windows.first; win; win = win->next) { /* TODO better lookup? For now only one D3D window possible, but later? */ @@ -3565,13 +3565,13 @@ static void *xr_session_gpu_binding_context_create(GHOST_TGraphicsBinding graphi } } -static void xr_session_gpu_binding_context_destroy(GHOST_TGraphicsBinding graphics_lib, +static void xr_session_gpu_binding_context_destroy(GHOST_TXrGraphicsBinding graphics_lib, void *context) { GHOST_ContextHandle ghost_context = context; switch (graphics_lib) { - case GHOST_kXRGraphicsOpenGL: + case GHOST_kXrGraphicsOpenGL: WM_opengl_context_dispose(ghost_context); default: return; @@ -3629,14 +3629,11 @@ static void xr_session_window_create(bContext *C) if (win->ghostwin) { GHOST_SetTitle(win->ghostwin, "Blender VR Session View"); - return win; } else { /* very unlikely! but opening a new window can fail */ wm_window_close(C, CTX_wm_manager(C), win); CTX_wm_window_set(C, win_prev); - - return NULL; } } # endif /* WIN32 */ @@ -3647,17 +3644,17 @@ static bool wm_xr_ensure_context(wmWindowManager *wm) return true; } - const GHOST_TGraphicsBinding gpu_bindings_candidates[] = { - GHOST_kXRGraphicsOpenGL, + const GHOST_TXrGraphicsBinding gpu_bindings_candidates[] = { + GHOST_kXrGraphicsOpenGL, # ifdef WIN32 - GHOST_kXRGraphicsD3D11, + GHOST_kXrGraphicsD3D11, # endif }; - const GHOST_XRContextCreateInfo create_info = { + const GHOST_XrContextCreateInfo create_info = { .gpu_binding_candidates = gpu_bindings_candidates, .gpu_binding_candidates_count = ARRAY_SIZE(gpu_bindings_candidates)}; - wm->xr_context = GHOST_XR_context_create(&create_info); + wm->xr_context = GHOST_XrContextCreate(&create_info); return wm->xr_context != NULL; } @@ -3670,18 +3667,18 @@ static int wm_xr_session_toggle_exec(bContext *C, wmOperator *UNUSED(op)) if (wm_xr_ensure_context(wm) == false) { return OPERATOR_CANCELLED; } - if (GHOST_XR_session_is_running(wm->xr_context)) { - GHOST_XR_session_end(wm->xr_context); + if (GHOST_XrSessionIsRunning(wm->xr_context)) { + GHOST_XrSessionEnd(wm->xr_context); } else { # if defined(WIN32) xr_session_window_create(C); # endif - GHOST_XR_graphics_context_bind_funcs(wm->xr_context, + GHOST_XrGraphicsContextBindFuncs(wm->xr_context, xr_session_gpu_binding_context_create, xr_session_gpu_binding_context_destroy); - GHOST_XR_session_start(wm->xr_context); + GHOST_XrSessionStart(wm->xr_context); } return OPERATOR_FINISHED; } diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index 0e2b5f26675..842fa5394bd 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -1657,7 +1657,7 @@ void wm_window_process_events(const bContext *C) } hasevent |= wm_window_timer(C); #ifdef WITH_OPENXR - hasevent |= GHOST_XR_events_handle(CTX_wm_manager(C)->xr_context); + hasevent |= GHOST_XrEventsHandle(CTX_wm_manager(C)->xr_context); #endif /* no event, we sleep 5 milliseconds */ |