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"
43 #define UIKITVID_DRIVER_NAME "uikit"
50 static int UIKit_VideoInit(
_THIS);
51 static void UIKit_VideoQuit(
_THIS);
58 CFRelease(
device->driverdata);
80 device->driverdata = (
void *) CFBridgingRetain(
data);
83 device->VideoInit = UIKit_VideoInit;
84 device->VideoQuit = UIKit_VideoQuit;
101 #if SDL_IPHONE_KEYBOARD
102 device->HasScreenKeyboardSupport = UIKit_HasScreenKeyboardSupport;
103 device->ShowScreenKeyboard = UIKit_ShowScreenKeyboard;
104 device->HideScreenKeyboard = UIKit_HideScreenKeyboard;
105 device->IsScreenKeyboardShown = UIKit_IsScreenKeyboardShown;
106 device->SetTextInputRect = UIKit_SetTextInputRect;
114 #if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
115 device->GL_MakeCurrent = UIKit_GL_MakeCurrent;
116 device->GL_GetDrawableSize = UIKit_GL_GetDrawableSize;
117 device->GL_SwapWindow = UIKit_GL_SwapWindow;
118 device->GL_CreateContext = UIKit_GL_CreateContext;
119 device->GL_DeleteContext = UIKit_GL_DeleteContext;
120 device->GL_GetProcAddress = UIKit_GL_GetProcAddress;
121 device->GL_LoadLibrary = UIKit_GL_LoadLibrary;
123 device->free = UIKit_DeleteDevice;
126 device->Vulkan_LoadLibrary = UIKit_Vulkan_LoadLibrary;
127 device->Vulkan_UnloadLibrary = UIKit_Vulkan_UnloadLibrary;
128 device->Vulkan_GetInstanceExtensions
129 = UIKit_Vulkan_GetInstanceExtensions;
130 device->Vulkan_CreateSurface = UIKit_Vulkan_CreateSurface;
131 device->Vulkan_GetDrawableSize = UIKit_Vulkan_GetDrawableSize;
135 device->Metal_CreateView = UIKit_Metal_CreateView;
136 device->Metal_DestroyView = UIKit_Metal_DestroyView;
137 device->Metal_GetLayer = UIKit_Metal_GetLayer;
138 device->Metal_GetDrawableSize = UIKit_Metal_GetDrawableSize;
141 device->gl_config.accelerated = 1;
148 UIKITVID_DRIVER_NAME,
"SDL UIKit video driver",
154 UIKit_VideoInit(
_THIS)
169 UIKit_VideoQuit(
_THIS)
184 UIApplication *app = [UIApplication sharedApplication];
195 return [[UIDevice currentDevice].systemVersion doubleValue] >= version;
211 #if !TARGET_OS_TV && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0)
230 UIInterfaceOrientation orient = [UIApplication sharedApplication].statusBarOrientation;
231 BOOL landscape = UIInterfaceOrientationIsLandscape(orient);
236 if (fullscreen && (landscape != (
frame.size.width >
frame.size.height))) {
256 #pragma clang diagnostic push
257 #pragma clang diagnostic ignored "-Wunguarded-availability-new"
258 if ([
data.viewcontroller respondsToSelector:
@selector(setNeedsUpdateOfHomeIndicatorAutoHidden)]) {
259 [data.viewcontroller performSelectorOnMainThread:@selector(setNeedsUpdateOfHomeIndicatorAutoHidden) withObject:nil waitUntilDone:NO];
260 [data.viewcontroller performSelectorOnMainThread:@selector(setNeedsUpdateOfScreenEdgesDeferringSystemGestures) withObject:nil waitUntilDone:NO];
262 #pragma clang diagnostic pop
279 #if !defined(SDL_VIDEO_DRIVER_COCOA)
280 void SDL_NSLog(
const char *
text)
294 return ([UIDevice currentDevice].userInterfaceIdiom == 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 SDL_InitGCMouse(void)
void SDL_InitGCKeyboard(void)
void UIKit_PumpEvents(_THIS)
void SDL_QuitGCKeyboard(void)
void SDL_QuitGCMouse(void)
void UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay *display)
void UIKit_QuitModes(_THIS)
int UIKit_GetDisplayDPI(_THIS, SDL_VideoDisplay *display, float *ddpi, float *hdpi, float *vdpi)
int UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
int UIKit_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect)
int UIKit_InitModes(_THIS)
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
set set set set set set set macro pixldst1 abits if abits op else op endif endm macro pixldst2 abits if abits op else op endif endm macro pixldst4 abits if abits op else op endif endm macro pixldst0 abits op endm macro pixldst3 mem_operand op endm macro pixldst30 mem_operand op endm macro pixldst abits if abits elseif abits elseif abits elseif abits elseif abits pixldst0 abits else pixldst0 abits pixldst0 abits pixldst0 abits pixldst0 abits endif elseif abits else pixldst0 abits pixldst0 abits endif elseif abits else error unsupported bpp *numpix else pixst endif endm macro pixld1_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl mov asr adds SRC_WIDTH_FIXED bpl add asl else error unsupported endif endm macro pixld2_s mem_operand if mov asr add asl add asl mov asr sub UNIT_X add asl mov asr add asl add asl mov asr add UNIT_X add asl else pixld1_s mem_operand pixld1_s mem_operand endif endm macro pixld0_s mem_operand if asr adds SRC_WIDTH_FIXED bpl add asl elseif asr adds SRC_WIDTH_FIXED bpl add asl endif endm macro pixld_s_internal mem_operand if mem_operand pixld2_s mem_operand pixdeinterleave basereg elseif mem_operand elseif mem_operand elseif mem_operand elseif mem_operand pixld0_s mem_operand else pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else pixld0_s mem_operand pixld0_s mem_operand endif elseif mem_operand else error unsupported mem_operand if bpp mem_operand endif endm macro vuzp8 reg2 vuzp d d ®2 endm macro vzip8 reg2 vzip d d ®2 endm macro pixdeinterleave basereg basereg basereg basereg basereg endif endm macro pixinterleave basereg basereg basereg basereg basereg endif endm macro PF boost_increment endif if endif PF tst PF addne PF subne PF cmp ORIG_W if endif if endif if endif PF subge ORIG_W PF subges if endif if endif if endif endif endm macro cache_preload_simple endif if dst_r_bpp pld[DST_R, #(PREFETCH_DISTANCE_SIMPLE *dst_r_bpp/8)] endif if mask_bpp pld if[MASK, #(PREFETCH_DISTANCE_SIMPLE *mask_bpp/8)] endif endif endm macro fetch_mask_pixblock pixld mask_basereg pixblock_size MASK endm macro ensure_destination_ptr_alignment process_pixblock_tail_head if beq irp skip1(dst_w_bpp<=(lowbit *8)) &&((lowbit *8)<(pixblock_size *dst_w_bpp)) .if lowbit< 16 tst DST_R
BOOL(WINAPI *CloseTouchInputHandle)(HTOUCHINPUT)
struct SDL_VideoDevice::@440 gl_config
SDL_bool suspend_screensaver
The type used to identify a window.
static char text[MAX_TEXT_LENGTH]