mirror of
https://github.com/AngelAuraMC/Amethyst-Android.git
synced 2025-09-16 16:16:04 -04:00
Merge remote-tracking branch 'origin/v3_openjdk' into v3_openjdk
This commit is contained in:
commit
c5b920d1f2
@ -190,8 +190,20 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GL_nativeRegalMakeCurrent(JNIEnv *e
|
||||
RegalMakeCurrent(potatoBridge.eglContext);
|
||||
}
|
||||
|
||||
bool stopMakeCurrent;
|
||||
JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglSwapBuffers(JNIEnv *env, jclass clazz) {
|
||||
return eglSwapBuffers(potatoBridge.eglDisplay, potatoBridge.eglSurface);
|
||||
if (stopMakeCurrent) {
|
||||
return JNI_FALSE;
|
||||
}
|
||||
|
||||
jboolean result = (jboolean) eglSwapBuffers(potatoBridge.eglDisplay, potatoBridge.eglSurface);
|
||||
if (!result) {
|
||||
if (eglGetError() == EGL_BAD_SURFACE) {
|
||||
stopMakeCurrent = true;
|
||||
closeGLFWWindow();
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglSwapInterval(JNIEnv *env, jclass clazz, jint interval) {
|
||||
|
@ -138,6 +138,19 @@ void sendData(int type, int i1, int i2, int i3, int i4) {
|
||||
);
|
||||
}
|
||||
|
||||
void closeGLFWWindow() {
|
||||
jclass glfwClazz = (*runtimeJNIEnvPtr_JRE)->FindClass(runtimeJNIEnvPtr_JRE, "org/lwjgl/glfw/GLFW");
|
||||
assert(glfwClazz != NULL);
|
||||
jmethodID glfwMethod = (*runtimeJNIEnvPtr_JRE)->GetStaticMethodID(runtimeJNIEnvPtr_JRE, glfwMethod, "glfwSetWindowShouldClose", "(JZ)V");
|
||||
assert(glfwMethod != NULL);
|
||||
|
||||
(*runtimeJNIEnvPtr_JRE)->CallStaticVoidMethod(
|
||||
runtimeJNIEnvPtr_JRE,
|
||||
glfwClazz, glfwMethod,
|
||||
(jlong) showingWindow, JNI_TRUE
|
||||
);
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_CallbackBridge_nativeAttachThreadToOther(JNIEnv* env, jclass clazz, jboolean isAndroid, jboolean isUseStackQueueBool) {
|
||||
#ifdef DEBUG
|
||||
LOGD("Debug: JNI attaching thread, isUseStackQueue=%d\n", isUseStackQueue);
|
||||
|
@ -22,5 +22,7 @@ char** convert_to_char_array(JNIEnv *env, jobjectArray jstringArray);
|
||||
jobjectArray convert_from_char_array(JNIEnv *env, char **charArray, int num_rows);
|
||||
void free_char_array(JNIEnv *env, jobjectArray jstringArray, const char **charArray);
|
||||
|
||||
void closeGLFWWindow();
|
||||
|
||||
#endif // _BINARY_UTILS_H_
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user