[Mac] Fixed NRE and initial position on 64bit

This commit is contained in:
thefiddler 2014-05-20 01:00:54 +02:00
parent c65e2a4d9e
commit 5b529647c9

View 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);