From 0868c2af69437b5ed25234b77bd4ce0c752e2b87 Mon Sep 17 00:00:00 2001 From: "rahab.mathieu" Date: Thu, 15 Oct 2026 21:35:23 +0200 Subject: [PATCH] fix(player): resolve GL entry points from OpenGL.framework on macOS --- crates/pstr-player/src/gl.rs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/crates/pstr-player/src/gl.rs b/crates/pstr-player/src/gl.rs index 0448b20..0c9bcde 100644 --- a/crates/pstr-player/src/gl.rs +++ b/crates/pstr-player/src/gl.rs @@ -42,7 +42,7 @@ use libloading::Library; /// /// EGL leads on a Wayland session and GLX on an X11 one, matching what glutin /// will have picked — though with `libglvnd` in the way, either order works. -#[cfg(unix)] +#[cfg(all(unix, not(target_os = "macos")))] fn candidates() -> Vec<&'static str> { let wayland = std::env::var_os("WAYLAND_DISPLAY").is_some(); if wayland { @@ -52,6 +52,15 @@ fn candidates() -> Vec<&'static str> { } } +/// eframe's context on macOS is CGL, and the framework exports every GL +/// function it implements as a plain symbol — there is no `GetProcAddress` to +/// go through, so the direct lookup in [`GlLoader::resolve`] answers for all of +/// them. +#[cfg(target_os = "macos")] +fn candidates() -> Vec<&'static str> { + vec!["/System/Library/Frameworks/OpenGL.framework/OpenGL"] +} + #[cfg(windows)] fn candidates() -> Vec<&'static str> { vec!["opengl32.dll"]