Section: C Library Functions (3)
- Sets the Reshape callback for the current window.
OpenGLUT - windowcallback
Fn glutReshapeFunc void( *callback )( int w int h )
Client function for reshape-window event.
This registers a function with OpenGLUT, which OpenGLUT
will invoke whenever the window is reshaped or
resized. Your callback is only invoked when the host
window system has actually changed the window size.
The parameters to your callback are the new width and
height for your window.
If you do not provide a reshape callback, OpenGLUT
will simply call glViewport(0,0,
This callback is bound to the
To ask OpenGLUT about the present dimensions of the
, you can use glutGet().
Unlike other callbacks, GLUT has an
default behavior if you do not set this. (Most event types passively do nothing if you do not specify a callback to handle them.)
The reshape callback should always be called, if registered, when your window is first created.