Merge pull request #2 from mathieu-rahab/fix/macos-embedded-video

fix(player): resolve GL entry points from OpenGL.framework on macOS
This commit is contained in:
nvrl authored and GitHub committed 2026-10-16 02:12:46 +02:00
commit 2871a13ba6
1 file changed
+10 -1
+10 -1
View File
@@ -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"]