fogleman / Craft

A simple Minecraft clone written in C using modern OpenGL (shaders).
http://www.michaelfogleman.com/craft/
MIT License
10.44k stars 1.39k forks source link

Add key shortcut to toggle fullscreen/windowed mode #178

Open satoshinm opened 7 years ago

satoshinm commented 7 years ago

Allows toggling fullscreen in-game using "F11". Uses glfwSetWindowMonitor() which is new in glfw 3.2.x, so this PR also includes an update to glfw from 3.1.2 to 3.2.1 (copied from https://github.com/glfw/glfw/releases/download/3.2.1/glfw-3.2.1.zip + merged in https://github.com/satoshinm/NetCraft/commit/7e34bdd5bff92f85b4045384e1f1909f6ed73457)

satoshinm commented 7 years ago

Sorry for the size of the diff, but without updating glfw, implementing fullscreen toggle would be much less straightforward (without glfwSetWindowMonitor, the way to do it is destroy and recreate the window...)