glutInitWindowPosition

set the initial window position and size respectively.

Signature

glutInitWindowPosition( int( x ) , int( y ) )-> void
glutInitWindowPosition( x , y )
glutInitWindowPosition( c_int(x), c_int(y) ) -> None
glutInitWindowSize( int( width ) , int( height ) )-> void
glutInitWindowSize( width , height )
glutInitWindowSize( c_int(width), c_int(height) ) -> None

Parameters

VariablesDescription
width
Width in pixels.
height
Height in pixels.
x
Window X location in pixels.
y
Window Y location in pixels.

Description

Windows created by glutCreateWindow will be requested to be created with the current initial window position and size.
The initial value of the initial window position GLUT state is -1 and -1. If either the X or Y component to the initial window position is negative, the actual window position is left to the window system to determine. The initial value of the initial window size GLUT state is 300 by 300. The initial window size components must be greater than zero.
The intent of the initial window position and size values is to provide a suggestion to the window system for a window's initial size and position. The window system is not obligated to use this information. Therefore, GLUT programs should not assume the window was created at the specified size or position. A GLUT program should use the window's reshape callback to determine the true size of the window.

Example

If you would like your GLUT program to default to starting at a given screen location and at a given size, but you would also like to let the user override these defaults via a command line argument (such as -geometry for X11), call glutInitWindowSize and glutInitWindowPosition before your call to glutInit . For example:
int main(int argc, char **argv) { glutInitWindowSize(500, 300); glutInitWindowPosition(100, 100); glutInit(&argc, argv); ... }
However, if you'd like to force your program to start up at a given size, call glutInitWindowSize and glutInitWindowPosition after your call to glutInit . For example:
int main(int argc, char **argv) { glutInit(&argc, argv); glutInitWindowSize(500, 300); glutInitWindowPosition(100, 100); ... }

See Also

glutInit glutCreateWindow glutCreateSubWindow glutReshapeFunc glutGet

Sample Code References

The following code samples have been found which appear to reference the functions described here. Take care that the code may be old, broken or not even use PyOpenGL.

glutInitWindowPosition
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson11.py Lines: 155
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson18.py Lines: 267
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson6.py Lines: 193
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson41.py Lines: 325
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson16.py Lines: 176
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson23.py Lines: 236
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson5.py Lines: 205
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson4.py Lines: 157
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson26.py Lines: 222
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson12.py Lines: 156
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson3.py Lines: 134
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson13.py Lines: 187
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson1.py Lines: 107
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson19.py Lines: 248
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson42.py Lines: 395
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson2.py Lines: 129
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson6-multi.py Lines: 231
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson45.py Lines: 477
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson48/NeHeGL.py Lines: 132
OpenGL-Demo PyOpenGL-Demo/proesch/nurbs/nurbs.py Lines: 202
OpenGL-Demo PyOpenGL-Demo/GLUT/gears.py Lines: 266
OpenGL-Demo PyOpenGL-Demo/GLUT/shader_test.py Lines: 119
OpenGL-Demo PyOpenGL-Demo/GLUT/glutplane.py Lines: 214
OpenGL-Demo PyOpenGL-Demo/redbook/hello.py Lines: 97
OpenGL-Demo PyOpenGL-Demo/redbook/drawf.py Lines: 108
OpenGL-Demo PyOpenGL-Demo/redbook/lines.py Lines: 136
OpenGL-Demo PyOpenGL-Demo/redbook/movelight.py Lines: 134
OpenGL-Demo PyOpenGL-Demo/redbook/smooth.py Lines: 102
OpenGL-Demo PyOpenGL-Demo/redbook/double.py Lines: 108
OpenGL-Demo PyOpenGL-Demo/redbook/teapots.py Lines: 202
OpenGL-Demo PyOpenGL-Demo/redbook/cube.py Lines: 93
OpenGL-Demo py2exe-example/shader_test.py Lines: 121
{Artistic License} PymmLib pymmlib/applications/glutviewer.py Lines: 401
{LGPL} PyUI2 renderers/openglGlut.py Lines: 53
{LGPL} PyUI2 system/glutdevice.py Lines: 49
glutInitWindowSize
OpenGLContext OpenGLContext/glutcontext.py Lines: 38
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson11.py Lines: 152
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson18.py Lines: 264
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson6.py Lines: 190
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson41.py Lines: 322
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson16.py Lines: 173
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson23.py Lines: 233
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson5.py Lines: 202
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson4.py Lines: 154
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson26.py Lines: 219
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson12.py Lines: 153
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson3.py Lines: 131
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson13.py Lines: 184
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson1.py Lines: 104
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson19.py Lines: 245
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson42.py Lines: 392
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson2.py Lines: 126
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson6-multi.py Lines: 228
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson45.py Lines: 474
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson48/NeHeGL.py Lines: 129
OpenGL-Demo PyOpenGL-Demo/proesch/nurbs/nurbs.py Lines: 201
OpenGL-Demo PyOpenGL-Demo/da/dots.py Lines: 99
OpenGL-Demo PyOpenGL-Demo/GLUT/gears.py Lines: 267
OpenGL-Demo PyOpenGL-Demo/GLUT/shader_test.py Lines: 116
OpenGL-Demo PyOpenGL-Demo/GLUT/glutplane.py Lines: 215
OpenGL-Demo PyOpenGL-Demo/redbook/hello.py Lines: 96
OpenGL-Demo PyOpenGL-Demo/redbook/scene.py Lines: 135
OpenGL-Demo PyOpenGL-Demo/redbook/drawf.py Lines: 107
OpenGL-Demo PyOpenGL-Demo/redbook/lines.py Lines: 135
OpenGL-Demo PyOpenGL-Demo/redbook/movelight.py Lines: 133
OpenGL-Demo PyOpenGL-Demo/redbook/smooth.py Lines: 101
OpenGL-Demo PyOpenGL-Demo/redbook/fog.py Lines: 150
OpenGL-Demo PyOpenGL-Demo/redbook/double.py Lines: 107
OpenGL-Demo PyOpenGL-Demo/redbook/teapots.py Lines: 201
OpenGL-Demo PyOpenGL-Demo/redbook/cube.py Lines: 92
OpenGL-Demo py2exe-example/shader_test.py Lines: 118
{Artistic License} PymmLib pymmlib/applications/glutviewer.py Lines: 400
{LGPL} PyUI2 renderers/openglGlut.py Lines: 52
{LGPL} PyUI2 system/glutdevice.py Lines: 48
{GPL3} OpenGL-Programmable 05-shader.py Lines: 308
{GPL3} OpenGL-Programmable 07-attrib.py Lines: 327
{GPL3} OpenGL-Programmable 03-array.py Lines: 228
{GPL3} OpenGL-Programmable 09-gles2.py Lines: 370
{GPL3} OpenGL-Programmable 06-perpixel.py Lines: 316
{GPL3} OpenGL-Programmable 10-gl3.2core.py Lines: 380
{GPL3} OpenGL-Programmable 02-displaylist.py Lines: 226
{GPL3} OpenGL-Programmable 04-vbo.py Lines: 247
{GPL3} OpenGL-Programmable 01-direct.py Lines: 217
{GPL3} OpenGL-Programmable 08-pbo.py Lines: 349