Mouse

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

And yes, you can use GLUT within WinMain, but you have to pass “dummy-argv/argc” arguments to the init function.

int WinMain(whatevergoeshere)
{
char *argv = “putsometexthere”;
int argv = 1;

glutInit(argc, &argv);
// rest goes here

}

Try something like that.

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).

Na, i’m not doing picking yet. I will soon, though. Thanks SO much, Bob. That’s code’s really useful.