Moved window delegate creation to createWindow.

master
Camilla Berglund ago%!(EXTRA string=11 years)
parent b126939b5d
commit 4a8f6ba58c
  1. 16
      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;

Loading…
Cancel
Save