Blender
V2.93
intern
ghost
intern
GHOST_XrSession.h
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
21
#pragma once
22
23
#include <map>
24
#include <memory>
25
26
#include "
GHOST_Xr_intern.h
"
27
28
class
GHOST_XrContext
;
29
class
GHOST_XrSwapchain
;
30
struct
GHOST_XrDrawInfo
;
31
struct
OpenXRSessionData
;
32
33
class
GHOST_XrSession
{
34
public
:
35
enum
LifeExpectancy
{
36
SESSION_KEEP_ALIVE
,
37
SESSION_DESTROY
,
38
};
39
40
GHOST_XrSession
(
GHOST_XrContext
&xr_context);
41
~GHOST_XrSession
();
42
43
void
start
(
const
GHOST_XrSessionBeginInfo *begin_info);
44
void
requestEnd
();
45
46
LifeExpectancy
handleStateChangeEvent
(
const
XrEventDataSessionStateChanged &lifecycle);
47
48
bool
isRunning
()
const
;
49
bool
needsUpsideDownDrawing
()
const
;
50
51
void
unbindGraphicsContext
();
/* Public so context can ensure it's unbound as needed. */
52
53
void
draw
(
void
*draw_customdata);
54
55
private
:
58
class
GHOST_XrContext
*m_context;
59
60
std::unique_ptr<OpenXRSessionData> m_oxr;
/* Could use stack, but PImpl is preferable. */
61
63
class
GHOST_Context
*m_gpu_ctx =
nullptr
;
64
std::unique_ptr<class GHOST_IXrGraphicsBinding> m_gpu_binding;
65
67
std::unique_ptr<GHOST_XrDrawInfo> m_draw_info;
68
69
void
initSystem
();
70
void
beginSession();
71
void
endSession();
72
73
void
bindGraphicsContext();
74
75
void
prepareDrawing();
76
XrCompositionLayerProjection drawLayer(
77
std::vector<XrCompositionLayerProjectionView> &r_proj_layer_views,
void
*draw_customdata);
78
void
drawView(
GHOST_XrSwapchain
&swapchain,
79
XrCompositionLayerProjectionView &r_proj_layer_view,
80
XrSpaceLocation &view_location,
81
XrView &
view
,
82
void
*draw_customdata);
83
void
beginFrameDrawing();
84
void
endFrameDrawing(std::vector<XrCompositionLayerBaseHeader *> &layers);
85
};
view
static AppView * view
Definition:
FRS_freestyle.cpp:77
GHOST_Xr_intern.h
initSystem
static void initSystem(LaplacianDeformModifierData *lmd, Object *ob, Mesh *mesh, float(*vertexCos)[3], int numVerts)
Definition:
MOD_laplaciandeform.c:537
GHOST_Context
Definition:
GHOST_Context.h:34
GHOST_XrContext
Main GHOST container to manage OpenXR through.
Definition:
GHOST_XrContext.h:64
GHOST_XrSession
Definition:
GHOST_XrSession.h:33
GHOST_XrSession::~GHOST_XrSession
~GHOST_XrSession()
Definition:
GHOST_XrSession.cpp:70
GHOST_XrSession::draw
void draw(void *draw_customdata)
Definition:
GHOST_XrSession.cpp:338
GHOST_XrSession::GHOST_XrSession
GHOST_XrSession(GHOST_XrContext &xr_context)
Definition:
GHOST_XrSession.cpp:65
GHOST_XrSession::isRunning
bool isRunning() const
Definition:
GHOST_XrSession.cpp:463
GHOST_XrSession::handleStateChangeEvent
LifeExpectancy handleStateChangeEvent(const XrEventDataSessionStateChanged &lifecycle)
Definition:
GHOST_XrSession.cpp:219
GHOST_XrSession::needsUpsideDownDrawing
bool needsUpsideDownDrawing() const
Definition:
GHOST_XrSession.cpp:451
GHOST_XrSession::LifeExpectancy
LifeExpectancy
Definition:
GHOST_XrSession.h:35
GHOST_XrSession::SESSION_DESTROY
@ SESSION_DESTROY
Definition:
GHOST_XrSession.h:37
GHOST_XrSession::SESSION_KEEP_ALIVE
@ SESSION_KEEP_ALIVE
Definition:
GHOST_XrSession.h:36
GHOST_XrSession::start
void start(const GHOST_XrSessionBeginInfo *begin_info)
Definition:
GHOST_XrSession.cpp:153
GHOST_XrSession::unbindGraphicsContext
void unbindGraphicsContext()
Definition:
GHOST_XrSession.cpp:498
GHOST_XrSession::requestEnd
void requestEnd()
Definition:
GHOST_XrSession.cpp:201
GHOST_XrSwapchain
Definition:
GHOST_XrSwapchain.h:27
GHOST_XrDrawInfo
Definition:
GHOST_XrSession.cpp:51
OpenXRSessionData
Definition:
GHOST_XrSession.cpp:38
Generated on Tue Jan 31 2023 14:37:24 for Blender by
doxygen
1.9.1