SDL  2.0
SDL_uikitwindow.m
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2020 Sam Lantinga <slouken@libsdl.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 #include "../../SDL_internal.h"
22 
23 #if SDL_VIDEO_DRIVER_UIKIT
24 
25 #include "SDL_syswm.h"
26 #include "SDL_video.h"
27 #include "SDL_mouse.h"
28 #include "SDL_assert.h"
29 #include "SDL_hints.h"
30 #include "../SDL_sysvideo.h"
31 #include "../SDL_pixels_c.h"
32 #include "../../events/SDL_events_c.h"
33 
34 #include "SDL_uikitvideo.h"
35 #include "SDL_uikitevents.h"
36 #include "SDL_uikitmodes.h"
37 #include "SDL_uikitwindow.h"
38 #import "SDL_uikitappdelegate.h"
39 
40 #import "SDL_uikitview.h"
41 #import "SDL_uikitopenglview.h"
42 
43 #include <Foundation/Foundation.h>
44 
45 @implementation SDL_WindowData
46 
47 @synthesize uiwindow;
48 @synthesize viewcontroller;
49 @synthesize views;
50 
51 - (instancetype)init
52 {
53  if ((self = [super init])) {
54  views = [NSMutableArray new];
55  }
56 
57  return self;
58 }
59 
60 @end
61 
62 @interface SDL_uikitwindow : UIWindow
63 
64 - (void)layoutSubviews;
65 
66 @end
67 
68 @implementation SDL_uikitwindow
69 
70 - (void)layoutSubviews
71 {
72  /* Workaround to fix window orientation issues in iOS 8. */
73  /* As of July 1 2019, I haven't been able to reproduce any orientation
74  * issues with this disabled on iOS 12. The issue this is meant to fix might
75  * only happen on iOS 8, or it might have been fixed another way with other
76  * code... This code prevents split view (iOS 9+) from working on iPads, so
77  * we want to avoid using it if possible. */
78  if (!UIKit_IsSystemVersionAtLeast(9.0)) {
79  self.frame = self.screen.bounds;
80  }
81  [super layoutSubviews];
82 }
83 
84 @end
85 
86 
87 static int
88 SetupWindowData(_THIS, SDL_Window *window, UIWindow *uiwindow, SDL_bool created)
89 {
91  SDL_DisplayData *displaydata = (__bridge SDL_DisplayData *) display->driverdata;
92  SDL_uikitview *view;
93 
94  CGRect frame = UIKit_ComputeViewFrame(window, displaydata.uiscreen);
95  int width = (int) frame.size.width;
96  int height = (int) frame.size.height;
97 
98  SDL_WindowData *data = [[SDL_WindowData alloc] init];
99  if (!data) {
100  return SDL_OutOfMemory();
101  }
102 
103  window->driverdata = (void *) CFBridgingRetain(data);
104 
105  data.uiwindow = uiwindow;
106 
107  /* only one window on iOS, always shown */
108  window->flags &= ~SDL_WINDOW_HIDDEN;
109 
110  if (displaydata.uiscreen != [UIScreen mainScreen]) {
111  window->flags &= ~SDL_WINDOW_RESIZABLE; /* window is NEVER resizable */
112  window->flags &= ~SDL_WINDOW_INPUT_FOCUS; /* never has input focus */
113  window->flags |= SDL_WINDOW_BORDERLESS; /* never has a status bar. */
114  }
115 
116 #if !TARGET_OS_TV
117  if (displaydata.uiscreen == [UIScreen mainScreen]) {
118  /* SDL_CreateWindow sets the window w&h to the display's bounds if the
119  * fullscreen flag is set. But the display bounds orientation might not
120  * match what we want, and GetSupportedOrientations call below uses the
121  * window w&h. They're overridden below anyway, so we'll just set them
122  * to the requested size for the purposes of determining orientation. */
123  window->w = window->windowed.w;
124  window->h = window->windowed.h;
125 
126  NSUInteger orients = UIKit_GetSupportedOrientations(window);
127  BOOL supportsLandscape = (orients & UIInterfaceOrientationMaskLandscape) != 0;
128  BOOL supportsPortrait = (orients & (UIInterfaceOrientationMaskPortrait|UIInterfaceOrientationMaskPortraitUpsideDown)) != 0;
129 
130  /* Make sure the width/height are oriented correctly */
131  if ((width > height && !supportsLandscape) || (height > width && !supportsPortrait)) {
132  int temp = width;
133  width = height;
134  height = temp;
135  }
136  }
137 #endif /* !TARGET_OS_TV */
138 
139  window->x = 0;
140  window->y = 0;
141  window->w = width;
142  window->h = height;
143 
144  /* The View Controller will handle rotating the view when the device
145  * orientation changes. This will trigger resize events, if appropriate. */
146  data.viewcontroller = [[SDL_uikitviewcontroller alloc] initWithSDLWindow:window];
147 
148  /* The window will initially contain a generic view so resizes, touch events,
149  * etc. can be handled without an active OpenGL view/context. */
150  view = [[SDL_uikitview alloc] initWithFrame:frame];
151 
152  /* Sets this view as the controller's view, and adds the view to the window
153  * heirarchy. */
154  [view setSDLWindow:window];
155 
156  return 0;
157 }
158 
159 int
161 {
162  @autoreleasepool {
164  SDL_DisplayData *data = (__bridge SDL_DisplayData *) display->driverdata;
165 
166  /* SDL currently puts this window at the start of display's linked list. We rely on this. */
168 
169  /* We currently only handle a single window per display on iOS */
170  if (window->next != NULL) {
171  return SDL_SetError("Only one window allowed per display.");
172  }
173 
174  /* If monitor has a resolution of 0x0 (hasn't been explicitly set by the
175  * user, so it's in standby), try to force the display to a resolution
176  * that most closely matches the desired window size. */
177 #if !TARGET_OS_TV
178  const CGSize origsize = data.uiscreen.currentMode.size;
179  if ((origsize.width == 0.0f) && (origsize.height == 0.0f)) {
180  if (display->num_display_modes == 0) {
181  _this->GetDisplayModes(_this, display);
182  }
183 
184  int i;
185  const SDL_DisplayMode *bestmode = NULL;
186  for (i = display->num_display_modes; i >= 0; i--) {
187  const SDL_DisplayMode *mode = &display->display_modes[i];
188  if ((mode->w >= window->w) && (mode->h >= window->h)) {
189  bestmode = mode;
190  }
191  }
192 
193  if (bestmode) {
194  SDL_DisplayModeData *modedata = (__bridge SDL_DisplayModeData *)bestmode->driverdata;
195  [data.uiscreen setCurrentMode:modedata.uiscreenmode];
196 
197  /* desktop_mode doesn't change here (the higher level will
198  * use it to set all the screens back to their defaults
199  * upon window destruction, SDL_Quit(), etc. */
200  display->current_mode = *bestmode;
201  }
202  }
203 
204  if (data.uiscreen == [UIScreen mainScreen]) {
206  [UIApplication sharedApplication].statusBarHidden = YES;
207  } else {
208  [UIApplication sharedApplication].statusBarHidden = NO;
209  }
210  }
211 #endif /* !TARGET_OS_TV */
212 
213  /* ignore the size user requested, and make a fullscreen window */
214  /* !!! FIXME: can we have a smaller view? */
215  UIWindow *uiwindow = [[SDL_uikitwindow alloc] initWithFrame:data.uiscreen.bounds];
216 
217  /* put the window on an external display if appropriate. */
218  if (data.uiscreen != [UIScreen mainScreen]) {
219  [uiwindow setScreen:data.uiscreen];
220  }
221 
222  if (SetupWindowData(_this, window, uiwindow, SDL_TRUE) < 0) {
223  return -1;
224  }
225  }
226 
227  return 1;
228 }
229 
230 void
232 {
233  @autoreleasepool {
234  SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata;
235  data.viewcontroller.title = @(window->title);
236  }
237 }
238 
239 void
241 {
242  @autoreleasepool {
243  SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata;
244  [data.uiwindow makeKeyAndVisible];
245 
246  /* Make this window the current mouse focus for touch input */
248  SDL_DisplayData *displaydata = (__bridge SDL_DisplayData *) display->driverdata;
249  if (displaydata.uiscreen == [UIScreen mainScreen]) {
252  }
253  }
254 }
255 
256 void
258 {
259  @autoreleasepool {
260  SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata;
261  data.uiwindow.hidden = YES;
262  }
263 }
264 
265 void
267 {
268  /* We don't currently offer a concept of "raising" the SDL window, since
269  * we only allow one per display, in the iOS fashion.
270  * However, we use this entry point to rebind the context to the view
271  * during OnWindowRestored processing. */
273 }
274 
275 static void
276 UIKit_UpdateWindowBorder(_THIS, SDL_Window * window)
277 {
278  SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata;
279  SDL_uikitviewcontroller *viewcontroller = data.viewcontroller;
280 
281 #if !TARGET_OS_TV
282  if (data.uiwindow.screen == [UIScreen mainScreen]) {
284  [UIApplication sharedApplication].statusBarHidden = YES;
285  } else {
286  [UIApplication sharedApplication].statusBarHidden = NO;
287  }
288 
289  /* iOS 7+ won't update the status bar until we tell it to. */
290  if ([viewcontroller respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)]) {
291  [viewcontroller setNeedsStatusBarAppearanceUpdate];
292  }
293  }
294 
295  /* Update the view's frame to account for the status bar change. */
296  viewcontroller.view.frame = UIKit_ComputeViewFrame(window, data.uiwindow.screen);
297 #endif /* !TARGET_OS_TV */
298 
299 #ifdef SDL_IPHONE_KEYBOARD
300  /* Make sure the view is offset correctly when the keyboard is visible. */
301  [viewcontroller updateKeyboard];
302 #endif
303 
304  [viewcontroller.view setNeedsLayout];
305  [viewcontroller.view layoutIfNeeded];
306 }
307 
308 void
310 {
311  @autoreleasepool {
312  UIKit_UpdateWindowBorder(_this, window);
313  }
314 }
315 
316 void
318 {
319  @autoreleasepool {
320  UIKit_UpdateWindowBorder(_this, window);
321  }
322 }
323 
324 void
326 {
327  @autoreleasepool {
328  if (window->driverdata != NULL) {
329  SDL_WindowData *data = (SDL_WindowData *) CFBridgingRelease(window->driverdata);
330  NSArray *views = nil;
331 
332  [data.viewcontroller stopAnimation];
333 
334  /* Detach all views from this window. We use a copy of the array
335  * because setSDLWindow will remove the object from the original
336  * array, which would be undesirable if we were iterating over it. */
337  views = [data.views copy];
338  for (SDL_uikitview *view in views) {
339  [view setSDLWindow:NULL];
340  }
341 
342  /* iOS may still hold a reference to the window after we release it.
343  * We want to make sure the SDL view controller isn't accessed in
344  * that case, because it would contain an invalid pointer to the old
345  * SDL window. */
346  data.uiwindow.rootViewController = nil;
347  data.uiwindow.hidden = YES;
348  }
349  }
350  window->driverdata = NULL;
351 }
352 
353 SDL_bool
355 {
356  @autoreleasepool {
357  SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata;
358 
359  if (info->version.major <= SDL_MAJOR_VERSION) {
360  int versionnum = SDL_VERSIONNUM(info->version.major, info->version.minor, info->version.patch);
361 
362  info->subsystem = SDL_SYSWM_UIKIT;
363  info->info.uikit.window = data.uiwindow;
364 
365  /* These struct members were added in SDL 2.0.4. */
366  if (versionnum >= SDL_VERSIONNUM(2,0,4)) {
367 #if SDL_VIDEO_OPENGL_ES || SDL_VIDEO_OPENGL_ES2
368  if ([data.viewcontroller.view isKindOfClass:[SDL_uikitopenglview class]]) {
369  SDL_uikitopenglview *glview = (SDL_uikitopenglview *)data.viewcontroller.view;
370  info->info.uikit.framebuffer = glview.drawableFramebuffer;
371  info->info.uikit.colorbuffer = glview.drawableRenderbuffer;
372  info->info.uikit.resolveFramebuffer = glview.msaaResolveFramebuffer;
373  } else {
374 #else
375  {
376 #endif
377  info->info.uikit.framebuffer = 0;
378  info->info.uikit.colorbuffer = 0;
379  info->info.uikit.resolveFramebuffer = 0;
380  }
381  }
382 
383  return SDL_TRUE;
384  } else {
385  SDL_SetError("Application not compiled with SDL %d.%d",
387  return SDL_FALSE;
388  }
389  }
390 }
391 
392 #if !TARGET_OS_TV
393 NSUInteger
395 {
396  const char *hint = SDL_GetHint(SDL_HINT_ORIENTATIONS);
397  NSUInteger validOrientations = UIInterfaceOrientationMaskAll;
398  NSUInteger orientationMask = 0;
399 
400  @autoreleasepool {
401  SDL_WindowData *data = (__bridge SDL_WindowData *) window->driverdata;
402  UIApplication *app = [UIApplication sharedApplication];
403 
404  /* Get all possible valid orientations. If the app delegate doesn't tell
405  * us, we get the orientations from Info.plist via UIApplication. */
406  if ([app.delegate respondsToSelector:@selector(application:supportedInterfaceOrientationsForWindow:)]) {
407  validOrientations = [app.delegate application:app supportedInterfaceOrientationsForWindow:data.uiwindow];
408  } else if ([app respondsToSelector:@selector(supportedInterfaceOrientationsForWindow:)]) {
409  validOrientations = [app supportedInterfaceOrientationsForWindow:data.uiwindow];
410  }
411 
412  if (hint != NULL) {
413  NSArray *orientations = [@(hint) componentsSeparatedByString:@" "];
414 
415  if ([orientations containsObject:@"LandscapeLeft"]) {
416  orientationMask |= UIInterfaceOrientationMaskLandscapeLeft;
417  }
418  if ([orientations containsObject:@"LandscapeRight"]) {
419  orientationMask |= UIInterfaceOrientationMaskLandscapeRight;
420  }
421  if ([orientations containsObject:@"Portrait"]) {
422  orientationMask |= UIInterfaceOrientationMaskPortrait;
423  }
424  if ([orientations containsObject:@"PortraitUpsideDown"]) {
425  orientationMask |= UIInterfaceOrientationMaskPortraitUpsideDown;
426  }
427  }
428 
429  if (orientationMask == 0 && (window->flags & SDL_WINDOW_RESIZABLE)) {
430  /* any orientation is okay. */
431  orientationMask = UIInterfaceOrientationMaskAll;
432  }
433 
434  if (orientationMask == 0) {
435  if (window->w >= window->h) {
436  orientationMask |= UIInterfaceOrientationMaskLandscape;
437  }
438  if (window->h >= window->w) {
439  orientationMask |= (UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskPortraitUpsideDown);
440  }
441  }
442 
443  /* Don't allow upside-down orientation on phones, so answering calls is in the natural orientation */
444  if ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone) {
445  orientationMask &= ~UIInterfaceOrientationMaskPortraitUpsideDown;
446  }
447 
448  /* If none of the specified orientations are actually supported by the
449  * app, we'll revert to what the app supports. An exception would be
450  * thrown by the system otherwise. */
451  if ((validOrientations & orientationMask) == 0) {
452  orientationMask = validOrientations;
453  }
454  }
455 
456  return orientationMask;
457 }
458 #endif /* !TARGET_OS_TV */
459 
460 int
461 SDL_iPhoneSetAnimationCallback(SDL_Window * window, int interval, void (*callback)(void*), void *callbackParam)
462 {
463  if (!window || !window->driverdata) {
464  return SDL_SetError("Invalid window");
465  }
466 
467  @autoreleasepool {
468  SDL_WindowData *data = (__bridge SDL_WindowData *)window->driverdata;
469  [data.viewcontroller setAnimationCallback:interval
471  callbackParam:callbackParam];
472  }
473 
474  return 0;
475 }
476 
477 #endif /* SDL_VIDEO_DRIVER_UIKIT */
478 
479 /* vi: set ts=4 sw=4 expandtab: */
SDL_uikitmodes.h
SDL_VideoDisplay::display_modes
SDL_DisplayMode * display_modes
Definition: SDL_sysvideo.h:131
SDL_uikitvideo.h
in
GLuint in
Definition: SDL_opengl_glext.h:7943
SDL_mouse.h
if
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 &reg2 endm macro vzip8 reg2 vzip d d &reg2 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
Definition: pixman-arm-neon-asm.h:469
UIKit_SetWindowFullscreen
void UIKit_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
NULL
#define NULL
Definition: begin_code.h:167
width
GLint GLint GLsizei width
Definition: SDL_opengl.h:1572
mode
GLenum mode
Definition: SDL_opengl_glext.h:1125
SDL_SysWMinfo
Definition: SDL_syswm.h:202
UIKit_GetWindowWMInfo
SDL_bool UIKit_GetWindowWMInfo(_THIS, SDL_Window *window, struct SDL_SysWMinfo *info)
SDL_WindowData
Definition: SDL_androidwindow.h:39
SDL_version::minor
Uint8 minor
Definition: SDL_version.h:54
SDL_GetDisplayForWindow
SDL_VideoDisplay * SDL_GetDisplayForWindow(SDL_Window *window)
Definition: SDL_video.c:1110
SDL_WINDOW_FULLSCREEN
@ SDL_WINDOW_FULLSCREEN
Definition: SDL_video.h:99
SDL_SysWMinfo::window
Window window
Definition: SDL_syswm.h:225
SDL_SetKeyboardFocus
void SDL_SetKeyboardFocus(SDL_Window *window)
Definition: SDL_keyboard.c:630
callback
static Uint32 callback(Uint32 interval, void *param)
Definition: testtimer.c:34
SDL_VERSIONNUM
#define SDL_VERSIONNUM(X, Y, Z)
Definition: SDL_version.h:94
SDL_GetHint
#define SDL_GetHint
Definition: SDL_dynapi_overrides.h:191
UIKit_SetWindowTitle
void UIKit_SetWindowTitle(_THIS, SDL_Window *window)
SDL_SetMouseFocus
void SDL_SetMouseFocus(SDL_Window *window)
Definition: SDL_mouse.c:203
SDL_WINDOW_INPUT_FOCUS
@ SDL_WINDOW_INPUT_FOCUS
Definition: SDL_video.h:108
SDL_WINDOW_RESIZABLE
@ SDL_WINDOW_RESIZABLE
Definition: SDL_video.h:104
data
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: SDL_opengl.h:1974
SDL_Window
The type used to identify a window.
Definition: SDL_sysvideo.h:75
SDL_DisplayMode
The structure that defines a display mode.
Definition: SDL_video.h:54
SDL_DisplayModeData::uiscreenmode
UIScreenMode * uiscreenmode
Definition: SDL_uikitmodes.h:39
SDL_uikitview.h
UIKit_DestroyWindow
void UIKit_DestroyWindow(_THIS, SDL_Window *window)
SDL_WindowData::viewcontroller
SDL_uikitviewcontroller * viewcontroller
Definition: SDL_uikitwindow.h:47
_this
static SDL_VideoDevice * _this
Definition: SDL_video.c:121
SDL_MINOR_VERSION
#define SDL_MINOR_VERSION
Definition: SDL_version.h:61
SDL_SysWMinfo::subsystem
SDL_SYSWM_TYPE subsystem
Definition: SDL_syswm.h:204
window
EGLSurface EGLNativeWindowType * window
Definition: eglext.h:1025
UIKit_SetWindowBordered
void UIKit_SetWindowBordered(_THIS, SDL_Window *window, SDL_bool bordered)
SDL_uikitevents.h
UIKit_CreateWindow
int UIKit_CreateWindow(_THIS, SDL_Window *window)
UIKit_RaiseWindow
void UIKit_RaiseWindow(_THIS, SDL_Window *window)
height
GLint GLint GLsizei GLsizei height
Definition: SDL_opengl.h:1572
SDL_uikitopenglview.h
SDL_VideoDevice::GetDisplayModes
void(* GetDisplayModes)(_THIS, SDL_VideoDisplay *display)
Definition: SDL_sysvideo.h:198
UIKit_HideWindow
void UIKit_HideWindow(_THIS, SDL_Window *window)
frame
int frame
Definition: teststreaming.c:60
SDL_assert.h
SDL_WindowData::uiwindow
UIWindow * uiwindow
Definition: SDL_uikitwindow.h:46
_THIS
#define _THIS
Definition: SDL_alsa_audio.h:31
SDL_SYSWM_UIKIT
@ SDL_SYSWM_UIKIT
Definition: SDL_syswm.h:129
SDL_TRUE
@ SDL_TRUE
Definition: SDL_stdinc.h:164
SDL_assert
#define SDL_assert(condition)
Definition: SDL_assert.h:169
SDL_VideoDisplay::driverdata
void * driverdata
Definition: SDL_sysvideo.h:140
SDL_DisplayData
Definition: SDL_cocoamodes.h:27
SDL_OutOfMemory
#define SDL_OutOfMemory()
Definition: SDL_error.h:52
SDL_uikitwindow.h
SDL_DisplayData::uiscreen
UIScreen * uiscreen
Definition: SDL_uikitmodes.h:32
SDL_VideoDisplay::num_display_modes
int num_display_modes
Definition: SDL_sysvideo.h:130
SDL_WINDOW_HIDDEN
@ SDL_WINDOW_HIDDEN
Definition: SDL_video.h:102
SDL_SysWMinfo::version
SDL_version version
Definition: SDL_syswm.h:203
UIKit_IsSystemVersionAtLeast
SDL_bool UIKit_IsSystemVersionAtLeast(double version)
SDL_HINT_ORIENTATIONS
#define SDL_HINT_ORIENTATIONS
A variable controlling which orientations are allowed on iOS/Android.
Definition: SDL_hints.h:392
SDL_VideoDisplay
Definition: SDL_sysvideo.h:127
SDL_SetError
#define SDL_SetError
Definition: SDL_dynapi_overrides.h:30
SDL_VideoDevice::GL_MakeCurrent
int(* GL_MakeCurrent)(_THIS, SDL_Window *window, SDL_GLContext context)
Definition: SDL_sysvideo.h:260
UIKit_ShowWindow
void UIKit_ShowWindow(_THIS, SDL_Window *window)
SDL_hints.h
SDL_VideoDevice::current_glwin
SDL_Window * current_glwin
Definition: SDL_sysvideo.h:371
SDL_uikitview
Definition: SDL_uikitview.h:29
SDL_SysWMinfo::info
union SDL_SysWMinfo::@10 info
SDL_bool
SDL_bool
Definition: SDL_stdinc.h:162
SDL_video.h
SDL_uikitappdelegate.h
SDL_DisplayMode::driverdata
void * driverdata
Definition: SDL_video.h:59
SDL_FALSE
@ SDL_FALSE
Definition: SDL_stdinc.h:163
SDL_VideoDisplay::current_mode
SDL_DisplayMode current_mode
Definition: SDL_sysvideo.h:133
SDL_version::patch
Uint8 patch
Definition: SDL_version.h:55
SDL_DisplayModeData
Definition: SDL_cocoamodes.h:32
void
SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char int SDL_PRINTF_FORMAT_STRING const char const char SDL_SCANF_FORMAT_STRING const char return SDL_ThreadFunction const char void return Uint32 return Uint32 void
Definition: SDL_dynapi_procs.h:89
SDL_version::major
Uint8 major
Definition: SDL_version.h:53
SDL_MAJOR_VERSION
#define SDL_MAJOR_VERSION
Definition: SDL_version.h:60
SDL_VideoDevice::current_glctx
SDL_GLContext current_glctx
Definition: SDL_sysvideo.h:372
SDL_iPhoneSetAnimationCallback
#define SDL_iPhoneSetAnimationCallback
Definition: SDL_dynapi_overrides.h:47
i
return Display return Display Bool Bool int int int return Display XEvent Bool(*) XPointer return Display return Display Drawable _Xconst char unsigned int unsigned int return Display Pixmap Pixmap XColor XColor unsigned int unsigned int return Display _Xconst char char int char return Display Visual unsigned int int int char unsigned int unsigned int in i)
Definition: SDL_x11sym.h:50
SDL_uikitviewcontroller
Definition: SDL_uikitviewcontroller.h:40
UIKit_GetSupportedOrientations
NSUInteger UIKit_GetSupportedOrientations(SDL_Window *window)
init
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 &reg2 endm macro vzip8 reg2 vzip d d &reg2 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 init[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 beq endif SRC MASK if dst_r_bpp DST_R else add endif PF add sub src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head pixblock_size cache_preload_simple process_pixblock_tail pixinterleave dst_w_basereg irp beq endif process_pixblock_tail_head tst beq irp if pixblock_size chunk_size tst beq pixld_src SRC pixld MASK if DST_R else pixld DST_R endif if src_basereg pixdeinterleave mask_basereg pixdeinterleave dst_r_basereg process_pixblock_head if pixblock_size cache_preload_simple endif process_pixblock_tail pixinterleave dst_w_basereg irp if pixblock_size chunk_size tst beq if DST_W else pixst DST_W else mov ORIG_W endif add lsl if lsl endif if lsl endif lsl endif lsl endif lsl endif subs mov DST_W if regs_shortage str endif bge start_of_loop_label endm macro generate_composite_function
Definition: pixman-arm-neon-asm.h:624
SDL_WindowData::views
NSMutableArray * views
Definition: SDL_uikitwindow.h:50
SDL_syswm.h
SDL_WINDOW_BORDERLESS
@ SDL_WINDOW_BORDERLESS
Definition: SDL_video.h:103
SDL_VideoDevice::windows
SDL_Window * windows
Definition: SDL_sysvideo.h:325