View Full Version : Mouse
09-18-2001, 12:50 PM
How would I find the mouse x/y cordnance using Open GL, but not GLUT?(I'm using windows code.[On a side note, is there a way to use GLUT in WinMain?]) Or do I need to use a different library? (And which one?)
[This message has been edited by Ionwizard (edited 09-18-2001).]
OpenGL does not deal with input of any kind, and therefore can provide you with mouse coordinates. I'm not even sure OpenGL knows what a mouse is http://www.opengl.org/discussion_boards/ubb/tongue.gif
And yes, you can use GLUT within WinMain, but you have to pass "dummy-argv/argc" arguments to the init function.
char *argv = "putsometexthere";
int argv = 1;
// rest goes here
Try something like that.
09-18-2001, 01:27 PM
You're writing Windows code, right? So feel free to use Windows mouse messages to deal with the mouse coordinates.
Now, if your question is on "picking" (finding out which object the mouse is on), that is a different matter. Do a search on picking on this board, and you will find lots of useful posts (most of which guide you to use the selection buffer).
09-18-2001, 02:00 PM
Na, i'm not doing picking yet. I will soon, though. Thanks SO much, Bob. That's code's really useful.
Powered by vBulletin® Version 4.2.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.