Blender
V3.3
intern
ghost
intern
GHOST_Xr.cpp
Go to the documentation of this file.
1
/* SPDX-License-Identifier: GPL-2.0-or-later */
2
9
#include <cassert>
10
#include <string>
11
12
#include "
GHOST_C-api.h
"
13
14
#include "
GHOST_XrContext.h
"
15
#include "
GHOST_XrException.h
"
16
#include "
GHOST_Xr_intern.h
"
17
18
GHOST_XrContextHandle
GHOST_XrContextCreate
(
const
GHOST_XrContextCreateInfo *create_info)
19
{
20
auto
xr_context = std::make_unique<GHOST_XrContext>(create_info);
21
22
/* TODO GHOST_XrContext's should probably be owned by the GHOST_System, which will handle context
23
* creation and destruction. Try-catch logic can be moved to C-API then. */
24
try
{
25
xr_context->initialize(create_info);
26
}
27
catch
(
GHOST_XrException
&
e
) {
28
xr_context->dispatchErrorMessage(&
e
);
29
return
nullptr
;
30
}
31
32
/* Give ownership to the caller. */
33
return
(GHOST_XrContextHandle)xr_context.release();
34
}
35
36
void
GHOST_XrContextDestroy
(GHOST_XrContextHandle xr_contexthandle)
37
{
38
delete
(
GHOST_XrContext
*)xr_contexthandle;
39
}
40
41
void
GHOST_XrErrorHandler
(GHOST_XrErrorHandlerFn handler_fn,
void
*customdata)
42
{
43
GHOST_XrContext::setErrorHandler
(handler_fn, customdata);
44
}
GHOST_C-api.h
GHOST C-API function and type declarations.
GHOST_XrContext.h
GHOST_XrException.h
GHOST_XrContextCreate
GHOST_XrContextHandle GHOST_XrContextCreate(const GHOST_XrContextCreateInfo *create_info)
Definition:
GHOST_Xr.cpp:18
GHOST_XrContextDestroy
void GHOST_XrContextDestroy(GHOST_XrContextHandle xr_contexthandle)
Definition:
GHOST_Xr.cpp:36
GHOST_XrErrorHandler
void GHOST_XrErrorHandler(GHOST_XrErrorHandlerFn handler_fn, void *customdata)
Definition:
GHOST_Xr.cpp:41
GHOST_Xr_intern.h
e
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
Definition:
bmesh_query_inline.h:34
GHOST_XrContext
Main GHOST container to manage OpenXR through.
Definition:
GHOST_XrContext.h:52
GHOST_XrContext::setErrorHandler
static void setErrorHandler(GHOST_XrErrorHandlerFn handler_fn, void *customdata)
Definition:
GHOST_XrContext.cpp:262
GHOST_XrException
Definition:
GHOST_XrException.h:12
Generated on Sat Jul 27 2024 14:57:55 for Blender by
doxygen
1.9.1