diff --git a/client/src/main/java/rt4/DisplayMode.java b/client/src/main/java/rt4/DisplayMode.java index 440e79d..3f56f62 100644 --- a/client/src/main/java/rt4/DisplayMode.java +++ b/client/src/main/java/rt4/DisplayMode.java @@ -178,13 +178,28 @@ public final class DisplayMode { } else { SoftwareRaster.frameBuffer = null; } - @Pc(300) PrivilegedRequest local300 = GameShell.signLink.loadGlNatives(client.instance.getClass()); - while (local300.status == 0) { - ThreadUtils.sleep(100L); - } - if (local300.status == 1) { - aBoolean73 = true; - } + + /** + * Code below tries to trigger GLProfile.initSingleton() through a queue in PrivilegedRequest where it waits + * for its turn. This along with the while loop waits to return status code 1 which causes + * lag and delay when switching to HD Mode. + * GLProfile.initSingleton() is automatically run starting with jogl 2.0 and later. So no need to execute it. + * After it returns status code 1, it also sets an important variable aBoolean73 to true + * when the queue executes successfully. + * This triggers the needed GLRenderer.init() function which we can control to be true manually. + **/ + + /** + @Pc(300) PrivilegedRequest local300 = GameShell.signLink.loadGlNatives(client.instance.getClass()); + while (local300.status == 0) { + ThreadUtils.sleep(100L); + } + if (local300.status == 1) { + aBoolean73 = true; + } + */ + + aBoolean73 = true; // Manually set here to allow GLRenderer.init() to execute. } if (aBoolean73) { GlRenderer.init(GameShell.canvas, Preferences.antiAliasingMode * 2); diff --git a/signlink/src/main/java/rt4/SignLink.java b/signlink/src/main/java/rt4/SignLink.java index fe733a0..abc5caf 100644 --- a/signlink/src/main/java/rt4/SignLink.java +++ b/signlink/src/main/java/rt4/SignLink.java @@ -410,7 +410,7 @@ public final class SignLink implements Runnable { } request.result = ((Class) args[0]).getDeclaredField((String) args[1]); } else if (type == 10) { - GLProfile.initSingleton(); + //GLProfile.initSingleton(); //this is no longer necessary with jogl versions 2.0+. } else if (type == 11) { GLProfile.shutdown(); } else if (type == 12) {