From be4ef39281cf3257185c7237e57d1c195dd4e607 Mon Sep 17 00:00:00 2001 From: Dmitri Shuralyov Date: Sun, 4 Jul 2021 20:42:40 -0400 Subject: [PATCH] redefine GL_RGB565 to GL_RGBA on macOS (#361) This makes depth based shadows work on macOS once again, as they did before the redefinition was inadvertently removed in PR #355. Fixes #360. --- src/gapi/gl.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gapi/gl.h b/src/gapi/gl.h index d73f76c..a3e5e9c 100644 --- a/src/gapi/gl.h +++ b/src/gapi/gl.h @@ -276,6 +276,12 @@ #include #include + // In OpenGL 2.1, the 16-bit RGB565 sized internal format is unavailable + // (because macOS doesn't provide the GL_ARB_ES2_compatibility extension), + // so use a 32-bit format for renderbuffer storage on macOS. See issue 360. + #undef GL_RGB565 + #define GL_RGB565 GL_RGBA + // In compatibility mode, macOS only provides OpenGL 2.1 (no VAO), but it does // support the Apple-specific VAO extension which is older and in all relevant // parts 100% compatible. So use those functions instead.