21 #include <android/window.h>
30 #if defined(_DEBUG) && defined(_WINDOWS)
31 #define DEBUG_NEW new(_NORMAL_BLOCK, __FILE__, __LINE__)
39 template class Singleton<Core>;
41 Core * Core::create() {
47 : m_screen_saver_enabled(
true)
52 throw Core_Init_Failure();
61 throw Core_Init_Failure();
87 return m_screen_saver_enabled;
88 #elif SDL_VERSION_ATLEAST(1,3,0)
90 #elif defined(_WINDOWS)
92 SystemParametersInfo(SPI_GETSCREENSAVEACTIVE, 0, &is_active, 0);
93 return is_active != 0;
106 m_screen_saver_enabled =
enabled;
109 ANativeActivity_setWindowFlags(g_state->activity, 0, AWINDOW_FLAG_KEEP_SCREEN_ON);
111 ANativeActivity_setWindowFlags(g_state->activity, AWINDOW_FLAG_KEEP_SCREEN_ON, 0);
112 #elif SDL_VERSION_ATLEAST(1,3,0)
117 #elif defined(_WINDOWS)
118 SystemParametersInfo(SPI_SETSCREENSAVEACTIVE,
UINT(
enabled), 0, SPIF_SENDCHANGE);
static void assert_no_error()
If there is an SDL error, print it and assert(false)
GLenum GLsizei const GLuint GLboolean enabled
DECLSPEC void SDLCALL SDL_Quit(void)
typedef UINT(WINAPI *PFNWGLGETCONTEXTGPUIDAMDPROC)(HGLRC hglrc)
DECLSPEC const char *SDLCALL SDL_GetError(void)
#define SDL_VERSION_ATLEAST(X, Y, Z)
void set_screen_saver(const bool &enabled)
Enable/Disable the screen saver.
bool is_screen_saver_enabled()
Check to see if the screen saver is enabled.
DECLSPEC SDL_bool SDLCALL SDL_IsScreenSaverEnabled(void)
Returns whether the screensaver is currently enabled (default on).
DECLSPEC void SDLCALL SDL_EnableScreenSaver(void)
Allow the screen to be blanked by a screensaver.
DECLSPEC void SDLCALL SDL_ClearError(void)
static bool print_error()
If there is an SDL error, print it and then clear it; returns true iff there was an error...
Core & get_Core()
Get access to the singleton.
DECLSPEC void SDLCALL SDL_DisableScreenSaver(void)
Prevent the screen from being blanked by a screensaver.
DECLSPEC int SDLCALL SDL_Init(Uint32 flags)
File_Ops & get_File_Ops()
Get access to the singleton.
typedef BOOL(WINAPI *PFNWGLSETSTEREOEMITTERSTATE3DLPROC)(HDC hDC