View Full Version : OpenGL Mouse-Coordinates...

05-20-2004, 06:07 PM
Is there a function in OpenGL to retrieve the mouse-coordinates? I am asking because I want to have my app 100% portable, and that means not using the Win32 API any more than I have to. I was hoping there'd be some kind of function that would retrieve the coordinates using whatever API the app is compiled on.

If not, I have another idea on how to code it myself. I assume WINDOWS is defined automatically by the compiler for a Win32 app, and LINUX is defined for Linux/X-Win apps? If that's the case, I can easily code my own function.

05-20-2004, 08:40 PM
OpenGL ONLY provides a graphics api

so to answer your question, opengl does not have any mouse function calls.

but don't despair - what you're looking for [cross-platformability] is provided with glut, one of several cross-platform libraries to give your opengl apps access to non-graphics resources.

here's a google search (http://www.google.com/search?q=glut+mouse) for glut and mouse. also, check http://nehe.gamedev.net/ (@ note to glut) for examples.

I hope that helps

05-21-2004, 07:32 AM

GlUT functions provide windows and keyboard/mouse support. I strongly suggest you to visit this:
LIGHTHOUSE3D.COM - GLUT TUTORIAL (http://www.lighthouse3d.com/opengl/glut/index.php3?9)