I couldn't find a call back function but you could do it by hand with glutGet
:
int glutGet(GLenum state);
An example of what you might do is:
bool window_change(void)
{
int init_x = glutGet(GLUT_INIT_WINDOW_X);
int init_y = glutGet(GLUT_INIT_WINDOW_Y);
int pos_x = glutGet(GLUT_WINDOW_X);
int pos_y = glutGet(GLUT_WINDOW_Y);
return (init_x != pos_x || init_y != pos_y);
}
This will return true if it's moved from it's initial spot. If you want to see if it's moved since the last check, try:
bool window_change(void)
{
static int init_x = glutGet(GLUT_INIT_WINDOW_X);
static int init_y = glutGet(GLUT_INIT_WINDOW_Y);
int pos_x = glutGet(GLUT_WINDOW_X);
int pos_y = glutGet(GLUT_WINDOW_Y);
bool result = init_x != pos_x || init_y != pos_y;
init_x = pos_x;
init_y = pos_y;
return result;
}
You can set the window position by using the function: glutPositionWindow
void glutPositionWindow(int x, int y);