In my opengl application I use the mouse to rotate the camera and action stops when the mouse cursor is outside the opengl window.
There is a way to continuously handle mouse data even if it is outside such window, or even if it reaches screen boundaries?
I can't use GLUT and I need to have a solution for both Windows and OSX.
Maybe I could have the cursor never leaving the opengl window? So that when it reaches a boundary it resets to the screen center?
Thanks
Handling mouse outside opengl window
Started by Alessandro, Oct 18 2012 09:27 AM
2 replies to this topic
Sponsor:
#2 Members - Reputation: 882
Posted 19 October 2012 - 01:34 AM
It's common practice to constantly move the mouse cursor back to screen center:
As you probably realized, vec2_offset (being a vector) encodes mouse movement direction and speed, which is exactly what you need.
vec2_offset = getMousePosition() setMousePosition(vec2_center)
As you probably realized, vec2_offset (being a vector) encodes mouse movement direction and speed, which is exactly what you need.
Learn the basics with my Python 3 video tutorial series. Looking for a good game engine, and relevant tutorials? Here you go.
Small and simple Python 3.x media library: pslab
Small and simple Python 3.x media library: pslab






