I'm currently writing a game whith gamepad support.
I played the game to test it using the gamepad.
After some minutes my screen turned off. I thought I had a major bug and my PC just turned off completely.
But then I noticed that the monitor has been set to powersafe mode and was turned off.
Because I didn't use the mouse or the keyboard the PC thought it was not used.
But I played all the time!
How can I prevent that the screensaver/power safe mode turns on, while my game is played with a gamepad.
This dosn't happen on commercial games, does it?
Thanks for your help!
With Win32 look up on Microsoft
WM_SYSCOMMAND
SC_SCREENSAVE
SC_MONITORPOWER
//from 'allegro.c' getting value from 'allegro.cfg' _screensaver_policy = get_config_int(uconvert_ascii("system", tmp1), uconvert_ascii("disable_screensaver", tmp2), FULLSCREEN_DISABLED); // from 'wwnd.c' case WM_SYSCOMMAND: if (wparam == SC_MONITORPOWER || wparam == SC_SCREENSAVE) { if (_screensaver_policy == ALWAYS_DISABLED || (_screensaver_policy == FULLSCREEN_DISABLED && gfx_driver && !gfx_driver->windowed)) return 0; } break;
Thank you.
But to be honest I don't know what to do with this information/ how to implement it.
The Microsoft site didn't help me.
Sorry for being dumb 
Would be cool if you could explain a little bit more what this code is/does.
Thanks alot!