| 1 |
|
| 2 |
|
| 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 |
|
| 19 |
class EventHandler : public osg::Referenced |
| 20 |
{ |
| 21 |
public: |
| 22 |
|
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
void onEvent(Instance *instance, const XrEventDataBuffer *event); |
| 27 |
|
| 28 |
virtual void onUnhandledEvent(Instance *instance, |
| 29 |
const XrEventDataBuffer *event); |
| 30 |
|
| 31 |
|
| 32 |
virtual void onEventsLost(Instance *instance, |
| 33 |
const XrEventDataEventsLost *event); |
| 34 |
|
| 35 |
virtual void onInstanceLossPending(Instance *instance, |
| 36 |
const XrEventDataInstanceLossPending *event); |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
virtual void onInteractionProfileChanged(Session *session, |
| 42 |
const XrEventDataInteractionProfileChanged *event); |
| 43 |
|
| 44 |
virtual void onReferenceSpaceChangePending(Session *session, |
| 45 |
const XrEventDataReferenceSpaceChangePending *event); |
| 46 |
|
| 47 |
virtual void onVisibilityMaskChanged(Session *session, |
| 48 |
const XrEventDataVisibilityMaskChangedKHR *event); |
| 49 |
|
| 50 |
virtual void onSessionStateChanged(Session *session, |
| 51 |
const XrEventDataSessionStateChanged *event); |
| 52 |
|
| 53 |
|
| 54 |
|
| 55 |
|
| 56 |
virtual void onSessionStateStart(Session *session); |
| 57 |
|
| 58 |
virtual void onSessionStateEnd(Session *session, bool retry); |
| 59 |
|
| 60 |
|
| 61 |
virtual void onSessionStateReady(Session *session); |
| 62 |
|
| 63 |
virtual void onSessionStateStopping(Session *session, bool loss); |
| 64 |
|
| 65 |
|
| 66 |
virtual void onSessionStateFocus(Session *session); |
| 67 |
|
| 68 |
virtual void onSessionStateUnfocus(Session *session); |
| 69 |
}; |
| 70 |
|
| 71 |
} |
| 72 |
|
| 73 |
} |
| 74 |
|
| 75 |
#endif |