[Mac] Fixed NRE and initial position on 64bit
authorthefiddler <stapostol@gmail.com>
Mon, 19 May 2014 23:00:54 +0000 (01:00 +0200)
committerthefiddler <stapostol@gmail.com>
Mon, 19 May 2014 23:00:54 +0000 (01:00 +0200)
Source/OpenTK/Platform/MacOS/CocoaNativeWindow.cs

index 358d25a..001634f 100644 (file)
@@ -206,7 +206,6 @@ namespace OpenTK.Platform.MacOS
 
             // Set up behavior
             Cocoa.SendIntPtr(windowPtr, Selector.Get("setDelegate:"), windowPtr); // The window class acts as its own delegate 
-            Cocoa.SendVoid(windowPtr, Selector.Get("cascadeTopLeftFromPoint:"), System.Drawing.PointF.Empty);
             Cocoa.SendVoid(windowPtr, Selector.Get("makeKeyWindow"));
             SetTitle(title, false);
 
@@ -247,7 +246,12 @@ namespace OpenTK.Platform.MacOS
             {
                 ResetTrackingArea();
             }
-            GraphicsContext.CurrentContext.Update(windowInfo);
+
+            var context = GraphicsContext.CurrentContext;
+            if (context != null)
+            {
+                context.Update(windowInfo);
+            }
 
             if (suppressResize == 0)
                 OnResize(EventArgs.Empty);