Mouse Input with OpenGL
I have been using the function auxGetMouseLoc(&x,&y) where x and y are integers, from the glut libraries to get my mouse input. I save the mouse value and the next time the mouse moves I check if the new mouse location is greater or less than the old mouse location. All I need to do is check if the mouse is moving left or right. Is there a more efficient way to do this?
Your approach seems reasonable given that you aren''t doing much with the mouse. You may also try tracking it using glutMouseMove() and a function you provide, but if your current method is working, it''s probably not needed.
If you need more functionality, and you''re working on a Windows platform, then yeah, you probably want to use DirectInput instead. Nothing wrong with mixing the two.
If you need more functionality, and you''re working on a Windows platform, then yeah, you probably want to use DirectInput instead. Nothing wrong with mixing the two.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement