summaryrefslogtreecommitdiff
path: root/plugins/hello_gdextension/src/main/cpp/jni/plugin_jni.cpp
blob: 36aa6588eda0742473d297312e1296c864b2cc54 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#include <jni.h>

#include "plugin_manager.h"
#include "utils.h"

#undef JNI_PACKAGE_NAME
#define JNI_PACKAGE_NAME fhuyakou_godot_plugin_android_hellogdextension

#undef JNI_CLASS_NAME
#define JNI_CLASS_NAME HelloGDExtensionPlugin

extern "C" {
    JNIEXPORT void JNICALL JNI_METHOD(nativeAddGDExampleNode)(JNIEnv *env, jobject, jstring p_parent_node_path) {
        godot::PluginManager::get_singleton()->add_gdexample_node(jstring_to_string(env, p_parent_node_path));
    }

    JNIEXPORT void JNICALL JNI_METHOD(nativeToggleVisibility)(JNIEnv *env, jobject, jboolean p_visible) {
        godot::PluginManager::get_singleton()->toggle_visibility(p_visible);
    }
};