Description
In the test hello_world_gles.c,
the callback registered to glutReshapeFunc() is not being called when the browser window is resized, even when using html which stretches the canvas to cover the browser window ('soft fullscreen').
Here's a live example of the problem (try resizing the browser window):
https://erik-larsen.github.io/emscripten-glut-resizable/hello_world_gles.html
And here's a fix:
https://erik-larsen.github.io/emscripten-glut-resizable/hello_world_gles_resizable.html
The fix detects canvas size changes on redraws and explicitly calls glutReshapeWindow(). This doesn't seem ideal though, as the canvas size check has to be done on every frame, plus this seems like something the GLUT implementation should handle under the hood. As well, the SDL2 implementation does send resize window callbacks under similar circumstances.
I put together a repository for this issue and the workaround fix here:
https://github.com/erik-larsen/emscripten-glut-resizable
-Erik