From 4a8f6ba58c8cdb1a031753709d7c5ac6ae9f8203 Mon Sep 17 00:00:00 2001 From: Camilla Berglund Date: Sun, 6 Apr 2014 13:46:16 +0200 Subject: [PATCH] Moved window delegate creation to createWindow. --- src/cocoa_window.m | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/cocoa_window.m b/src/cocoa_window.m index cbf74ecd..53520b29 100644 --- a/src/cocoa_window.m +++ b/src/cocoa_window.m @@ -918,6 +918,14 @@ static GLboolean initializeAppKit(void) static GLboolean createWindow(_GLFWwindow* window, const _GLFWwndconfig* wndconfig) { + window->ns.delegate = [[GLFWWindowDelegate alloc] initWithGlfwWindow:window]; + if (window->ns.delegate == nil) + { + _glfwInputError(GLFW_PLATFORM_ERROR, + "Cocoa: Failed to create window delegate"); + return GL_FALSE; + } + unsigned int styleMask = 0; if (wndconfig->monitor || !wndconfig->decorated) @@ -999,14 +1007,6 @@ int _glfwPlatformCreateWindow(_GLFWwindow* window, [NSApp setDelegate:_glfw.ns.delegate]; } - window->ns.delegate = [[GLFWWindowDelegate alloc] initWithGlfwWindow:window]; - if (window->ns.delegate == nil) - { - _glfwInputError(GLFW_PLATFORM_ERROR, - "Cocoa: Failed to create window delegate"); - return GL_FALSE; - } - if (!createWindow(window, wndconfig)) return GL_FALSE;