diff --git a/src/xrt/state_trackers/oxr/oxr_event.c b/src/xrt/state_trackers/oxr/oxr_event.c index 93cd14e64..6caec0007 100644 --- a/src/xrt/state_trackers/oxr/oxr_event.c +++ b/src/xrt/state_trackers/oxr/oxr_event.c @@ -134,6 +134,7 @@ is_session_link_to_event(struct oxr_event *event, XrSession session) } } + /* * * 'Exported' functions. @@ -166,7 +167,6 @@ oxr_event_push_XrEventDataSessionStateChanged(struct oxr_logger *log, return XR_SUCCESS; } - XrResult oxr_event_push_XrEventDataInteractionProfileChanged(struct oxr_logger *log, struct oxr_session *sess) { @@ -186,6 +186,30 @@ oxr_event_push_XrEventDataInteractionProfileChanged(struct oxr_logger *log, stru return XR_SUCCESS; } +#ifdef OXR_HAVE_FB_display_refresh_rate +XrResult +oxr_event_push_XrEventDataDisplayRefreshRateChangedFB(struct oxr_logger *log, + struct oxr_session *sess, + float fromDisplayRefreshRate, + float toDisplayRefreshRate) +{ + struct oxr_instance *inst = sess->sys->inst; + XrEventDataDisplayRefreshRateChangedFB *changed; + struct oxr_event *event = NULL; + + ALLOC(log, inst, &event, &changed); + changed->type = XR_TYPE_EVENT_DATA_DISPLAY_REFRESH_RATE_CHANGED_FB; + changed->fromDisplayRefreshRate = fromDisplayRefreshRate; + changed->toDisplayRefreshRate = toDisplayRefreshRate; + event->result = XR_SUCCESS; + lock(inst); + push(inst, event); + unlock(inst); + + return XR_SUCCESS; +} +#endif // OXR_HAVE_FB_display_refresh_rate + XrResult oxr_event_push_XrEventDataMainSessionVisibilityChangedEXTX(struct oxr_logger *log, struct oxr_session *sess, @@ -268,27 +292,3 @@ oxr_poll_event(struct oxr_logger *log, struct oxr_instance *inst, XrEventDataBuf return ret; } - -#ifdef OXR_HAVE_FB_display_refresh_rate -XrResult -oxr_event_push_XrEventDataDisplayRefreshRateChangedFB(struct oxr_logger *log, - struct oxr_session *sess, - float fromDisplayRefreshRate, - float toDisplayRefreshRate) -{ - struct oxr_instance *inst = sess->sys->inst; - XrEventDataDisplayRefreshRateChangedFB *changed; - struct oxr_event *event = NULL; - - ALLOC(log, inst, &event, &changed); - changed->type = XR_TYPE_EVENT_DATA_DISPLAY_REFRESH_RATE_CHANGED_FB; - changed->fromDisplayRefreshRate = fromDisplayRefreshRate; - changed->toDisplayRefreshRate = toDisplayRefreshRate; - event->result = XR_SUCCESS; - lock(inst); - push(inst, event); - unlock(inst); - - return XR_SUCCESS; -} -#endif // OXR_HAVE_FB_display_refresh_rate diff --git a/src/xrt/state_trackers/oxr/oxr_objects.h b/src/xrt/state_trackers/oxr/oxr_objects.h index 9923cc096..5f1b91e8b 100644 --- a/src/xrt/state_trackers/oxr/oxr_objects.h +++ b/src/xrt/state_trackers/oxr/oxr_objects.h @@ -928,26 +928,19 @@ oxr_system_get_eye_gaze_support(struct oxr_logger *log, struct oxr_instance *ins bool oxr_system_get_force_feedback_support(struct oxr_logger *log, struct oxr_instance *inst); + /* * * oxr_event.cpp * */ -XrResult -oxr_poll_event(struct oxr_logger *log, struct oxr_instance *inst, XrEventDataBuffer *eventData); - XrResult oxr_event_push_XrEventDataSessionStateChanged(struct oxr_logger *log, struct oxr_session *sess, XrSessionState state, XrTime time); -XrResult -oxr_event_push_XrEventDataMainSessionVisibilityChangedEXTX(struct oxr_logger *log, - struct oxr_session *sess, - bool visible); - XrResult oxr_event_push_XrEventDataInteractionProfileChanged(struct oxr_logger *log, struct oxr_session *sess); @@ -959,12 +952,23 @@ oxr_event_push_XrEventDataDisplayRefreshRateChangedFB(struct oxr_logger *log, float toDisplayRefreshRate); #endif // OXR_HAVE_FB_display_refresh_rate +XrResult +oxr_event_push_XrEventDataMainSessionVisibilityChangedEXTX(struct oxr_logger *log, + struct oxr_session *sess, + bool visible); + /*! * This clears all pending events refers to the given session. */ XrResult oxr_event_remove_session_events(struct oxr_logger *log, struct oxr_session *sess); +/*! + * Will return one event if available, also drain the sessions event queues. + */ +XrResult +oxr_poll_event(struct oxr_logger *log, struct oxr_instance *inst, XrEventDataBuffer *eventData); + /* *