Skip to content

Commit

Permalink
redefine GL_RGB565 to GL_RGBA on macOS (#361)
Browse files Browse the repository at this point in the history
This makes depth based shadows work on macOS once again, as they
did before the redefinition was inadvertently removed in PR #355.

Fixes #360.
  • Loading branch information
dmitshur authored Jul 5, 2021
1 parent dfe0dcb commit be4ef39
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gapi/gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,12 @@
#include <OpenGL/gl3ext.h>
#include <OpenGL/glext.h>

// 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.
Expand Down

0 comments on commit be4ef39

Please sign in to comment.