PDA

View Full Version : Detect mouse movement beyond window size



Eamonn
10-14-2008, 11:40 PM
Hi,

I have searched everywhere, but can't find any mention of this problem.

I want to allow a user to rotate with the mouse.
I am using glutEnterGameMode to go full screen, and glutPassiveMotionFunc is picking up the mouse moving,
but what I am finding is that once the cursor hits the edge of the screen then movement is not detected anymore.
What am am trying to do is allow the user to say keep moving the mouse left and have it constantly detect it is going left?
Is this possible? I noticed that when it goes into glutEnterGameMode the cursor moves to the center of the screen - is it possible to reset the cursor to the middle, so I can detect the mouse moving away from center?

Cheers

ZbuffeR
10-15-2008, 01:52 AM
A small hint : use GLFW instead of glut for game-like stuff.
Really, it is both easy and allows much more control over this type of things.

Eamonn
10-15-2008, 02:01 AM
Oh right - I had seen the name, but not used anything we didn't get told of in the course.
Thanks very much - I will find that now.

EDIT: Already seen something in the manual:-

glfwDisable( GLFW_MOUSE_CURSOR );
Mouse coordinates are not limited to the window size.

Thanks :D