mouse help

im using glut and all i can do right now is get the x and y position of the cursor on the screen but when the cursor is on the very right hand side of the screen and i move the mouse to right even more it wont pick that up and i need to pick up that movement
any ideas?

What you are asking for is pretty much impossible i think, If you are using this for some sort of motion, why not just continue the last motion while the mouse is at the screen extremeties, or slightly speed it up over the last few pixels at the extremeties?

Nothing’s impossible ! … well maybe ?

Your problem is a very common one that can be easily resolved … using DirectInput is one that’s possible but what I do is to maintain the cursor at the form’s center - so read the cursor’s position and then move it back to the center … GetCursor and SetCursor !

Andrew )

An other approach is to warp the pointer only if it hits the edge of the window.This way you need less cursor warps which results in less overhead.I don’t think it’ll make a big difference though(it does make under linux and X11 for other reasons).

Is there any way to change the position of the cursor with platform-independent calls?

Is there any way to change the position of the cursor with platform-independent calls?

i don’t believe so.

FYI: in the glut source code, glutWarpPointer is just a wrapper for SetCursorPos in WIN32 and XWarpPointer on un*x machines.

b

[This message has been edited by coredump (edited 06-12-2002).]

If you want platform independency you should use some cross-platform library to do it for you,like SDL or glut.

how do you set the cursor position in glut?

Originally posted by AndrewJJ:
[b]Nothing’s impossible ! … well maybe ?

Your problem is a very common one that can be easily resolved … using DirectInput is one that’s possible but what I do is to maintain the cursor at the form’s center - so read the cursor’s position and then move it back to the center … GetCursor and SetCursor !

Andrew )[/b]

glutWarpPointer http://techpubs.sgi.com/library/tpl/cgi-…glutWarpPointer

i’ve got it
thanx for eveyone’s help