summaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorFabio Alessandrelli <fabio.alessandrelli@gmail.com>2018-08-12 16:31:44 +0200
committerFabio Alessandrelli <fabio.alessandrelli@gmail.com>2018-08-12 16:59:59 +0200
commit662ceddd518faab8137d922e29030dc3fa1e34e2 (patch)
treea9c7a17b4a14f83f67bb02a82237558633ce7c77 /src/init.cpp
parent1885036052b24cbe804bb829a32ba2617eac3fe4 (diff)
downloadfork-godot-webrtc-native-662ceddd518faab8137d922e29030dc3fa1e34e2.tar.gz
fork-godot-webrtc-native-662ceddd518faab8137d922e29030dc3fa1e34e2.tar.bz2
fork-godot-webrtc-native-662ceddd518faab8137d922e29030dc3fa1e34e2.zip
Fix interface binding
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 601ac2a..544bfa2 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1,7 +1,16 @@
+#include <gdnative_api_struct.gen.h>
+#include "net/WebRTCPeerNative.hpp"
#include "WebRTCPeer.hpp"
/* Godot export stuff */
extern "C" void GDN_EXPORT godot_gdnative_init(godot_gdnative_init_options *o) {
+ const godot_gdnative_core_api_struct *api = o->api_struct;
+ for (int i = 0; i < api->num_extensions; i++) {
+ if (api->extensions[i]->type == GDNATIVE_EXT_NET) {
+ WebRTCPeerNative::_net_api = (godot_gdnative_ext_net_api_struct *)api->extensions[i];
+ }
+ }
+
godot::Godot::gdnative_init(o);
}