attach jni to ui thread, fix bucket bounding box
This commit is contained in:
@@ -62,7 +62,7 @@ EGLContext g_context = EGL_NO_CONTEXT;
|
||||
std::recursive_mutex mutex;
|
||||
int mutex_count = 0;
|
||||
struct engine g_engine;
|
||||
JNIEnv* jni;
|
||||
thread_local JNIEnv* jni;
|
||||
|
||||
jint JNI_OnLoad(JavaVM* vm, void* /*reserved*/)
|
||||
{
|
||||
@@ -118,6 +118,16 @@ int GetUnicodeChar(struct android_app* app, int eventType, int keyCode, int meta
|
||||
return unicodeKey;
|
||||
}
|
||||
|
||||
void android_attach_jni()
|
||||
{
|
||||
g_engine.app->activity->vm->AttachCurrentThread(&jni, nullptr);
|
||||
}
|
||||
|
||||
void android_detach_jni()
|
||||
{
|
||||
g_engine.app->activity->vm->DetachCurrentThread();
|
||||
}
|
||||
|
||||
void android_async_lock(struct engine* engine)
|
||||
{
|
||||
mutex.lock();
|
||||
|
||||
Reference in New Issue
Block a user