Skip to content

Commit

Permalink
uidriver/glfw: Bug fix: OpenGL was adopted unexpectedly on macOS Big Sur
Browse files Browse the repository at this point in the history
  • Loading branch information
hajimehoshi committed Dec 9, 2020
1 parent 68a5bcd commit 1be8c3f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion internal/uidriver/glfw/graphics_darwin.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ package glfw
//
// #import <Foundation/Foundation.h>
//
// static int getMacOSMajorVersion() {
// NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
// return (int)version.majorVersion;
// }
//
// static int getMacOSMinorVersion() {
// NSOperatingSystemVersion version = [[NSProcessInfo processInfo] operatingSystemVersion];
// return (int)version.minorVersion;
Expand All @@ -42,9 +47,10 @@ func supportsMetal() bool {
if _, err := mtl.CreateSystemDefaultDevice(); err != nil {
return false
}

// On macOS 10.11 El Capitan, there is a rendering issue on Metal (#781).
// Use the OpenGL in macOS 10.11 or older.
if C.getMacOSMinorVersion() <= 11 {
if C.getMacOSMajorVersion() <= 10 && C.getMacOSMinorVersion() <= 11 {
return false
}
return true
Expand Down

0 comments on commit 1be8c3f

Please sign in to comment.