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" 49 static int UIKit_VideoInit(
_THIS);
50 static void UIKit_VideoQuit(
_THIS);
85 device->
driverdata = (
void *) CFBridgingRetain(data);
105 #if SDL_IPHONE_KEYBOARD 125 device->
free = UIKit_DeleteDevice;
131 = UIKit_Vulkan_GetInstanceExtensions;
143 UIKITVID_DRIVER_NAME,
"SDL UIKit video driver",
144 UIKit_Available, UIKit_CreateDevice
149 UIKit_VideoInit(
_THIS)
160 UIKit_VideoQuit(
_THIS)
172 UIApplication *app = [UIApplication sharedApplication];
183 return [[UIDevice currentDevice].systemVersion doubleValue] >= version;
189 CGRect
frame = screen.bounds;
191 #if !TARGET_OS_TV && (__IPHONE_OS_VERSION_MIN_REQUIRED < __IPHONE_7_0) 196 frame = screen.applicationFrame;
210 UIInterfaceOrientation orient = [UIApplication sharedApplication].statusBarOrientation;
211 BOOL isLandscape = UIInterfaceOrientationIsLandscape(orient);
213 if (isLandscape != (frame.size.width > frame.size.height)) {
214 float height = frame.size.width;
215 frame.size.width = frame.size.height;
216 frame.size.height =
height;
231 void SDL_NSLog(
const char *
text)
int(* Vulkan_LoadLibrary)(_THIS, const char *path)
int UIKit_InitModes(_THIS)
SDL_bool UIKit_IsSystemVersionAtLeast(double version)
void UIKit_QuitModes(_THIS)
void UIKit_PumpEvents(_THIS)
void UIKit_SuspendScreenSaver(_THIS)
SDL_bool UIKit_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
int UIKit_CreateWindow(_THIS, SDL_Window *window)
void UIKit_DestroyWindow(_THIS, SDL_Window *window)
SDL_bool(* IsScreenKeyboardShown)(_THIS, SDL_Window *window)
void UIKit_GL_DeleteContext(_THIS, SDL_GLContext context)
void UIKit_GL_GetDrawableSize(_THIS, SDL_Window *window, int *w, int *h)
void(* ShowWindow)(_THIS, SDL_Window *window)
void UIKit_SetWindowTitle(_THIS, SDL_Window *window)
void UIKit_RaiseWindow(_THIS, SDL_Window *window)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
void UIKit_HideWindow(_THIS, SDL_Window *window)
void UIKit_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered)
int UIKit_GL_LoadLibrary(_THIS, const char *path)
void UIKit_GetDisplayModes(_THIS, SDL_VideoDisplay *display)
int(* GL_LoadLibrary)(_THIS, const char *path)
int UIKit_GL_SwapWindow(_THIS, SDL_Window *window)
int(* SetDisplayMode)(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
#define SDL_GetHintBoolean
void(* SetWindowBordered)(_THIS, SDL_Window *window, SDL_bool bordered)
void(* GL_GetDrawableSize)(_THIS, SDL_Window *window, int *w, int *h)
static SDL_VideoDevice * _this
void(* HideWindow)(_THIS, SDL_Window *window)
static SDL_AudioDeviceID device
void(* RaiseWindow)(_THIS, SDL_Window *window)
void(* SetTextInputRect)(_THIS, SDL_Rect *rect)
SDL_bool(* Vulkan_GetInstanceExtensions)(_THIS, SDL_Window *window, unsigned *count, const char **names)
SDL_bool(* GetWindowWMInfo)(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
SDL_GLContext(* GL_CreateContext)(_THIS, SDL_Window *window)
void(* Vulkan_GetDrawableSize)(_THIS, SDL_Window *window, int *w, int *h)
void UIKit_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
SDL_bool(* Vulkan_CreateSurface)(_THIS, SDL_Window *window, VkInstance instance, VkSurfaceKHR *surface)
int(* GL_MakeCurrent)(_THIS, SDL_Window *window, SDL_GLContext context)
void(* Vulkan_UnloadLibrary)(_THIS)
void(* DestroyWindow)(_THIS, SDL_Window *window)
BOOL(WINAPI *CloseTouchInputHandle)(HTOUCHINPUT)
#define SDL_HINT_IDLE_TIMER_DISABLED
A variable controlling whether the idle timer is disabled on iOS.
SDL_bool(* HasScreenKeyboardSupport)(_THIS)
SDL_GLContext UIKit_GL_CreateContext(_THIS, SDL_Window *window)
void * UIKit_GL_GetProcAddress(_THIS, const char *proc)
void(* GetDisplayModes)(_THIS, SDL_VideoDisplay *display)
int UIKit_GetDisplayUsableBounds(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect)
int(* CreateSDLWindow)(_THIS, SDL_Window *window)
#define SDL_OutOfMemory()
static char text[MAX_TEXT_LENGTH]
GLint GLint GLsizei GLsizei height
EGLSurface EGLNativeWindowType * window
int(* GL_SwapWindow)(_THIS, SDL_Window *window)
void(* ShowScreenKeyboard)(_THIS, SDL_Window *window)
The type used to identify a window.
SDL_bool(* HasClipboardText)(_THIS)
SDL_bool suspend_screensaver
void(* SetWindowFullscreen)(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
VideoBootStrap UIKIT_bootstrap
struct SDL_VideoDevice::@34 gl_config
void(* GL_DeleteContext)(_THIS, SDL_GLContext context)
char *(* GetClipboardText)(_THIS)
void(* SetWindowTitle)(_THIS, SDL_Window *window)
int(* GetDisplayUsableBounds)(_THIS, SDL_VideoDisplay *display, SDL_Rect *rect)
int(* SetClipboardText)(_THIS, const char *text)
void UIKit_ShowWindow(_THIS, SDL_Window *window)
void(* SuspendScreenSaver)(_THIS)
int UIKit_GL_MakeCurrent(_THIS, SDL_Window *window, SDL_GLContext context)
int UIKit_SetClipboardText(_THIS, const char *text)
void *(* GL_GetProcAddress)(_THIS, const char *proc)
void(* PumpEvents)(_THIS)
void(* HideScreenKeyboard)(_THIS, SDL_Window *window)
char * UIKit_GetClipboardText(_THIS)
int UIKit_SetDisplayMode(_THIS, SDL_VideoDisplay *display, SDL_DisplayMode *mode)
SDL_bool UIKit_HasClipboardText(_THIS)