diff --git a/app_pojavlauncher/src/main/assets/components/lwjgl3/lwjgl-glfw-classes.jar b/app_pojavlauncher/src/main/assets/components/lwjgl3/lwjgl-glfw-classes.jar index d58a61139..bb9e8afe2 100644 Binary files a/app_pojavlauncher/src/main/assets/components/lwjgl3/lwjgl-glfw-classes.jar and b/app_pojavlauncher/src/main/assets/components/lwjgl3/lwjgl-glfw-classes.jar differ diff --git a/app_pojavlauncher/src/main/assets/components/lwjgl3/version b/app_pojavlauncher/src/main/assets/components/lwjgl3/version index 6bee63ec8..a1eec672f 100644 --- a/app_pojavlauncher/src/main/assets/components/lwjgl3/version +++ b/app_pojavlauncher/src/main/assets/components/lwjgl3/version @@ -1 +1 @@ -1654610266310 \ No newline at end of file +1663700709650 \ No newline at end of file diff --git a/app_pojavlauncher/src/main/jni/gl_bridge.c b/app_pojavlauncher/src/main/jni/gl_bridge.c index ddf6ec6e4..6eff6ce58 100644 --- a/app_pojavlauncher/src/main/jni/gl_bridge.c +++ b/app_pojavlauncher/src/main/jni/gl_bridge.c @@ -144,23 +144,31 @@ void gl_make_current(render_bundle_t* bundle) { } return; } + bool hasSetMainWindow = false; + if(mainWindowBundle == NULL) { + mainWindowBundle = bundle; + __android_log_print(ANDROID_LOG_INFO, g_LogTag, "Main window bundle is now %p", mainWindowBundle); + mainWindowBundle->newNativeSurface = newWindow; + hasSetMainWindow = true; + } __android_log_print(ANDROID_LOG_INFO, g_LogTag, "Making current, surface=%p, nativeSurface=%p, newNativeSurface=%p", bundle->surface, bundle->nativeSurface, bundle->newNativeSurface); if(bundle->surface == NULL) { //it likely will be on the first run gl_swap_surface(bundle); } if(eglMakeCurrent_p(g_EglDisplay, bundle->surface, bundle->surface, bundle->context)) { currentBundle = bundle; - }else __android_log_print(ANDROID_LOG_ERROR, g_LogTag, "eglMakeCurrent returned with error: %04x", eglGetError_p()); + }else { + if(hasSetMainWindow) { + mainWindowBundle->newNativeSurface = NULL; + gl_swap_surface(mainWindowBundle); + mainWindowBundle = NULL; + } + __android_log_print(ANDROID_LOG_ERROR, g_LogTag, "eglMakeCurrent returned with error: %04x", eglGetError_p()); + } } void gl_swap_buffers() { - if(mainWindowBundle == NULL) { - mainWindowBundle = currentBundle; - __android_log_print(ANDROID_LOG_INFO, g_LogTag, "Main window bundle is now %p", mainWindowBundle); - mainWindowBundle->state = STATE_RENDERER_NEW_WINDOW; - mainWindowBundle->newNativeSurface = newWindow; - } if(currentBundle->state == STATE_RENDERER_NEW_WINDOW) { eglMakeCurrent_p(g_EglDisplay, EGL_NO_SURFACE, EGL_NO_SURFACE, EGL_NO_CONTEXT); //detach everything to destroy the old EGLSurface gl_swap_surface(currentBundle); diff --git a/app_pojavlauncher/src/main/jniLibs/arm64-v8a/liblwjgl.so b/app_pojavlauncher/src/main/jniLibs/arm64-v8a/liblwjgl.so index abe6ab8dc..a84a3231b 100644 Binary files a/app_pojavlauncher/src/main/jniLibs/arm64-v8a/liblwjgl.so and b/app_pojavlauncher/src/main/jniLibs/arm64-v8a/liblwjgl.so differ diff --git a/app_pojavlauncher/src/main/jniLibs/arm64-v8a/liblwjgl_opengl.so b/app_pojavlauncher/src/main/jniLibs/arm64-v8a/liblwjgl_opengl.so index e0f2bffaf..31d18730d 100644 Binary files a/app_pojavlauncher/src/main/jniLibs/arm64-v8a/liblwjgl_opengl.so and b/app_pojavlauncher/src/main/jniLibs/arm64-v8a/liblwjgl_opengl.so differ diff --git a/app_pojavlauncher/src/main/jniLibs/arm64-v8a/liblwjgl_stb.so b/app_pojavlauncher/src/main/jniLibs/arm64-v8a/liblwjgl_stb.so index 27c9f3106..c189d91ce 100644 Binary files a/app_pojavlauncher/src/main/jniLibs/arm64-v8a/liblwjgl_stb.so and b/app_pojavlauncher/src/main/jniLibs/arm64-v8a/liblwjgl_stb.so differ diff --git a/jre_lwjgl3glfw/src/main/java/org/lwjgl/opengl/Display.java b/jre_lwjgl3glfw/src/main/java/org/lwjgl/opengl/Display.java index d1fde8c94..b6feccd3b 100644 --- a/jre_lwjgl3glfw/src/main/java/org/lwjgl/opengl/Display.java +++ b/jre_lwjgl3glfw/src/main/java/org/lwjgl/opengl/Display.java @@ -82,15 +82,6 @@ public class Display { mode = desktopDisplayMode = new DisplayMode(monitorWidth, monitorHeight, monitorBitPerPixel, monitorRefreshRate); LWJGLUtil.log("Initial mode: " + desktopDisplayMode); - if("true".equals(System.getProperty("org.lwjgl.opengl.disableStaticInit"))) { - LWJGLUtil.log("Static Display.create() disabled"); - }else{ - // additional code workaround not called yet! - LWJGLUtil.log("Calling Display.create()"); - try { - create(); - } catch (LWJGLException e) {throw new RuntimeException(e);} - } } public static void setSwapInterval(int value) { @@ -861,7 +852,7 @@ public class Display { public static void setDisplayMode(DisplayMode dm) throws LWJGLException { mode = dm; - GLFW.glfwSetWindowSize(Window.handle, dm.getWidth(), dm.getHeight()); + if(isCreated) GLFW.glfwSetWindowSize(Window.handle, dm.getWidth(), dm.getHeight()); } public static DisplayMode getDisplayMode() {