Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/intern
diff options
context:
space:
mode:
authorErwin Coumans <blender@erwincoumans.com>2006-12-25 00:21:49 +0300
committerErwin Coumans <blender@erwincoumans.com>2006-12-25 00:21:49 +0300
commit0e094ffcab8ae40ce06584c02292102d53ece77d (patch)
tree5514f62bd85ebfb4163533450adb2b519b503067 /intern
parent66643dbf1f5b3bae9997c3256624f574c5195cb4 (diff)
Attempt to fix mouse-look in game engine on OS X: setCursorPosition. Thanks Malachy for the fix, it seem to work on MacOS Intel.
Diffstat (limited to 'intern')
-rw-r--r--intern/ghost/intern/GHOST_SystemCarbon.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/intern/ghost/intern/GHOST_SystemCarbon.cpp b/intern/ghost/intern/GHOST_SystemCarbon.cpp
index 9e790154eb9..e1e3853e8a8 100644
--- a/intern/ghost/intern/GHOST_SystemCarbon.cpp
+++ b/intern/ghost/intern/GHOST_SystemCarbon.cpp
@@ -493,7 +493,13 @@ GHOST_TSuccess GHOST_SystemCarbon::setCursorPosition(GHOST_TInt32 x, GHOST_TInt3
{
float xf=(float)x, yf=(float)y;
+ CGAssociateMouseAndMouseCursorPosition(false);
+ CGSetLocalEventsSuppressionInterval(0);
CGWarpMouseCursorPosition(CGPointMake(xf, yf));
+ CGAssociateMouseAndMouseCursorPosition(true);
+
+//this doesn't work properly, see game engine mouse-look scripts
+// CGWarpMouseCursorPosition(CGPointMake(xf, yf));
// this call below sends event, but empties other events (like shift)
// CGPostMouseEvent(CGPointMake(xf, yf), TRUE, 1, FALSE, 0);