Blender
V3.3
|
Main GHOST container to manage OpenXR through. More...
#include <GHOST_XrContext.h>
Public Member Functions | |
Session management | |
Manage session lifetime and delegate public calls to GHOST_XrSession. | |
void | startSession (const GHOST_XrSessionBeginInfo *begin_info) override |
void | endSession () override |
bool | isSessionRunning () const override |
void | drawSessionViews (void *draw_customdata) override |
void | handleSessionStateChange (const XrEventDataSessionStateChanged &lifecycle) |
Public Accessors and Mutators | |
Public as in, exposed in the Ghost API. | |
GHOST_XrSession * | getSession () override |
const GHOST_XrSession * | getSession () const override |
void | setGraphicsContextBindFuncs (GHOST_XrGraphicsContextBindFn bind_fn, GHOST_XrGraphicsContextUnbindFn unbind_fn) override |
void | setDrawViewFunc (GHOST_XrDrawViewFn draw_view_fn) override |
bool | needsUpsideDownDrawing () const override |
Ghost Internal Accessors and Mutators | |
GHOST_TXrOpenXRRuntimeID | getOpenXRRuntimeID () const |
const GHOST_XrCustomFuncs & | getCustomFuncs () const |
GHOST_TXrGraphicsBinding | getGraphicsBindingType () const |
XrInstance | getInstance () const |
bool | isDebugMode () const |
bool | isDebugTimeMode () const |
bool | isExtensionEnabled (const char *ext) const |
![]() | |
virtual | ~GHOST_IXrContext ()=default |
Create, Initialize and Destruct | |
GHOST_XrContext (const GHOST_XrContextCreateInfo *create_info) | |
~GHOST_XrContext () | |
void | initialize (const GHOST_XrContextCreateInfo *create_info) |
Error handling | |
void | dispatchErrorMessage (const class GHOST_XrException *exception) const override |
static void | setErrorHandler (GHOST_XrErrorHandlerFn handler_fn, void *customdata) |
Main GHOST container to manage OpenXR through.
Creating a context using GHOST_XrContextCreate involves dynamically connecting to the OpenXR runtime, likely reading the OS OpenXR configuration (i.e. active_runtime.json). So this is something that should better be done using lazy-initialization.
Definition at line 52 of file GHOST_XrContext.h.
GHOST_XrContext::GHOST_XrContext | ( | const GHOST_XrContextCreateInfo * | create_info | ) |
Definition at line 47 of file GHOST_XrContext.cpp.
GHOST_XrContext::~GHOST_XrContext | ( | ) |
Definition at line 54 of file GHOST_XrContext.cpp.
References CHECK_XR_ASSERT.
|
overridevirtual |
Implements GHOST_IXrContext.
Definition at line 244 of file GHOST_XrContext.cpp.
References error(), and isDebugMode().
Implements GHOST_IXrContext.
Definition at line 539 of file GHOST_XrContext.cpp.
|
overridevirtual |
Implements GHOST_IXrContext.
Definition at line 522 of file GHOST_XrContext.cpp.
const GHOST_XrCustomFuncs & GHOST_XrContext::getCustomFuncs | ( | ) | const |
Definition at line 606 of file GHOST_XrContext.cpp.
Referenced by GHOST_XrSession::start(), GHOST_XrSession::unbindGraphicsContext(), and GHOST_XrSession::~GHOST_XrSession().
GHOST_TXrGraphicsBinding GHOST_XrContext::getGraphicsBindingType | ( | ) | const |
Definition at line 611 of file GHOST_XrContext.cpp.
Referenced by GHOST_XrSession::start().
XrInstance GHOST_XrContext::getInstance | ( | ) | const |
Definition at line 616 of file GHOST_XrContext.cpp.
Referenced by GHOST_XrSession::attachActionSets(), GHOST_XrSession::createActionBindings(), GHOST_XrSession::createActions(), GHOST_XrSession::createActionSet(), GHOST_XrEventsHandle(), GHOST_XrSession::loadControllerModel(), and GHOST_XrSession::start().
GHOST_TXrOpenXRRuntimeID GHOST_XrContext::getOpenXRRuntimeID | ( | ) | const |
Definition at line 601 of file GHOST_XrContext.cpp.
|
overridevirtual |
Implements GHOST_IXrContext.
Definition at line 568 of file GHOST_XrContext.cpp.
|
overridevirtual |
Needed for the GHOST C api.
Implements GHOST_IXrContext.
Definition at line 563 of file GHOST_XrContext.cpp.
void GHOST_XrContext::handleSessionStateChange | ( | const XrEventDataSessionStateChanged & | lifecycle | ) |
Delegates event to session, allowing context to destruct the session if needed.
Definition at line 547 of file GHOST_XrContext.cpp.
References GHOST_XrSession::SESSION_DESTROY.
Referenced by GHOST_XrEventsHandle().
void GHOST_XrContext::initialize | ( | const GHOST_XrContextCreateInfo * | create_info | ) |
Definition at line 70 of file GHOST_XrContext.cpp.
References isDebugMode().
bool GHOST_XrContext::isDebugMode | ( | ) | const |
Definition at line 621 of file GHOST_XrContext.cpp.
Referenced by dispatchErrorMessage(), GHOST_XrEventsHandle(), initialize(), and GHOST_XrSession::start().
bool GHOST_XrContext::isDebugTimeMode | ( | ) | const |
Definition at line 626 of file GHOST_XrContext.cpp.
bool GHOST_XrContext::isExtensionEnabled | ( | const char * | ext | ) | const |
Definition at line 631 of file GHOST_XrContext.cpp.
References blender::bke::attribute_accessor_functions::contains().
Referenced by GHOST_XrSession::loadControllerModel().
|
overridevirtual |
Implements GHOST_IXrContext.
Definition at line 534 of file GHOST_XrContext.cpp.
|
overridevirtual |
Implements GHOST_IXrContext.
Definition at line 588 of file GHOST_XrContext.cpp.
|
overridevirtual |
Implements GHOST_IXrContext.
Definition at line 583 of file GHOST_XrContext.cpp.
References GHOST_XrCustomFuncs::draw_view_fn.
|
static |
Definition at line 262 of file GHOST_XrContext.cpp.
Referenced by GHOST_XrErrorHandler().
|
overridevirtual |
Implements GHOST_IXrContext.
Definition at line 573 of file GHOST_XrContext.cpp.
References GHOST_XrCustomFuncs::gpu_ctx_bind_fn, and GHOST_XrCustomFuncs::gpu_ctx_unbind_fn.
|
overridevirtual |
Implements GHOST_IXrContext.
Definition at line 510 of file GHOST_XrContext.cpp.
References GHOST_XrCustomFuncs::session_create_fn, GHOST_XrCustomFuncs::session_exit_customdata, and GHOST_XrCustomFuncs::session_exit_fn.