Get mouse speed instead of position?
Let me first try to ask this as simply as possible... how would you program a simple first-person perspective game using the mouse to look around?
I've got the graphics and the orientation all done using the keyboard as input, I just want to get the mouse to look around like in every FPS out there. Using GLUT... is this possible?
I've tried keeping the cursor at the middle, then after a motion call finding the difference and using that as the speed ( glutWarpPointer to reset cursor to the center each frame) - and for all I know that should work... but it's being a bit stubborn about actually moving all the time.
I've got the graphics and the orientation all done using the keyboard as input, I just want to get the mouse to look around like in every FPS out there. Using GLUT... is this possible?
I've tried keeping the cursor at the middle, then after a motion call finding the difference and using that as the speed ( glutWarpPointer to reset cursor to the center each frame) - and for all I know that should work... but it's being a bit stubborn about actually moving all the time.
You can maybe use
from CGDirectDisplay.h (CoreGraphics inside ApplicationServices)
Code:
void CGGetLastMouseDelta( CGMouseDelta * deltaX, CGMouseDelta * deltaY );Sir, e^iπ + 1 = 0, hence God exists; reply!
glutWarpPointer introduces an 0.25 second delay where no mouse movements are reported, on Mac OS X. If you want to use glutWarpPointer (which is fine) then you need to call CGSetLocalEventsSuppressionInterval(0.0) first to make it work "normally".

