No description
Find a file
bjschnell a5f1dfeb20 Replace JOGL with LWJGL 3 + forked rlawt; HD mode now works on macOS
HD rendering previously required JOGL, whose macOS support was broken two
ways: the bundled natives are x86_64-only (UnsatisfiedLinkError on Apple
Silicon), and its AWT/CALayer presentation path never composites the GL
output (black window), on top of requesting a GL3bc profile macOS does not
offer. This replaces the whole windowing/GL layer:

* rlawt (RuneLite's AWT-GL bridge, BSD-2) vendored under rlawt/ with two
  macOS patches: request the Legacy (2.1 compatibility) profile instead of
  GL4 core, since this renderer is fixed-function + ARB assembly programs,
  and attach a GL_DEPTH_COMPONENT24 renderbuffer to the IOSurface-backed
  framebuffers (RuneLite renders depth-free; this client needs a Z-buffer).
  Universal arm64+x86_64 dylib built by rlawt/build-macos.sh; Windows/Linux
  ship unmodified upstream rlawt natives, whose contexts are already
  compatibility-profile.

* New rt4.GL2 shim exposes JOGL's GL2 instance API over LWJGL 3 statics, so
  the ~950 existing gl.glXxx call sites across 26 renderer files stay
  untouched (they only lose their com.jogamp import). The shim bridges the
  API differences: array+offset overloads, heap-buffer uploads copied to a
  scratch direct buffer, glTexStorage2D emulation on pre-4.2 contexts,
  glGenerateMipmap EXT fallback, extension queries, and vsync control.

* GlRenderer context lifecycle rewritten on AWTContext: synchronous init,
  and the rotated IOSurface back-FBO is re-bound after every swap on macOS.
  The old createAndDestroyContext JOGL surface-reset hack is now a no-op.

* The CS2 detail-mode auto-revert ("The change of detail mode has been
  cancelled") no longer triggers: it raced JOGL's slow retry-looped init,
  and rlawt's init completes synchronously before the script's readback.

Verified in-game on Apple Silicon with a native arm64 JVM (no Rosetta):
SD unchanged, HD switches and renders with no black screen and no revert.
Windows/Linux are compile-checked; runtime behavior should match JOGL's
(same GL calls on a compatibility context) but has not been re-tested.
Also lifts the old "Java 15 or lower" JOGL/WGL restriction on Windows.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01PDSjdSB4Hwa53cmLg47pq3
2026-07-02 16:32:54 -07:00
.github/workflows Typo in artifact command 2022-06-20 13:20:26 -04:00
client Replace JOGL with LWJGL 3 + forked rlawt; HD mode now works on macOS 2026-07-02 16:32:54 -07:00
deob-annotations Autoformat using tab characters 2022-06-27 20:30:17 -04:00
gradle/wrapper Switched build system to gradle 2022-04-20 19:26:30 -04:00
lib Replace JOGL with LWJGL 3 + forked rlawt; HD mode now works on macOS 2026-07-02 16:32:54 -07:00
playground Replace JOGL with LWJGL 3 + forked rlawt; HD mode now works on macOS 2026-07-02 16:32:54 -07:00
plugin-playground * Added the option to toggle displaying HA prices and GE prices under the existing DisplayPrices function. Both by checkboxes in the UI and by commands ::displayha and ::displayge. 2026-06-03 21:05:56 +10:00
ref Added more CS2 opcodes, need to adopt NXT naming next 2022-05-15 23:47:55 -04:00
rlawt Replace JOGL with LWJGL 3 + forked rlawt; HD mode now works on macOS 2026-07-02 16:32:54 -07:00
signlink Replace JOGL with LWJGL 3 + forked rlawt; HD mode now works on macOS 2026-07-02 16:32:54 -07:00
.gitignore Export frame buffer to PNG, allow transparency 2022-04-25 18:42:32 -04:00
.gitlab-ci.yml Update .gitlab-ci.yml file 2024-06-11 20:21:09 +00:00
build.gradle New gradle scripts to modularize the build process 2022-04-20 21:50:21 -04:00
gradlew Added more CS2 opcodes, need to adopt NXT naming next 2022-05-15 23:47:55 -04:00
gradlew.bat Switched build system to gradle 2022-04-20 19:26:30 -04:00
LICENSE Clarify license for Gitlab for Open Source 2025-05-21 11:22:57 +00:00
README.md Replace JOGL with LWJGL 3 + forked rlawt; HD mode now works on macOS 2026-07-02 16:32:54 -07:00
settings.gradle Commit start of plugin work 2022-09-25 09:40:13 -05:00

Fork of Pazaz/RT4-Client

Goals

  • Identify all classes
    • Create new static classes by grouping related members
  • Identify all methods
  • Identify all fields
  • Identify all local variables
  • Remove any remaining obfuscation (possibly none left)
  • Fix poor decompiler behavior (fernflower)
  • Replace magic numbers and bitmasks with named final fields
  • Refactor code to improve behavior/readability
  • Modernize code/libraries (High DPI support, modern refresh rates, ...)
  • Support existing servers via global config flags that adjust packet behaviors
  • Organize classes into packages

OpenRS2 annotations are left in the source to build a deob map from, in case some of my changes aren't desirable.
That mapping can be used to generate a new deob with everything renamed for you.

Instructions

Build requirements:

  • Java 8+

Runtime requirements:

  • SD: Java 8+
  • HD on Windows: Java 8+
  • HD on Linux: Java 8+
  • HD on macOS: Java 8+, works natively on both Apple Silicon (arm64) and Intel.

HD rendering uses LWJGL 3 with a forked rlawt (RuneLite's AWT-GL bridge) for windowing — see rlawt/ for the fork and its build script. The JOGL-era caveats (no macOS support, Java 15 ceiling on Windows) no longer apply. Verified on macOS/Apple Silicon; the Windows/Linux paths use the same port with upstream rlawt natives but have not been runtime-tested since the switch from JOGL.

git clone https://github.com/Pazaz/RT4-Client.git
cd RT4-Client
./gradlew run

You will be connected to a test server automatically.
This server is provided by 2009scape for their own internal developments.

Deviations

Configurable:

  • Packet behaviors to make it compatible with existing servers
  • View distance in HD
  • Bilinear map filtering in HD/SD
  • Tweening enabled by default (existed in client)
  • Shift-click behavior on inventory items enabled by default (existed in client)

Unconfigurable:

  • JOGL was updated to 2.4.0
  • Update/render loop was decoupled to tick indepedently from each other
  • Camera panning input rewritten to use render loop timing
  • Varp array size was extended to 3500 instead of 2500
  • Mouse wheel camera movement (click middle button and move mouse)
  • Render FPS is set to your monitor's refresh rate

Libraries Used

  • JOGL/Gluegen 2.4.0rc
  • Google Gson 2.9.0