From 52206ec13b170a058e522ec3ccbcb4a90f2f491d Mon Sep 17 00:00:00 2001 From: VPeruS Date: Wed, 14 Jun 2017 00:56:42 +0300 Subject: [PATCH] Add requsted changes --- src/OpenTK/Platform/MacOS/Cocoa/Cocoa.cs | 8 ++++---- src/OpenTK/Platform/MacOS/Cocoa/NSFloat.cs | 12 ++++++++---- src/OpenTK/Platform/MacOS/Quartz/EventServices.cs | 8 ++++---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/OpenTK/Platform/MacOS/Cocoa/Cocoa.cs b/src/OpenTK/Platform/MacOS/Cocoa/Cocoa.cs index 03c494d0..ac6ae977 100644 --- a/src/OpenTK/Platform/MacOS/Cocoa/Cocoa.cs +++ b/src/OpenTK/Platform/MacOS/Cocoa/Cocoa.cs @@ -173,14 +173,14 @@ namespace OpenTK.Platform.MacOS if (IntPtr.Size == 4) { NSPointF pf = SendPointF(receiver, selector); - r.X.Value = *(IntPtr *)&pf.x; - r.Y.Value = *(IntPtr *)&pf.y; + r.X.Value = *(IntPtr *)&pf.X; + r.Y.Value = *(IntPtr *)&pf.Y; } else { NSPointD pd = SendPointD(receiver, selector); - r.X.Value = *(IntPtr *)&pd.x; - r.Y.Value = *(IntPtr *)&pd.y; + r.X.Value = *(IntPtr *)&pd.X; + r.Y.Value = *(IntPtr *)&pd.Y; } } diff --git a/src/OpenTK/Platform/MacOS/Cocoa/NSFloat.cs b/src/OpenTK/Platform/MacOS/Cocoa/NSFloat.cs index 39b55d36..b6f90f70 100644 --- a/src/OpenTK/Platform/MacOS/Cocoa/NSFloat.cs +++ b/src/OpenTK/Platform/MacOS/Cocoa/NSFloat.cs @@ -195,13 +195,17 @@ namespace OpenTK.Platform.MacOS // Using IntPtr in NSFloat cause that if imported function // return struct that consist of them you will get wrong data // 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; } } diff --git a/src/OpenTK/Platform/MacOS/Quartz/EventServices.cs b/src/OpenTK/Platform/MacOS/Quartz/EventServices.cs index 73067be7..3a806cf7 100644 --- a/src/OpenTK/Platform/MacOS/Quartz/EventServices.cs +++ b/src/OpenTK/Platform/MacOS/Quartz/EventServices.cs @@ -78,14 +78,14 @@ namespace OpenTK.Platform.MacOS if (IntPtr.Size == 4) { NSPointF pf = EventGetLocationF(@event); - r.X.Value = *(IntPtr *)&pf.x; - r.Y.Value = *(IntPtr *)&pf.y; + r.X.Value = *(IntPtr *)&pf.X; + r.Y.Value = *(IntPtr *)&pf.Y; } else { NSPointD pd = EventGetLocationD(@event); - r.X.Value = *(IntPtr *)&pd.x; - r.Y.Value = *(IntPtr *)&pd.y; + r.X.Value = *(IntPtr *)&pd.X; + r.Y.Value = *(IntPtr *)&pd.Y; } }