Refactor mapping to the native structs

This commit is contained in:
SpaiR committed 2020-08-23 16:49:16 +03:00
1 parent 1209caa518
commit 1dcf2328a4
17 files changed
+194 -251

No files matched your search

@@ -0,0 +1,17 @@
#include "jni_binding_struct.h"
jfieldID imGuiStructPtrID;
namespace Jni
{
void InitBindingStruct(JNIEnv* env)
{
jclass jImGuiStructClass = env->FindClass("imgui/binding/ImGuiStruct");
imGuiStructPtrID = env->GetFieldID(jImGuiStructClass, "ptr", "J");
}
jfieldID GetBindingStructPtrID()
{
return imGuiStructPtrID;
}
}
@@ -0,0 +1,17 @@
#include <jni.h>
#ifndef JNI_BINDING_STRUCT_H
#define JNI_BINDING_STRUCT_H
#ifndef STRUCT_PTR
#define STRUCT_PTR env->GetLongField(object, Jni::GetBindingStructPtrID())
#endif
namespace Jni
{
void InitBindingStruct(JNIEnv* env);
jfieldID GetBindingStructPtrID();
}
#endif