2016-08-29 21:07:52 -04:00
|
|
|
#include "stdafx.h"
|
|
|
|
#include "PlatformUtilities.h"
|
|
|
|
|
2018-01-05 15:37:49 -05:00
|
|
|
#if !defined(LIBRETRO) && defined(_WIN32)
|
2016-08-29 21:07:52 -04:00
|
|
|
#include <Windows.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
void PlatformUtilities::DisableScreensaver()
|
|
|
|
{
|
|
|
|
//Prevent screensaver/etc from starting while using the emulator
|
|
|
|
//DirectInput devices apparently do not always count as user input
|
2018-01-05 15:37:49 -05:00
|
|
|
#if !defined(LIBRETRO) && defined(_WIN32)
|
2016-08-29 21:07:52 -04:00
|
|
|
SetThreadExecutionState(ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED | ES_CONTINUOUS);
|
2018-01-05 15:37:49 -05:00
|
|
|
#endif
|
2016-08-29 21:07:52 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
void PlatformUtilities::EnableScreensaver()
|
|
|
|
{
|
2018-01-05 15:37:49 -05:00
|
|
|
#if !defined(LIBRETRO) && defined(_WIN32)
|
2016-08-29 21:07:52 -04:00
|
|
|
SetThreadExecutionState(ES_CONTINUOUS);
|
2018-01-05 15:37:49 -05:00
|
|
|
#endif
|
2016-08-29 21:07:52 -04:00
|
|
|
}
|