Browse Source

Revert "core: workaround window not being rendered till moved on macOS Mojave"

This reverts commit 1fe6d9fc06156257d5210cfa71ecb839fb190722.

Because upstream GLFW now contains a fix.
Ahmad Fatoum 6 years ago
parent
commit
8bc4050377
1 changed files with 1 additions and 17 deletions
  1. 1 17
      src/core.c

+ 1 - 17
src/core.c

@@ -175,11 +175,9 @@
         #include <GLFW/glfw3native.h>   // Required for: glfwGetX11Window()
         #include <GLFW/glfw3native.h>   // Required for: glfwGetX11Window()
     #elif defined(__APPLE__)
     #elif defined(__APPLE__)
         #include <unistd.h>             // Required for: usleep()
         #include <unistd.h>             // Required for: usleep()
-        #include <objc/message.h>       // Required for: objc_msgsend(), sel_registerName()
 
 
         //#define GLFW_EXPOSE_NATIVE_COCOA      // WARNING: Fails due to type redefinition
         //#define GLFW_EXPOSE_NATIVE_COCOA      // WARNING: Fails due to type redefinition
-        #define GLFW_EXPOSE_NATIVE_NSGL
-        #include <GLFW/glfw3native.h>   // Required for: glfwGetCocoaWindow(), glfwGetNSGLContext()
+        #include <GLFW/glfw3native.h>   // Required for: glfwGetCocoaWindow()
 
 
     #endif
     #endif
 #endif
 #endif
@@ -277,10 +275,6 @@ static bool windowReady = false;                // Check if window has been init
 static bool windowMinimized = false;            // Check if window has been minimized
 static bool windowMinimized = false;            // Check if window has been minimized
 static const char *windowTitle = NULL;          // Window text title...
 static const char *windowTitle = NULL;          // Window text title...
 
 
-#if defined(__APPLE__)
-static int windowNeedsUpdating = 2;             // Times the Cocoa window needs to be updated initially
-#endif
-
 static unsigned int displayWidth, displayHeight;// Display width and height (monitor, device-screen, LCD, ...)
 static unsigned int displayWidth, displayHeight;// Display width and height (monitor, device-screen, LCD, ...)
 static int screenWidth, screenHeight;           // Screen width and height (used render area)
 static int screenWidth, screenHeight;           // Screen width and height (used render area)
 static int renderWidth, renderHeight;           // Framebuffer width and height (render area, including black bars if required)
 static int renderWidth, renderHeight;           // Framebuffer width and height (render area, including black bars if required)
@@ -3135,16 +3129,6 @@ static void SwapBuffers(void)
 {
 {
 #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
 #if defined(PLATFORM_DESKTOP) || defined(PLATFORM_WEB)
     glfwSwapBuffers(window);
     glfwSwapBuffers(window);
-#if __APPLE__
-    // Workaround for missing/erroneous initial rendering on macOS
-    if (windowNeedsUpdating)
-    {
-        // Desugared version of Objective C: [glfwGetNSGLContext(window) update]
-        ((id (*)(id, SEL))objc_msgSend)(glfwGetNSGLContext(window), sel_registerName("update"));
-
-        windowNeedsUpdating--;
-    }
-#endif
 #endif
 #endif
 
 
 #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_UWP)
 #if defined(PLATFORM_ANDROID) || defined(PLATFORM_RPI) || defined(PLATFORM_UWP)