Menu

#223 Unstable Window Posistioning

None
closed-invalid
nobody
None
5
2015-04-14
2015-04-13
Ray Bornert
No

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 );
}

Related

Bugs: #223

Discussion

  • Diederick C. Niehorster

    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:


    [bugs:#223] Unstable Window Posistioning

    Status: open
    Group:
    Created: Mon Apr 13, 2015 03:19 PM UTC by Ray Bornert
    Last Updated: Mon Apr 13, 2015 03:19 PM UTC
    Owner: nobody

    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 );
    }


    Sent from sourceforge.net because you indicated interest in https://sourceforge.net/p/freeglut/bugs/223/

    To unsubscribe from further messages, please visit https://sourceforge.net/auth/subscriptions/

     

    Related

    Bugs: #223

  • Diederick C. Niehorster

    • status: open --> closed-invalid
    • Group: -->
     

Log in to post a comment.