Refactor mapping to the native structs
This commit is contained in:
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
|
||||
Reference in new issue
Block a user