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