Hey Guys,
The default GLUT behavior "should" be that the following functions are stable reciprocals without the hardcoded dx,dy fudge factors that are entirely specific to my desktop.
The return values for GLUT_WINDOW_X and GLUT_WINDOW_Y need to account for the system window apron.
As it stands now, glutPositionWindow speaks client cords but the get function speaks window cords.
Another possible solution is to provide enum constants to get the wsysdx, wsysdy apron values.
Thank you,
Ray
//////////////////////////////////////////////////////////////////
void set_glut_window_numbers( int x, int y, int w, int h )
{
glutReshapeWindow(w,h);
glutPositionWindow(x,y);
}
void get_glut_window_numbers( int& x, int& y, int& w, int& h )
{
const int wsysdx=8;
const int wsysdy=33;
x = glutGet( GLUT_WINDOW_X ) - wsysdx;
y = glutGet( GLUT_WINDOW_Y ) - wsysdy;
w = glutGet( GLUT_WINDOW_WIDTH );
h = glutGet( GLUT_WINDOW_HEIGHT );
}
Dear Ray,
Thanks for writing in. This is a conscious design decision as discussed here:
http://freeglut.sourceforge.net/docs/api.php#Background, section 3.2.1
And see also the resizer demo for example code dealing with this.
All the best,
Dee
On Mon, Apr 13, 2015 at 5:19 PM, Ray Bornert rbornert@users.sf.net wrote:
Related
Bugs:
#223