diff --git a/modules/lwjgl/opengl/src/main/java/org/lwjgl/opengl/GL.java b/modules/lwjgl/opengl/src/main/java/org/lwjgl/opengl/GL.java index d1db96e880..1de7444295 100644 --- a/modules/lwjgl/opengl/src/main/java/org/lwjgl/opengl/GL.java +++ b/modules/lwjgl/opengl/src/main/java/org/lwjgl/opengl/GL.java @@ -93,9 +93,6 @@ static void initialize() { // intentionally empty to trigger static initializer } - private static native long getGraphicsBufferAddr(); - private static native int[] getNativeWidthHeight(); - /** Loads the OpenGL native library, using the default library name. */ public static void create() { SharedLibrary GL; @@ -293,17 +290,10 @@ private static GLXCapabilities initCapabilitiesGLX(boolean client) { /** PojavLauncher(Android): sets the OpenGL context again to workaround framebuffer issue */ private static void fixPojavGLContext() throws Exception { long currentContext; - String renderer = System.getProperty("org.lwjgl.opengl.libname"); - if (renderer.startsWith("libOSMesa")) { - int[] dims = getNativeWidthHeight(); - currentContext = callJ(functionProvider.getFunctionAddress("OSMesaGetCurrentContext")); - callJPI(currentContext,getGraphicsBufferAddr(),GL_UNSIGNED_BYTE,dims[0],dims[1],functionProvider.getFunctionAddress("OSMesaMakeCurrent")); - } else if (renderer.matches("lib(gl4es|tinywrapper).*")) { - // Workaround glCheckFramebufferStatus issue on 1.13+ 64-bit - Class glfwClass = Class.forName("org.lwjgl.glfw.GLFW"); - currentContext = (long)glfwClass.getDeclaredField("mainContext").get(null); - glfwClass.getDeclaredMethod("glfwMakeContextCurrent", long.class).invoke(null, new Object[]{currentContext}); - } else throw new RuntimeException("Unknown renderer: " + renderer); + // Workaround glCheckFramebufferStatus issue on 1.13+ 64-bit + Class glfwClass = Class.forName("org.lwjgl.glfw.GLFW"); + currentContext = (long)glfwClass.getDeclaredField("mainContext").get(null); + glfwClass.getDeclaredMethod("glfwMakeContextCurrent", long.class).invoke(null, new Object[]{currentContext}); } /**