I’m using GLFW 2.5 - Is there a way to switch between Fullscreen and Windowed modes?
I was hoping that closing the current window (glfwCloseWindow) and then opening another would work, but it doesn’t. The window closes + opens fine, but nothing will render in it.
If there isn’t a way, any suggestions on how to add this functionality to the library? Cause I really need it.
2.5 doesn’t support this. You’d need to add it in yourself.
On Windows it’s easy:
1) Change the resolution/mode (ChangeDisplaySettings)
2) Resize and move the window (SetWindowPos)
3) Show or hide the window borders, title bar, etc (SetWindowLongPtr)
I’ll probably need this myself at some point, so if it isn’t available by then, I’ll write it.
I’m not so sure about other OSes. Perhaps the ability to switch wasn’t included because most OSes don’t support it?
It should have worked all along, but there are a few bugs in 2.5 that prevents it from working in practice. These have been fixed in 2.6, which is in CVS and which I should have released a beta of a month ago.
You’re talking about switching between fullscreen and windowed mode without destroying the context, which wasn’t the original question. However, there was a thread on that topic on glfw-dev recently.