comwizz2's picture

Mouse Movement

Hello all. I am teaching myself OpenGL and OpenTK in a Windows Mono environment. The problem I am having is that i cnanot seem to get the mouse to move anymore then the limits of the window size. I have the pointer hidden, that was easy enough but i cannot seem to make it where the mouse has unlimited range like in a FPS. If i go to far left or right my camera stops rotating, my relevant sample is below, it is simple but i cant seem to find anything else that works using just the reference and google. I did find one post that referenced just to use System.Windows.Forms but the reason I chose OpenTK was platform independence so i was trying to shy away from that

//ABOVE
PreviousMouse = Vector2;
 
			Cam.Rotation.Y += (float)(Mouse.X - PreviousMouse.X)/1000f;
			Cam.Rotation.X += (float)(Mouse.Y - PreviousMouse.Y)/1000f;
			Cam.Rotation.Z = 0;
 
			PreviousMouse = new Vector2(Mouse.X,Mouse.Y);

Code works fine until i hit edge of window, any suggestions?


Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
comwizz2's picture
			CurrentMS = OpenTK.Input.Mouse.GetState();
 
			Console.WriteLine(CurrentMS.X.ToString());
 
			Cam.Rotation.Y += (float)(CurrentMS.X - PreviousMS.X)/1000f;
			Cam.Rotation.X += (float)(CurrentMS.Y - PreviousMS.Y)/1000f;

Ive also tried this, it doesnt work at all, always prints 0? any idea why?