64 void initialize(
const GHOST_XrContextCreateInfo *create_info);
66 void startSession(
const GHOST_XrSessionBeginInfo *begin_info)
override;
75 static void setErrorHandler(GHOST_XrErrorHandlerFn handler_fn,
void *customdata);
79 GHOST_XrGraphicsContextUnbindFn unbind_fn)
override;
97 static GHOST_XrErrorHandlerFn s_error_handler;
98 static void *s_error_handler_customdata;
100 std::unique_ptr<OpenXRInstanceData> m_oxr;
105 std::unique_ptr<class GHOST_XrSession> m_session;
108 GHOST_TXrGraphicsBinding m_gpu_binding_type = GHOST_kXrGraphicsUnknown;
111 std::vector<const char *> m_enabled_extensions;
113 std::vector<const char *> m_enabled_layers;
118 bool m_debug =
false;
119 bool m_debug_time =
false;
121 void createOpenXRInstance(
const std::vector<GHOST_TXrGraphicsBinding> &graphics_binding_types);
122 void storeInstanceProperties();
123 void initDebugMessenger();
125 void printSDKVersion();
126 void printInstanceInfo();
127 void printAvailableAPILayersAndExtensionsInfo();
128 void printExtensionsAndAPILayersToEnable();
130 void initApiLayers();
131 void initExtensions();
132 void initExtensionsEx(std::vector<XrExtensionProperties> &extensions,
const char *layer_name);
133 void getAPILayersToEnable(std::vector<const char *> &r_ext_names);
134 void getExtensionsToEnable(
const std::vector<GHOST_TXrGraphicsBinding> &graphics_binding_types,
135 std::vector<const char *> &r_ext_names);
136 std::vector<GHOST_TXrGraphicsBinding> determineGraphicsBindingTypesToEnable(
137 const GHOST_XrContextCreateInfo *create_info);
138 GHOST_TXrGraphicsBinding determineGraphicsBindingTypeToUse(
139 const std::vector<GHOST_TXrGraphicsBinding> &enabled_types,
140 const GHOST_XrContextCreateInfo *create_info);
Main GHOST container to manage OpenXR through.
XrInstance getInstance() const
void setDisablePassthroughFunc(GHOST_XrDisablePassthroughFn disable_passthrough_fn) override
GHOST_TXrOpenXRRuntimeID getOpenXRRuntimeID() const
void setGraphicsContextBindFuncs(GHOST_XrGraphicsContextBindFn bind_fn, GHOST_XrGraphicsContextUnbindFn unbind_fn) override
GHOST_TXrGraphicsBinding getGraphicsBindingType() const
void drawSessionViews(void *draw_customdata) override
void handleSessionStateChange(const XrEventDataSessionStateChanged &lifecycle)
const GHOST_XrCustomFuncs & getCustomFuncs() const
void dispatchErrorMessage(const class GHOST_XrException *exception) const override
bool isDebugTimeMode() const
void setDrawViewFunc(GHOST_XrDrawViewFn draw_view_fn) override
bool needsUpsideDownDrawing() const override
bool isSessionRunning() const override
void startSession(const GHOST_XrSessionBeginInfo *begin_info) override
void endSession() override
bool isExtensionEnabled(const char *ext) const
GHOST_XrContext(const GHOST_XrContextCreateInfo *create_info)
static void setErrorHandler(GHOST_XrErrorHandlerFn handler_fn, void *customdata)
void setPassthroughEnabledFunc(GHOST_XrPassthroughEnabledFn passthrough_enabled_fn) override
GHOST_XrSession * getSession() override