I am using GLFW and I would like to know how to toggle full-screen windowed mode. Not changing the resolution, but instead setting the window to be on top and without decoration. If GLFW is not capable of doing this, then what cross platform library do you suggest to achieve this?
You can tell glfw to open your window fullscreen.
glfwOpenWindow( width, height, 0, 0, 0, 0, 0, 0, GLFW_FULLSCREEN )
As far as I know you would have to close and reopen this window to switch between a window and fullscreen mode.
To avoid GLFW changing the screen resolution, you can use glfwGetDesktopMode to query the current desktop resolution and colour depth and then pass those into glfwOpenWindow.
// get the current Desktop screen resolution and colour depth
GLFWvidmode desktop;
glfwGetDesktopMode( &desktop );
// open the window at the current Desktop resolution and colour depth
if ( !glfwOpenWindow(
desktop.Width,
desktop.Height,
desktop.RedBits,
desktop.GreenBits,
desktop.BlueBits,
8, // alpha bits
32, // depth bits
0, // stencil bits
GLFW_FULLSCREEN
) ) {
// failed to open window: handle it here
}
Since version 3.2:
Windowed mode windows can be made full screen by setting a monitor with glfwSetWindowMonitor, and full screen ones can be made windowed by unsetting it with the same function.
http://www.glfw.org/docs/latest/window.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With