summaryrefslogtreecommitdiff
path: root/modules/gdnative
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <rverschelde@gmail.com>2019-04-30 12:05:46 +0200
committerGitHub <noreply@github.com>2019-04-30 12:05:46 +0200
commit0327d57cfd64b40878a79e5b83f4848001fecb4a (patch)
tree5add258b16b3fc00a3b060a1d12db57edda9442f /modules/gdnative
parent4e230d713487ea540ca534b11d0bdf225617a676 (diff)
parent1a1b35721a89e2b27d2b18b8b746c37fd56734aa (diff)
Merge pull request #27007 from BastiaanOlij/arvr_notifications
Send notifications to ARVRInterfaces
Diffstat (limited to 'modules/gdnative')
-rw-r--r--modules/gdnative/arvr/arvr_interface_gdnative.cpp9
-rw-r--r--modules/gdnative/arvr/arvr_interface_gdnative.h1
-rw-r--r--modules/gdnative/include/arvr/godot_arvr.h1
3 files changed, 11 insertions, 0 deletions
diff --git a/modules/gdnative/arvr/arvr_interface_gdnative.cpp b/modules/gdnative/arvr/arvr_interface_gdnative.cpp
index 8c602e0cba..eac8e26160 100644
--- a/modules/gdnative/arvr/arvr_interface_gdnative.cpp
+++ b/modules/gdnative/arvr/arvr_interface_gdnative.cpp
@@ -222,6 +222,15 @@ void ARVRInterfaceGDNative::process() {
interface->process(data);
}
+void ARVRInterfaceGDNative::notification(int p_what) {
+ ERR_FAIL_COND(interface == NULL);
+
+ // this is only available in interfaces that implement 1.1 or later
+ if ((interface->version.major > 1) || ((interface->version.major == 1) && (interface->version.minor > 0))) {
+ interface->notification(p_what);
+ }
+}
+
/////////////////////////////////////////////////////////////////////////////////////
// some helper callbacks
diff --git a/modules/gdnative/arvr/arvr_interface_gdnative.h b/modules/gdnative/arvr/arvr_interface_gdnative.h
index 3f966ece51..86396b067a 100644
--- a/modules/gdnative/arvr/arvr_interface_gdnative.h
+++ b/modules/gdnative/arvr/arvr_interface_gdnative.h
@@ -82,6 +82,7 @@ public:
virtual void commit_for_eye(ARVRInterface::Eyes p_eye, RID p_render_target, const Rect2 &p_screen_rect);
virtual void process();
+ virtual void notification(int p_what);
};
#endif // ARVR_INTERFACE_GDNATIVE_H
diff --git a/modules/gdnative/include/arvr/godot_arvr.h b/modules/gdnative/include/arvr/godot_arvr.h
index 321b471d0e..60bad27618 100644
--- a/modules/gdnative/include/arvr/godot_arvr.h
+++ b/modules/gdnative/include/arvr/godot_arvr.h
@@ -63,6 +63,7 @@ typedef struct {
void (*process)(void *);
// only in 1.1 onwards
godot_int (*get_external_texture_for_eye)(void *, godot_int);
+ void (*notification)(godot_int);
} godot_arvr_interface_gdnative;
void GDAPI godot_arvr_register_interface(const godot_arvr_interface_gdnative *p_interface);