Allegro.cc - Online Community

Allegro.cc Forums » Programming Questions » A5 win7 screensaver

This thread is locked; no one can reply to it. rss feed Print
A5 win7 screensaver
William Labbett
Member #4,486
March 2004
avatar

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
Second in Command
February 2005
avatar

They all watch too much MSNBC... they get ideas.

Thomas Fjellstrom
Member #476
June 2000
avatar

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

--
Thomas Fjellstrom - [website] - [email] - [Allegro Wiki] - [Allegro TODO]
"If you can't think of a better solution, don't try to make a better solution." -- weapon_S
"The less evidence we have for what we believe is certain, the more violently we defend beliefs against those who don't agree" -- https://twitter.com/neiltyson/status/592870205409353730

William Labbett
Member #4,486
March 2004
avatar

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
Member #261
April 2000
avatar

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

Arthur Kalliokoski
Second in Command
February 2005
avatar

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

They all watch too much MSNBC... they get ideas.

Trent Gamblin
Member #261
April 2000
avatar

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
Member #4,486
March 2004
avatar

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
Member #261
April 2000
avatar

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

William Labbett
Member #4,486
March 2004
avatar

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
Member #261
April 2000
avatar

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

William Labbett
Member #4,486
March 2004
avatar

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
Second in Command
February 2005
avatar

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()?

They all watch too much MSNBC... they get ideas.

William Labbett
Member #4,486
March 2004
avatar

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
Member #794
November 2000
avatar

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
Second in Command
February 2005
avatar

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.

They all watch too much MSNBC... they get ideas.

Trent Gamblin
Member #261
April 2000
avatar

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.

Go to: