glutReshapeFunc

sets the reshape callback for the current window.

Signature

glutReshapeFunc( )-> void
glutReshapeFunc( function )
Specify handler for GLUT 'Reshape' events
    def handler( (int) width, (int) height ):
        return None

Parameters

VariablesDescription
func
The new reshape callback function.

Description

glutReshapeFunc sets the reshape callback for the current window. The reshape callback is triggered when a window is reshaped. A reshape callback is also triggered immediately before a window's first display callback after a window is created or whenever an overlay for the window is established. The width and height parameters of the callback specify the new window size in pixels. Before the callback, the current window is set to the window that has been reshaped.
If a reshape callback is not registered for a window or NULL is passed to glutReshapeFunc (to deregister a previously registered callback), the default reshape callback is used. This default callback will simply call glViewport(0,0,width,height) on the normal plane (and on the overlay if one exists).
If an overlay is established for the window, a single reshape callback is generated. It is the callback's responsibility to update both the normal plane and overlay for the window (changing the layer in use as necessary).
When a top-level window is reshaped, subwindows are not reshaped. It is up to the GLUT program to manage the size and positions of subwindows within a top-level window. Still, reshape callbacks will be triggered for subwindows when their size is changed using glutReshapeWindow .

See Also

glutDisplayFunc glutReshapeWindow

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.

glutReshapeFunc
OpenGLContext OpenGLContext/glutcontext.py Lines: 80, 82
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson11.py Lines: 174
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson18.py Lines: 286
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson6.py Lines: 212
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson41.py Lines: 344
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson16.py Lines: 195
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson23.py Lines: 255
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson5.py Lines: 224
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson4.py Lines: 176
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson26.py Lines: 241
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson12.py Lines: 175
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson3.py Lines: 153
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson13.py Lines: 206
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson1.py Lines: 126
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson19.py Lines: 267
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson42.py Lines: 414
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson2.py Lines: 148
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson6-multi.py Lines: 250
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson45.py Lines: 496
OpenGL-Demo PyOpenGL-Demo/NeHe/lesson48/NeHeGL.py Lines: 151
OpenGL-Demo PyOpenGL-Demo/da/dots.py Lines: 102
OpenGL-Demo PyOpenGL-Demo/GLUT/gears.py Lines: 272
OpenGL-Demo PyOpenGL-Demo/GLUT/shader_test.py Lines: 138
OpenGL-Demo PyOpenGL-Demo/redbook/scene.py Lines: 138
OpenGL-Demo PyOpenGL-Demo/redbook/drawf.py Lines: 111
OpenGL-Demo PyOpenGL-Demo/redbook/lines.py Lines: 140
OpenGL-Demo PyOpenGL-Demo/redbook/movelight.py Lines: 138
OpenGL-Demo PyOpenGL-Demo/redbook/smooth.py Lines: 105
OpenGL-Demo PyOpenGL-Demo/redbook/fog.py Lines: 153
OpenGL-Demo PyOpenGL-Demo/redbook/double.py Lines: 112
OpenGL-Demo PyOpenGL-Demo/redbook/teapots.py Lines: 204
OpenGL-Demo PyOpenGL-Demo/redbook/cube.py Lines: 97
OpenGL-Demo py2exe-example/shader_test.py Lines: 140
{Artistic License} PymmLib pymmlib/applications/glutviewer.py Lines: 405
{LGPL} PyUI2 renderers/openglGlut.py Lines: 57
{LGPL} PyUI2 system/glutdevice.py Lines: 54
{LGPL} PyMT pymt/ui/window/win_glut.py Lines: 17, 41
{GPL3} OpenGL-Programmable 05-shader.py Lines: 313
{GPL3} OpenGL-Programmable 07-attrib.py Lines: 332
{GPL3} OpenGL-Programmable 03-array.py Lines: 233
{GPL3} OpenGL-Programmable 09-gles2.py Lines: 375
{GPL3} OpenGL-Programmable 06-perpixel.py Lines: 321
{GPL3} OpenGL-Programmable 10-gl3.2core.py Lines: 385
{GPL3} OpenGL-Programmable 02-displaylist.py Lines: 231
{GPL3} OpenGL-Programmable 04-vbo.py Lines: 252
{GPL3} OpenGL-Programmable 01-direct.py Lines: 222
{GPL3} OpenGL-Programmable 08-pbo.py Lines: 354