A5 win7 screensaver
William Labbett

hi again,

have been running a program which has a screen which stays the same unless a key is pressed so when I run it I expected the windows screensaver to kick in after a while but it doesn't show up.

The video mode is FULLSCREEN.

Anyone know why it doesn't show up ?

Arthur Kalliokoski
Thomas Fjellstrom

I think allegro tells the OS to not trigger a screensaver. But maybe not.

William Labbett

I'm not calling al_inhibit_screensaver() at all. I assumed the default was false.

So a call like al_inhibit_screensaver(true) would effectively do nothing if allegro tells the OS to inhibit it.

hhhmmmm...

Trent Gamblin

Allegro doesn't tell it to inhibit it unless you do call that function with 'true'.

Arthur Kalliokoski

If you want the screensaver to kick in, you have to pass false, right?

Trent Gamblin

No, not unless it has changed under my nose.

EDIT:

The documentation confirms:
This function allows the user to stop the system screensaver from starting up if true is passed, or resets the system back to the default state (the state at program start) if false is passed. It returns true if the state was set successfully, otherwise false.

EDIT2: or rather doesn't confirm... it sets it to whatever it was set to when the program starts if you pass false.

William Labbett

Allegro doesn't tell it to inhibit it unless you do call that function with 'true'.

hence why I'm wondering why it's not coming up.

Trent Gamblin

Is your screensaver turned off in Windows settings? Are you pressing keys or using the mouse?

William Labbett

Before I answered no and no, I thought I better check. The answer is the screensaver isn't disabled in the windows settings but for some reason it isn't coming up after the time it's says it should so something's stopping it but I don't know what :-/

Trent Gamblin

Would power management settings have anything to do with the screensaver?

William Labbett

I tried fidding with them. They don't seem to have anything to do with anything. It says it should turn off the monitor after a minute but it doesn't after 10.

Sorry to be a pain. I don't understand this OS.

Arthur Kalliokoski

There are often settings in the CMOS setup when you first power on the computer (it says "Press DEL for setup" or similar.)

Anyway, does the screensaver come on with just the desktop running? And then it won't work with the game running in fullscreen? No matter what you pass to al_inhibit_screensaver()?

William Labbett

Anyway, does the screensaver come on with just the desktop running?

no

EDIT : right. Back on track.

I rebooted and now the screensaver does come up when just the desktop is running and the monitor does turn off so things are working. Might have been because windows had an update to install.

Anyway, now if I run my program in windowed mode the screensaver DOES come up, but in FULLSCREEN it DOESN'T.

Evert

if I run my program in windowed mode the screensaver DOES come up, but in FULLSCREEN it DOESN'T.

Could that be normal? If some program takes over the screen, then Windows doesn't activate the screensaver?
Does it make a difference if you use a "fullscreen window" or not?

Arthur Kalliokoski

The source is too complicated for me, but try the fullscreen thing both ways with al_inhibit_screensaver(1) or al_inhibit_screensaver(0). My guess is the fullscreen mode turns screensaver off but not windowed mode.

Trent Gamblin

I'm not sure if that's normal or not... could it be a display driver setting? I guess it's off to windows for me to test it...

EDIT1:
It appears to be a Direct3D thing. OpenGL works already. There's no way around it on XP, but in Vista or greater there is a flag. For that flag to work, you have to build Allegro with WANT_D3D9EX, which I presume means your program won't work on XP... just looking into it more closely and doing some testing now.

EDIT2:
Ok, so it works on Vista+, and the "good" news is, the binary will work on XP too, but the screensaver just won't come on. You have to build it with an up-to-date DirectX SDK, which my MinGW installation doesn't have, so I had to build it with MSVC. I'll commit the code.

Thread #605627. Printed from Allegro.cc