From f40d085e3ca4cd8d834f8bc47d9a729ae7d737e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Konstantin=20K=C3=A4fer?= Date: Thu, 6 Apr 2017 16:00:09 +0200 Subject: [PATCH] macOS: Fix EGL support --- include/GLFW/glfw3.h | 52 ++++++++++++++++++++++---------------------- src/cocoa_window.m | 2 ++ 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/include/GLFW/glfw3.h b/include/GLFW/glfw3.h index 5436b9b48..2ec841ea6 100644 --- a/include/GLFW/glfw3.h +++ b/include/GLFW/glfw3.h @@ -139,7 +139,32 @@ extern "C" { /* Include the chosen client API headers. */ -#if defined(__APPLE__) +#if defined(GLFW_INCLUDE_ES1) + #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif +#elif defined(GLFW_INCLUDE_ES2) + #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif +#elif defined(GLFW_INCLUDE_ES3) + #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif +#elif defined(GLFW_INCLUDE_ES31) + #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif +#elif defined(GLFW_INCLUDE_ES32) + #include + #if defined(GLFW_INCLUDE_GLEXT) + #include + #endif +#elif defined(__APPLE__) #if defined(GLFW_INCLUDE_GLCOREARB) #include #if defined(GLFW_INCLUDE_GLEXT) @@ -157,31 +182,6 @@ extern "C" { #else #if defined(GLFW_INCLUDE_GLCOREARB) #include - #elif defined(GLFW_INCLUDE_ES1) - #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif - #elif defined(GLFW_INCLUDE_ES2) - #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif - #elif defined(GLFW_INCLUDE_ES3) - #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif - #elif defined(GLFW_INCLUDE_ES31) - #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif - #elif defined(GLFW_INCLUDE_ES32) - #include - #if defined(GLFW_INCLUDE_GLEXT) - #include - #endif #elif !defined(GLFW_INCLUDE_NONE) #include #if defined(GLFW_INCLUDE_GLEXT) diff --git a/src/cocoa_window.m b/src/cocoa_window.m index d2aab85f9..4bd28e712 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -423,6 +423,8 @@ static const NSRange kEmptyRange = { NSNotFound, 0 }; - (id)makeBackingLayer { + if (!window->ns.layer) + window->ns.layer = [super makeBackingLayer]; return window->ns.layer; }