|
@@ -26,6 +26,7 @@
|
|
|
|
|
|
#include "SDL_video.h"
|
|
|
#include "SDL_mouse.h"
|
|
|
+#include "SDL_hints.h"
|
|
|
#include "../SDL_sysvideo.h"
|
|
|
#include "../SDL_pixels_c.h"
|
|
|
#include "../../events/SDL_events_c.h"
|
|
@@ -74,6 +75,7 @@ UIKit_CreateDevice(int devindex)
|
|
|
device->GetDisplayModes = UIKit_GetDisplayModes;
|
|
|
device->SetDisplayMode = UIKit_SetDisplayMode;
|
|
|
device->PumpEvents = UIKit_PumpEvents;
|
|
|
+ device->SuspendScreenSaver = UIKit_SuspendScreenSaver;
|
|
|
device->CreateWindow = UIKit_CreateWindow;
|
|
|
device->SetWindowTitle = UIKit_SetWindowTitle;
|
|
|
device->ShowWindow = UIKit_ShowWindow;
|
|
@@ -130,6 +132,21 @@ UIKit_VideoQuit(_THIS)
|
|
|
UIKit_QuitModes(_this);
|
|
|
}
|
|
|
|
|
|
+void
|
|
|
+UIKit_SuspendScreenSaver(_THIS)
|
|
|
+{
|
|
|
+ @autoreleasepool {
|
|
|
+ /* Ignore ScreenSaver API calls if the idle timer hint has been set. */
|
|
|
+ /* FIXME: The idle timer hint should be deprecated for SDL 2.1. */
|
|
|
+ if (SDL_GetHint(SDL_HINT_IDLE_TIMER_DISABLED) == NULL) {
|
|
|
+ UIApplication *app = [UIApplication sharedApplication];
|
|
|
+
|
|
|
+ /* Prevent the display from dimming and going to sleep. */
|
|
|
+ app.idleTimerDisabled = (_this->suspend_screensaver != SDL_FALSE);
|
|
|
+ }
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
BOOL
|
|
|
UIKit_IsSystemVersionAtLeast(double version)
|
|
|
{
|