Debian Codegraph @

3rdparty/osgXR/src/OpenXR/EventHandler.h

raw symbols SCIP
1 // SPDX-License-Identifier: LGPL-2.1-only
2 // Copyright (C) 2021 James Hogan <[email protected]>
3
4 #ifndef OSGXR_OPENXR_EVENT_HANDLER
5 #define OSGXR_OPENXR_EVENT_HANDLER 1
6
7 #include <osg/Referenced>
8
9 #include <openxr/openxr.h>
10
11 namespace osgXR {
12
13 namespace OpenXR {
14
15 class Instance;
16 class Session;
17
18 /// This class handles OpenXR events.
19 class EventHandler : public osg::Referenced
20 {
21 public:
22
23 // Instance events
24
25 /// Top level OpenXR event handler.
26 void onEvent(Instance *instance, const XrEventDataBuffer *event);
27 /// Handle an otherwise unhandled event.
28 virtual void onUnhandledEvent(Instance *instance,
29 const XrEventDataBuffer *event);
30
31 /// Handle an events lost event.
32 virtual void onEventsLost(Instance *instance,
33 const XrEventDataEventsLost *event);
34 /// Handle an instance loss pending event.
35 virtual void onInstanceLossPending(Instance *instance,
36 const XrEventDataInstanceLossPending *event);
37
38 // Session events
39
40 /// Handle an interaction profile changed event.
41 virtual void onInteractionProfileChanged(Session *session,
42 const XrEventDataInteractionProfileChanged *event);
43 /// Handle a reference space change pending event.
44 virtual void onReferenceSpaceChangePending(Session *session,
45 const XrEventDataReferenceSpaceChangePending *event);
46 /// Handle a visibility mask change event.
47 virtual void onVisibilityMaskChanged(Session *session,
48 const XrEventDataVisibilityMaskChangedKHR *event);
49 /// Handle a session state change event.
50 virtual void onSessionStateChanged(Session *session,
51 const XrEventDataSessionStateChanged *event);
52
53 // Session state events
54
55 /// Transition into initial idle state (idle, after init).
56 virtual void onSessionStateStart(Session *session);
57 /// Transition into ending state (exiting / loss pending, before cleanup).
58 virtual void onSessionStateEnd(Session *session, bool retry);
59
60 /// Transition into a ready state.
61 virtual void onSessionStateReady(Session *session);
62 /// Transition out of running state (stopping, before end).
63 virtual void onSessionStateStopping(Session *session, bool loss);
64
65 /// Transition into focused session state.
66 virtual void onSessionStateFocus(Session *session);
67 /// Transition out of focused session state.
68 virtual void onSessionStateUnfocus(Session *session);
69 };
70
71 } // osgXR::OpenXR
72
73 } // osgXR
74
75 #endif