Need help with getting coordinate using mouse

Is there a method in graphic library that would return the exact coordinates of the graphic in window?

Strange question. Why won’t you rephrase it, cuz i don’t think people know what you mean. If getting the mouse coordinates from the screen is what you’re after: under Windows environment you do the following (C++):


pt.x=mouse x coordinate
pt.y=mouse y coordinate



Thank for your help and advice on the way I phrase my question.

Actually, I could get the coordinate of the window. However, I would like to know whether the mouse cursor is on the shape that I have draw using openGL.

Actually, I could get the window coordinate whenever the mouse is pressed. However, is there any calulation or method to get the device coordinate?

hmmm so you ideally want to know if the mouse if over an opengl drawn object/poly. OpenGL can handle picking, I am sure there is a nehe tutorial on it.

Thank for all the help … With your help, I have just solve my problem