Skip to main content
GameDev.net gamedev.net
🔒 Locked

GLFW -- Change Video Mode -- Fullscreen/windowed/resolution

Started by Halsafar Jan 31, 2006 at 9:29 PM 2 replies 5k views
Original Post
Halsafar
Halsafar
I have been reading the tutorials, reference and user guide off the GLFW site and I find mention of being able to change the video mode while in fullscreen but no explanation of the steps to take. Is there a way for GLFW to switch between fullscreen/windows or change video mode in fullscreen which does not destroy the openGL Context?
Drew_Benton
Drew_Benton
Quote:
Original post by Halsafar
Is there a way for GLFW to switch between fullscreen/windows or change video mode in fullscreen which does not destroy the openGL Context?


I don't think so, this behavior is pretty much the same for OpenGL and DirectX. No way that I know of to get around it really, sorry.
Melekor
Melekor
On windows, fullscreen/windowed toggling (EDIT: without destroying the OGL context) can be done with a few API calls. Unfortunately GLFW doesn't support this directly so you'd probably have to hack the GLFW code a bit(which you can do, since it has the zlib licence). I'm sure how easy the same thing is on other platforms, but if you're interested in doing it for windows, I can help you out with that.
Halsafar
Halsafar
Well thats pretty lame.
I made a post like a week ago about SDL, asking about window/fullscreen switch and resolution change mid-game and if it destroys the OpenGL Context.

Everyone dissed SDL saying it was the worst piece of programming every because when the resolution or window mode is changed the OpenGL context is destroyed.

So everyone pointed me in the direction of GLFW to solve this problem. So I took the time to integreate GLFW into my project and now I find I'm in the EXACT SAME place as I was with SDL...

For a fullscreen/window/resolution switch mid-game I'll have to destroy the OpenGL context, thus reload EVERYTHING... This is fine except that I wasted a bunch of time switching from SDL to GLFW to end up doing the same thing...

Unless of course someone has a better way...


As for hacking up the code for Windows: This project I am working on has to work with Linux and Windows.


Any advice?

Thanks,
Halsafar

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.