Blender
V2.93
intern
ghost
intern
GHOST_Xr.cpp
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or
3
* modify it under the terms of the GNU General Public License
4
* as published by the Free Software Foundation; either version 2
5
* of the License, or (at your option) any later version.
6
*
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
11
*
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software Foundation,
14
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15
*/
16
23
#include <cassert>
24
#include <string>
25
26
#include "
GHOST_C-api.h
"
27
28
#include "
GHOST_XrContext.h
"
29
#include "
GHOST_XrException.h
"
30
#include "
GHOST_Xr_intern.h
"
31
32
GHOST_XrContextHandle
GHOST_XrContextCreate
(
const
GHOST_XrContextCreateInfo *create_info)
33
{
34
auto
xr_context = std::make_unique<GHOST_XrContext>(create_info);
35
36
/* TODO GHOST_XrContext's should probably be owned by the GHOST_System, which will handle context
37
* creation and destruction. Try-catch logic can be moved to C-API then. */
38
try
{
39
xr_context->initialize(create_info);
40
}
41
catch
(
GHOST_XrException
&
e
) {
42
xr_context->dispatchErrorMessage(&
e
);
43
return
nullptr
;
44
}
45
46
/* Give ownership to the caller. */
47
return
(GHOST_XrContextHandle)xr_context.release();
48
}
49
50
void
GHOST_XrContextDestroy
(GHOST_XrContextHandle xr_contexthandle)
51
{
52
delete
(
GHOST_XrContext
*)xr_contexthandle;
53
}
54
55
void
GHOST_XrErrorHandler
(GHOST_XrErrorHandlerFn handler_fn,
void
*customdata)
56
{
57
GHOST_XrContext::setErrorHandler
(handler_fn, customdata);
58
}
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:32
GHOST_XrContextDestroy
void GHOST_XrContextDestroy(GHOST_XrContextHandle xr_contexthandle)
Definition:
GHOST_Xr.cpp:50
GHOST_XrErrorHandler
void GHOST_XrErrorHandler(GHOST_XrErrorHandlerFn handler_fn, void *customdata)
Definition:
GHOST_Xr.cpp:55
GHOST_Xr_intern.h
e
ATTR_WARN_UNUSED_RESULT const BMVert const BMEdge * e
Definition:
bmesh_query_inline.h:48
GHOST_XrContext
Main GHOST container to manage OpenXR through.
Definition:
GHOST_XrContext.h:64
GHOST_XrContext::setErrorHandler
static void setErrorHandler(GHOST_XrErrorHandlerFn handler_fn, void *customdata)
Definition:
GHOST_XrContext.cpp:266
GHOST_XrException
Definition:
GHOST_XrException.h:25
Generated on Tue Jan 31 2023 14:37:24 for Blender by
doxygen
1.9.1