From c1a80cc8b33e58e4989f202e69c9035dc6beb28c Mon Sep 17 00:00:00 2001 From: Duy Tran Khanh Date: Sat, 2 Jan 2021 15:59:35 +0700 Subject: [PATCH] Try to draw color after make current --- JavaApp/src/main/java/org/lwjgl/opengl/GL.java | 8 +------- Natives/egl_bridge.c | 2 +- Natives/egl_bridge_ios.m | 4 ++++ 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/JavaApp/src/main/java/org/lwjgl/opengl/GL.java b/JavaApp/src/main/java/org/lwjgl/opengl/GL.java index 3065a00f..041dfa08 100644 --- a/JavaApp/src/main/java/org/lwjgl/opengl/GL.java +++ b/JavaApp/src/main/java/org/lwjgl/opengl/GL.java @@ -346,13 +346,7 @@ public final class GL { if (functionProvider == null) { throw new IllegalStateException("OpenGL library has not been loaded."); } -/* - long GL4ESInit = functionProvider.getFunctionAddress("initialize_gl4es"); - if (GL4ESInit == NULL) { - throw new IllegalStateException("initialize_gl4es() could not be found. Make sure that the OpenGL library is GL4ES."); - } - callV(GL4ESInit); -*/ + GLCapabilities caps = null; try { diff --git a/Natives/egl_bridge.c b/Natives/egl_bridge.c index 2d69d4d8..2b843c08 100644 --- a/Natives/egl_bridge.c +++ b/Natives/egl_bridge.c @@ -71,7 +71,7 @@ JNIEXPORT jboolean JNICALL Java_org_lwjgl_glfw_GLFW_nativeEglMakeCurrent(JNIEnv* gl4esInitialize(); debug("GL4ES init success"); - + return ret; } diff --git a/Natives/egl_bridge_ios.m b/Natives/egl_bridge_ios.m index 0c2ccc32..5b7ad2e7 100644 --- a/Natives/egl_bridge_ios.m +++ b/Natives/egl_bridge_ios.m @@ -53,6 +53,10 @@ void *getCurrentContext() { jboolean makeCurrentContext(void *context) { // fprintf(stderr, "IOSWindowSystemInterface : makeCurrentContext %x\n", context); if ([EAGLContext setCurrentContext:(__bridge EAGLContext *)jlong_to_ptr(context)] == YES) { + glClearColor(0.4f, 0.4f, 0.4f, 1.0f); + glClear(GL_COLOR_BUFFER_BIT); + flushBuffer(); + debug("Drawn frame"); return JNI_TRUE; }