21#include "../../SDL_internal.h"
23#if SDL_VIDEO_DRIVER_UIKIT
25#import <UIKit/UIKit.h>
30#include "../SDL_sysvideo.h"
31#include "../SDL_pixels_c.h"
32#include "../../events/SDL_events_c.h"
42#define UIKITVID_DRIVER_NAME "uikit"
49static int UIKit_VideoInit(
_THIS);
50static void UIKit_VideoQuit(
_THIS);
63 CFRelease(
device->driverdata);
85 device->driverdata = (
void *) CFBridgingRetain(
data);
88 device->VideoInit = UIKit_VideoInit;
89 device->VideoQuit = UIKit_VideoQuit;
105#if SDL_IPHONE_KEYBOARD
106 device->HasScreenKeyboardSupport = UIKit_HasScreenKeyboardSupport;
107 device->ShowScreenKeyboard = UIKit_ShowScreenKeyboard;
108 device->HideScreenKeyboard = UIKit_HideScreenKeyboard;
109 device->IsScreenKeyboardShown = UIKit_IsScreenKeyboardShown;
110 device->SetTextInputRect = UIKit_SetTextInputRect;
125 device->free = UIKit_DeleteDevice;
128 device->Vulkan_LoadLibrary = UIKit_Vulkan_LoadLibrary;
129 device->Vulkan_UnloadLibrary = UIKit_Vulkan_UnloadLibrary;
130 device->Vulkan_GetInstanceExtensions
131 = UIKit_Vulkan_GetInstanceExtensions;
132 device->Vulkan_CreateSurface = UIKit_Vulkan_CreateSurface;
133 device->Vulkan_GetDrawableSize = UIKit_Vulkan_GetDrawableSize;
136 device->gl_config.accelerated = 1;
143 UIKITVID_DRIVER_NAME,
"SDL UIKit video driver",
144 UIKit_Available, UIKit_CreateDevice
149UIKit_VideoInit(
_THIS)
160UIKit_VideoQuit(
_THIS)
172 UIApplication *app = [UIApplication sharedApplication];
183 return [[UIDevice currentDevice].systemVersion doubleValue] >= version;
191#if !TARGET_OS_TV && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0)
210 UIInterfaceOrientation orient = [UIApplication sharedApplication].statusBarOrientation;
211 BOOL isLandscape = UIInterfaceOrientationIsLandscape(orient);
213 if (isLandscape != (
frame.size.width >
frame.size.height)) {
233#pragma clang diagnostic push
234#pragma clang diagnostic ignored "-Wunguarded-availability-new"
235 if ([
data.viewcontroller respondsToSelector:
@selector(setNeedsUpdateOfHomeIndicatorAutoHidden)]) {
236 [data.viewcontroller performSelectorOnMainThread:@selector(setNeedsUpdateOfHomeIndicatorAutoHidden) withObject:nil waitUntilDone:NO];
237 [data.viewcontroller performSelectorOnMainThread:@selector(setNeedsUpdateOfScreenEdgesDeferringSystemGestures) withObject:nil waitUntilDone:NO];
239#pragma clang diagnostic pop
256#if !defined(SDL_VIDEO_DRIVER_COCOA)
257void SDL_NSLog(
const char *
text)
271 return (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad);
#define SDL_GetHintBoolean
#define SDL_OutOfMemory()
#define SDL_HINT_IDLE_TIMER_DISABLED
A variable controlling whether the idle timer is disabled on iOS.
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
VideoBootStrap UIKIT_bootstrap
SDL_Window * SDL_GetFocusWindow(void)
char * UIKit_GetClipboardText(_THIS)
SDL_bool UIKit_HasClipboardText(_THIS)
int UIKit_SetClipboardText(_THIS, const char *text)
void UIKit_PumpEvents(_THIS)
void UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay *display)
void UIKit_QuitModes(_THIS)
int UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
int UIKit_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect)
int UIKit_InitModes(_THIS)
int UIKit_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context)
SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window *window)
int UIKit_GL_LoadLibrary(_THIS, const char *path)
void UIKit_GL_GetDrawableSize(_THIS, SDL_Window *window, int *w, int *h)
void * UIKit_GL_GetProcAddress(_THIS, const char *proc)
void UIKit_GL_DeleteContext(_THIS, SDL_GLContext context)
int UIKit_GL_SwapWindow(_THIS, SDL_Window *window)
void UIKit_ForceUpdateHomeIndicator(void)
void UIKit_SuspendScreenSaver(_THIS)
SDL_bool UIKit_IsSystemVersionAtLeast(double version)
void UIKit_ShowWindow(_THIS, SDL_Window *window)
void UIKit_RaiseWindow(_THIS, SDL_Window *window)
SDL_bool UIKit_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
void UIKit_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered)
void UIKit_SetWindowTitle(_THIS, SDL_Window *window)
void UIKit_DestroyWindow(_THIS, SDL_Window *window)
void UIKit_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
int UIKit_CreateWindow(_THIS, SDL_Window *window)
void UIKit_HideWindow(_THIS, SDL_Window *window)
static SDL_VideoDevice * _this
EGLSurface EGLNativeWindowType * window
static SDL_AudioDeviceID device
BOOL(WINAPI *CloseTouchInputHandle)(HTOUCHINPUT)
SDL_bool suspend_screensaver
struct SDL_VideoDevice::@262 gl_config
The type used to identify a window.
static char text[MAX_TEXT_LENGTH]