projects
/
platform
/
core
/
csapi
/
opentk.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6440ca3
)
Wrong cast for interop when setting position(MacOS)
author
VPeruS
<vperus@gmail.com>
Sun, 25 Jun 2017 00:43:48 +0000
(
03:43
+0300)
committer
VPeruS
<vperus@gmail.com>
Sun, 25 Jun 2017 00:43:48 +0000
(
03:43
+0300)
src/OpenTK/Platform/MacOS/HIDInput.cs
patch
|
blob
|
history
diff --git
a/src/OpenTK/Platform/MacOS/HIDInput.cs
b/src/OpenTK/Platform/MacOS/HIDInput.cs
index
87d06ae
..
046ab42
100644
(file)
--- a/
src/OpenTK/Platform/MacOS/HIDInput.cs
+++ b/
src/OpenTK/Platform/MacOS/HIDInput.cs
@@
-1049,8
+1049,18
@@
namespace OpenTK.Platform.MacOS
NSPoint p = new NSPoint();
unsafe
{
- p.X.Value = *(IntPtr *)&x;
- p.Y.Value = *(IntPtr *)&y;
+ if (IntPtr.Size == 8)
+ {
+ p.X.Value = *(IntPtr *)&x;
+ p.Y.Value = *(IntPtr *)&y;
+ }
+ else
+ {
+ float f1 = (float)x;
+ float f2 = (float)y;
+ p.X.Value = *(IntPtr *)&f1;
+ p.Y.Value = *(IntPtr *)&f2;
+ }
}
CG.WarpMouseCursorPosition(p);