summaryrefslogtreecommitdiffstats
path: root/modules/openxr/openxr_interface.cpp
diff options
context:
space:
mode:
authorBastiaan Olij <mux213@gmail.com>2024-04-08 11:41:38 +1000
committerBastiaan Olij <mux213@gmail.com>2024-04-08 12:36:17 +1000
commit148ff6a47fc47628d5c924a8b605130749b966e3 (patch)
tree43003dc045b20294823d4530d33f69a0221a669b /modules/openxr/openxr_interface.cpp
parente5b4ef8e9522e950033cbece39a31a4a76da19c1 (diff)
downloadredot-engine-148ff6a47fc47628d5c924a8b605130749b966e3.tar.gz
OpenXR: Add refresh rate signal support
Diffstat (limited to 'modules/openxr/openxr_interface.cpp')
-rw-r--r--modules/openxr/openxr_interface.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/modules/openxr/openxr_interface.cpp b/modules/openxr/openxr_interface.cpp
index 956e5ed3f3..7eb9a6ebe1 100644
--- a/modules/openxr/openxr_interface.cpp
+++ b/modules/openxr/openxr_interface.cpp
@@ -43,6 +43,7 @@ void OpenXRInterface::_bind_methods() {
ADD_SIGNAL(MethodInfo("session_focussed"));
ADD_SIGNAL(MethodInfo("session_visible"));
ADD_SIGNAL(MethodInfo("pose_recentered"));
+ ADD_SIGNAL(MethodInfo("refresh_rate_changed", PropertyInfo(Variant::FLOAT, "refresh_rate")));
// Display refresh rate
ClassDB::bind_method(D_METHOD("get_display_refresh_rate"), &OpenXRInterface::get_display_refresh_rate);
@@ -1258,6 +1259,10 @@ void OpenXRInterface::on_pose_recentered() {
emit_signal(SNAME("pose_recentered"));
}
+void OpenXRInterface::on_refresh_rate_changes(float p_new_rate) {
+ emit_signal(SNAME("refresh_rate_changed"), p_new_rate);
+}
+
/** Hand tracking. */
void OpenXRInterface::set_motion_range(const Hand p_hand, const HandMotionRange p_motion_range) {
ERR_FAIL_INDEX(p_hand, HAND_MAX);