Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Determine window position in GLUT?

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2008
    Location
    Vancouver, Canada
    Posts
    1

    Determine window position in GLUT?

    I'm using GLUT to create my window, and would like to toggle between fullscreen and windowed. I use glutFullScreen() to go into fullscreen mode, and glutReshapeWindow() to return to windowed mode. I track the current window size in the reshape callback (glutReshapeFunc), and use the stored value to restore my window back to its original size. I would like the window to also be at its original location.

    I note that there are a few GLUT calls related to window position, namely glutPositionWindow and glutInitWindowPosition. Problem is, I have no idea where the window was before it was made fullscreen. Is there some way to determine where the used has placed the window?

  2. #2
    Junior Member Newbie
    Join Date
    Mar 2009
    Location
    South East England
    Posts
    19

    Re: Determine window position in GLUT?

    A bit late but

    int screen_pos_x = glutGet((GLenum)GLUT_WINDOW_X);
    int screen_pos_y = glutGet((GLenum)GLUT_WINDOW_Y);

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •