Currently, GLFW does not have an API to change this state after creating a window.
If you want to use GLFW, I see two options:
- The workaround that you already have.
- Create a new window when switching this state.
- Use the native GLFW access to get real window handles and implement a function for each platform (you don't care).
All options do not seem to me too attractive. Option 2 is especially bad because GL contexts are tied to windows in GLFW, this should be possible with an extra (invisible) window and general GL contexts, but it will be ugly.
Option 3 has the advantage that it should work flawlessly once it is implemented for all relevant platforms. Since GLFW is open source, this also allows option 3b): implement this directly in GLFW and extend the API. You might even be able to integrate it into the official version of GLFW.
source share