summaryrefslogtreecommitdiffstats
path: root/modules/openxr/openxr_interface.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-04-11 19:40:02 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-04-11 19:40:02 +0200
commit1eec25acf3f09d447fa9b97d1d61988322c58e9d (patch)
treebbfdfb5de313a20cb827bc3dc325d5d2172afe24 /modules/openxr/openxr_interface.cpp
parent347a8e20ae292455bccd64aae6f9c2f2bfe6dcff (diff)
parentd91e75b6f77d61967a3a9e13406b2f0e35eb60c1 (diff)
downloadredot-engine-1eec25acf3f09d447fa9b97d1d61988322c58e9d.tar.gz
Merge pull request #73558 from Malcolmnixon/render-target-size-multiplier
Added render target size multiplier option
Diffstat (limited to 'modules/openxr/openxr_interface.cpp')
-rw-r--r--modules/openxr/openxr_interface.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/modules/openxr/openxr_interface.cpp b/modules/openxr/openxr_interface.cpp
index 27344c9da7..933148da87 100644
--- a/modules/openxr/openxr_interface.cpp
+++ b/modules/openxr/openxr_interface.cpp
@@ -47,6 +47,11 @@ void OpenXRInterface::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_display_refresh_rate", "refresh_rate"), &OpenXRInterface::set_display_refresh_rate);
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "display_refresh_rate"), "set_display_refresh_rate", "get_display_refresh_rate");
+ // Render Target size multiplier
+ ClassDB::bind_method(D_METHOD("get_render_target_size_multiplier"), &OpenXRInterface::get_render_target_size_multiplier);
+ ClassDB::bind_method(D_METHOD("set_render_target_size_multiplier", "multiplier"), &OpenXRInterface::set_render_target_size_multiplier);
+ ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "render_target_size_multiplier"), "set_render_target_size_multiplier", "get_render_target_size_multiplier");
+
ClassDB::bind_method(D_METHOD("is_action_set_active", "name"), &OpenXRInterface::is_action_set_active);
ClassDB::bind_method(D_METHOD("set_action_set_active", "name", "active"), &OpenXRInterface::set_action_set_active);
ClassDB::bind_method(D_METHOD("get_action_sets"), &OpenXRInterface::get_action_sets);
@@ -668,6 +673,22 @@ Array OpenXRInterface::get_action_sets() const {
return arr;
}
+double OpenXRInterface::get_render_target_size_multiplier() const {
+ if (openxr_api == nullptr) {
+ return 1.0;
+ } else {
+ return openxr_api->get_render_target_size_multiplier();
+ }
+}
+
+void OpenXRInterface::set_render_target_size_multiplier(double multiplier) {
+ if (openxr_api == nullptr) {
+ return;
+ } else {
+ openxr_api->set_render_target_size_multiplier(multiplier);
+ }
+}
+
Size2 OpenXRInterface::get_render_target_size() {
if (openxr_api == nullptr) {
return Size2();