PDA

View Full Version : Position of a GLUT window



Mr.Freeze
10-14-2001, 07:27 PM
Hi,

How do I get the position coordinates of my GLUT window?

I can set its position with glutPositionWindow(x,y) but I didn't find a possibility to retrieve its position.

Can someone help??

Thanks http://www.opengl.org/discussion_boards/ubb/smile.gif

pleopard
10-15-2001, 11:56 AM
You have to keep track of that yourself. Actually this is not a problem since you specify the initial window size and supply a callback for the window resizing. Just record the position/sizewhen you create the window and update the position/size in your resize callback.

Mr.Freeze
10-15-2001, 03:18 PM
Yes, but the problem is: the resize callback doesnt give me the window's position coord., it gives me only the width and height of that window... :

void glutReshapeFunc(void (*func)(int width, int height));

http://www.opengl.org/discussion_boards/ubb/frown.gif

10-15-2001, 03:50 PM
check this out
http://www.opengl.org/developers/documentation/glut/spec3/node70.html#SECTION000101000000000000000


specifically

glutGet(GLUT_WINDOW_X)
and
glutGet(GLUT_WINDOW_Y)

Mr.Freeze
10-15-2001, 04:26 PM
That's what I was looking for, thanks http://www.opengl.org/discussion_boards/ubb/smile.gif http://www.opengl.org/discussion_boards/ubb/smile.gif