moai/moai-dev — pull request #727 by atis-- (2013-07-18 09:12:23+00:00)
Title: fix glut fullscreen bug (app would not stay in fullscreen mode)

The GLUT host contains a serious bug which affects its fullscreen behavior. There is an unnecessary call to **glutReshapeWindow()** inside **_onReshape** handler.

A user should call *glutReshapeWindow* to request window size change which causes *_onReshape* to fire. If you call *glutReshapeWindow* inside the *_onReshape* handler itself, this results in an infinite series of *_onReshape* calls. Note that the *_onReshape* handler is not invoked immediately by *glutReshapeWindow* but rather queued for a later time at the end of some internal GLUT loop.

Another side effect is that the application will not stay in fullscreen mode. These behaviors are described in *glutFullScreen* and *glutReshapeWindow* docs:
> Subsequent glutReshapeWindow and glutPositionWindow requests on the window will disable the full screen status of the window.
>http://www.opengl.org/documentation/specs/glut/spec3/node24.html

> glutReshapeWindow disables the full screen status of a window if previously enabled.
> http://www.opengl.org/resources/libraries/glut/spec3/node23.html

Since *glutReshapeWindow* is now being called all the time, the application will pop out of fullscreen mode immediately. This pull request simply removes the extra function call.

Regards,
Atis