Discussion:
mouse sensitivity in opengl
(too old to reply)
Bohus Kral
2003-12-27 22:29:10 UTC
Permalink
Please tell me how to set mouse sensitivity in my c++ opengl program
independent on windows mouse sensitivity.

Bohus
Poison64
2003-12-27 23:47:50 UTC
Permalink
Post by Bohus Kral
Please tell me how to set mouse sensitivity in my c++ opengl program
independent on windows mouse sensitivity.
That's probably OS-dependent, and if you're using Windows, then
I think that Direct Input would help you.
Post by Bohus Kral
Bohus
--
Poison64
poison64(aT)poczta.onet.pl || poison64(aT)op.pl
=> http://www.poison64.prv.pl/
=> ICQ# 125215364 => GG# 4817051
Vis Mike
2003-12-29 05:22:57 UTC
Permalink
Post by Bohus Kral
Please tell me how to set mouse sensitivity in my c++ opengl program
independent on windows mouse sensitivity.
You could draw your own pointer and keep track of delta changes of the real
pointer. Something like this:

int my_x = 0, my_y = 0;
int last_x = 0, last_y = 0;
bool warped = false;

void motionCallback( int x, int y ) {
if( warped == 1 ) { warped = 0; return; }
warped = 1
glutWarpPointer( width / 2, height / 2 )
my_x = (x - lastX) / 10
lastX = (width / 2) - (x - lastX)
lastY = (height / 2) - (y - lastY)
glutPostRedisplay
}

The 'warped' boolean is used to avoid infinite recursion since
glutWarpPointer generates a mouse event itself.

-- Mike

Continue reading on narkive:
Loading...