Fix interop for wheel events

This commit is contained in:
VPeruS 2017-06-17 17:30:01 +03:00
parent 6440ca3cf9
commit fc5c7be51a

View file

@ -138,13 +138,17 @@ namespace OpenTK.Platform.MacOS
[DllImport(LibObjC, EntryPoint="objc_msgSend_fpret")] [DllImport(LibObjC, EntryPoint="objc_msgSend_fpret")]
extern static float SendFloat_i386(IntPtr receiver, IntPtr selector); extern static float SendFloat_i386(IntPtr receiver, IntPtr selector);
// On x64 using selector that return CGFloat give you 64 bit == double
[DllImport(LibObjC, EntryPoint="objc_msgSend")] [DllImport(LibObjC, EntryPoint="objc_msgSend")]
extern static float SendFloat_normal(IntPtr receiver, IntPtr selector); extern static double SendFloat_x64(IntPtr receiver, IntPtr selector);
[DllImport(LibObjC, EntryPoint="objc_msgSend")]
extern static float SendFloat_ios(IntPtr receiver, IntPtr selector);
public static float SendFloat(IntPtr receiver, IntPtr selector) public static float SendFloat(IntPtr receiver, IntPtr selector)
{ {
#if IOS #if IOS
return SendFloat_normal(receiver, selector); return SendFloat_ios(receiver, selector);
#else #else
if (IntPtr.Size == 4) if (IntPtr.Size == 4)
{ {
@ -152,7 +156,7 @@ namespace OpenTK.Platform.MacOS
} }
else else
{ {
return SendFloat_normal(receiver, selector); return (float)SendFloat_x64(receiver, selector);
} }
#endif #endif
} }