This question is about a graphics application using OpenGL. (At the time I am using the framework GLFW but I consider changing it.)
My aim is to let the user (as much as possible) continuously switch between fullscreen mode and windowed mode. This procedure should take less than a second and can occur during runtime. For example see the game Minecraft where the user can toggle fullscreen with virtually no delay.
The window recreation process doesn't take so much time. But the problem is, that closing the window destroys my OpenGL context and I have to reload all my shaders and buffers.
How to recreate the window of a graphics application without destroying the OpenGL context? (I would like to use GLFW but I am open minded about alternative frameworks or a own implementation.)