Add requsted changes

This commit is contained in:
VPeruS 2017-06-14 00:56:42 +03:00
parent a68581118e
commit 52206ec13b
3 changed files with 16 additions and 12 deletions

View file

@ -173,14 +173,14 @@ namespace OpenTK.Platform.MacOS
if (IntPtr.Size == 4) if (IntPtr.Size == 4)
{ {
NSPointF pf = SendPointF(receiver, selector); NSPointF pf = SendPointF(receiver, selector);
r.X.Value = *(IntPtr *)&pf.x; r.X.Value = *(IntPtr *)&pf.X;
r.Y.Value = *(IntPtr *)&pf.y; r.Y.Value = *(IntPtr *)&pf.Y;
} }
else else
{ {
NSPointD pd = SendPointD(receiver, selector); NSPointD pd = SendPointD(receiver, selector);
r.X.Value = *(IntPtr *)&pd.x; r.X.Value = *(IntPtr *)&pd.X;
r.Y.Value = *(IntPtr *)&pd.y; r.Y.Value = *(IntPtr *)&pd.Y;
} }
} }

View file

@ -195,13 +195,17 @@ namespace OpenTK.Platform.MacOS
// Using IntPtr in NSFloat cause that if imported function // Using IntPtr in NSFloat cause that if imported function
// return struct that consist of them you will get wrong data // return struct that consist of them you will get wrong data
// This types are used for such function. // This types are used for such function.
public struct NSPointF [StructLayout(LayoutKind.Sequential)]
struct NSPointF
{ {
public float x, y; public float X;
public float Y;
} }
public struct NSPointD [StructLayout(LayoutKind.Sequential)]
struct NSPointD
{ {
public double x, y; public double X;
public double Y;
} }
} }

View file

@ -78,14 +78,14 @@ namespace OpenTK.Platform.MacOS
if (IntPtr.Size == 4) if (IntPtr.Size == 4)
{ {
NSPointF pf = EventGetLocationF(@event); NSPointF pf = EventGetLocationF(@event);
r.X.Value = *(IntPtr *)&pf.x; r.X.Value = *(IntPtr *)&pf.X;
r.Y.Value = *(IntPtr *)&pf.y; r.Y.Value = *(IntPtr *)&pf.Y;
} }
else else
{ {
NSPointD pd = EventGetLocationD(@event); NSPointD pd = EventGetLocationD(@event);
r.X.Value = *(IntPtr *)&pd.x; r.X.Value = *(IntPtr *)&pd.X;
r.Y.Value = *(IntPtr *)&pd.y; r.Y.Value = *(IntPtr *)&pd.Y;
} }
} }