[ win32 ] screen switching

kohaistyle wrote on Sunday, November 28, 2004:

Hi all …

I never really noticed, but when starting a fullscreen GLFW application, it appears the screen is flashing several times before the screen is initialized …

When looking at the code, it seems the GLFW fullscreen mode is not a real fullscreen ( CDS_FULLSCREEN in dwStyle ), but rather a fullscreen borderless window mode.

Is it normal, or is it planned to add a true fullscreen mode ?

( i’m making my assumption based on the NeHeGL code which launches a true fullscreen window )

marcus256 wrote on Monday, November 29, 2004:

The GLFW code is actually based on the NeHe code (way back, and then heavily altered after reading the MSDN docs and fixing bugs etc).

I can not seem to find that you can use CDS_FULLSCREEN in dwStyle (according the the MSDN docs). This sounds suspicious to me, since the "CDS" in CDS_FULLSCREEN stands for "ChangeDisplaySettings", which is the name of the function that accepts the CDS_FULLSCREEN flag.

The fullscreen mode is actually set in the _glfwSetVideoModeMODE function in win32_fullscreen.c, where ChangeDisplaySettings(&dm,CDS_FULLSCREEN) is called.

kohaistyle wrote on Tuesday, November 30, 2004:

Hmmm, after a second look, you were right … CDS_FULLSCREEN only applies when you switch mode using the CHange DisplaySettings function …

Sorry for the mistake …

So, that lead to a dead end :frowning: Still don’t know what causes that screen flicker at the application start …

marcus 1 - me 0 ! :wink:

( on another note, do you have some hints/urls regarding how to disable/enable the multi-monitor support in general on win32 ??? i didn’t find any valuable resource about that issue and i need a quick hack for this ? )

kohaistyle wrote on Tuesday, November 30, 2004:

Stupid me, after a another quick search, maybe i found a useful resource … :slight_smile:

sqweek wrote on Sunday, January 02, 2005:

Hiya, I recently discovered GLFW while building an abstraction layer of my own. Less work sounds good so I checked it out :slight_smile:
Anyway, I like what you’ve done!

But I did notice one little thing somewhat related to this thread - fullscreen GLFW apps seem to turn the Windows minimise animation on. And if there’s one thing I HATE, it’s that minimisation animation >.< (it just takes so damn long!)
Anyway, the particle and pong3d examples cause it, but not boing or gears which is why I think it’s fullscreen that’s doing it.
I’m not familiar enough with win32 or GLFW to go looking for the cause myself (I had a little look, but was quickly overwhelmed), but I’ve done a little debugging.
There’s a slight delay between changing resolution to 640x480 and the GLFW window appearing. If I minimise a window during this time, it minimises normally - no animation. Now, once the GLFW window appears, if I alt-tab or close the window and minimise something then I get the animation. (so it seems to be something to do with switching back to normal resolution?)

Some details on my setup:
Win2000 SP4
GLFW compiled under cygwin (NOTE: I changed CFLAGS in the makefiles to build for “-mwindows -mno-cygwin” instead of “-mwin32” (so the resulting exe doesn’t depend on cygwin1.dll))
Examples linked with the static library (not the DLL)

I’m not sure at this point whether the setting change is permanent or whether it will reset to normal after a reboot.

marcus256 wrote on Monday, January 03, 2005:


That is a good bug report. I thought I had taken care of this. Looking over the code it should work, but I have not actually debugged it so there may be some error(s). If you wish to debug your particular system it should not be too difficult:

Check for calls to _glfwMinMaxAnimations() in lib\win32\win32_window.c. You could printf() AI.iMinAnimate in that function, for instance.

Hint: I turn off minimisation animation when doing some show/minimize/normal cycles in order to fool Windows into giving the window input focus, and then reset the minimisation animation setting to what it was before.

UPDATE: Actually, I think I found the bug… :confused: I haven’t been follwing the Win32 API specs fully :frowning:

The fix should be: In _glfwMinMaxAnimations() there are two calls to SystemParametersInfo(). Change the second argument from 0 to AI.cbSize in both function calls. Could you see if that helps?

sqweek wrote on Monday, January 03, 2005:

Yep, that did it!
I tested it with the minimise animation on and off, and either way the original setting persisted on exit/alt-tab.

Thanks a lot, I like the 13 hour turnaround :slight_smile: