Commit graph

7 commits

Author SHA1 Message Date
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
woahscam
3e45689d6e GL renaming, Rendering renaming 2023-06-29 16:37:38 -04:00
Pazaz
2bc60f339b Consolidated some more static classes, identified some util functions 2022-06-28 01:29:29 -04:00
Pazaz
249781ed8b Consolidated Flames methods/fields 2022-06-27 21:13:43 -04:00
Pazaz
a3b7beeed7 Autoformat using tab characters 2022-06-27 20:30:17 -04:00
Pazaz
c5ef44dfcb More accurate Buffer naming, renamed allocation arrays 2022-06-15 13:20:22 -04:00
Pazaz
153d8569b5 Moved source to rt4 package so external code can depend on it 2022-04-25 05:31:58 -04:00
Renamed from client/src/main/java/Shadow.java (Browse further)