23 #if SDL_VIDEO_DRIVER_UIKIT
30 #include "../SDL_sysvideo.h"
31 #include "../SDL_pixels_c.h"
32 #include "../../events/SDL_events_c.h"
42 #include <Foundation/Foundation.h>
70 bounds = [displaydata->uiscreen bounds];
72 bounds = [displaydata->uiscreen applicationFrame];
76 int width = (
int)(bounds.size.width * displaymodedata->
scale);
99 if (displaydata->uiscreen == [UIScreen mainScreen]) {
102 if ([UIApplication sharedApplication].statusBarHidden) {
120 [data->viewcontroller setTitle:@"SDL App"];
130 const BOOL external = ([UIScreen mainScreen] != data->
uiscreen);
137 return SDL_SetError(
"Only one window allowed per display.");
145 const CGSize origsize = [[data->uiscreen currentMode] size];
146 if ((origsize.width == 0.0f) && (origsize.height == 0.0f)) {
155 if ((mode->
w >= window->
w) && (mode->
h >= window->
h))
172 if (data->
uiscreen == [UIScreen mainScreen]) {
174 [UIApplication sharedApplication].statusBarHidden = YES;
176 [UIApplication sharedApplication].statusBarHidden = NO;
181 if (window->
w > window->
h) {
183 [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight animated:NO];
185 }
else if (window->
w < window->
h) {
187 [[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait animated:NO];
194 UIWindow *uiwindow = [UIWindow alloc];
195 uiwindow = [uiwindow initWithFrame:[data->uiscreen bounds]];
203 [uiwindow setScreen:data->uiscreen];
206 if (SetupWindowData(
_this, window, uiwindow,
SDL_TRUE) < 0) {
220 [uiwindow makeKeyAndVisible];
228 uiwindow.hidden = YES;
250 [UIApplication sharedApplication].statusBarHidden = YES;
252 [UIApplication sharedApplication].statusBarHidden = NO;
257 bounds = [displaydata->uiscreen bounds];
259 bounds = [displaydata->uiscreen applicationFrame];
263 int width = (
int)(bounds.size.width * displaymodedata->
scale);
264 int height = (
int)(bounds.size.height * displaymodedata->
scale);
269 if (window->
w >= window->
h) {
270 if (width > height) {
278 if (width > height) {
293 [data->viewcontroller release];
294 [data->uiwindow release];
307 info->
info.uikit.window = uiwindow;
310 SDL_SetError(
"Application not compiled with SDL %d.%d\n",
317 SDL_iPhoneSetAnimationCallback(
SDL_Window * window,
int interval,
void (*callback)(
void*),
void *callbackParam)
321 if (!data || !data->
view) {
325 [data->view setAnimationCallback:interval callback:callback callbackParam:callbackParam];
void(* GetDisplayModes)(_THIS, SDL_VideoDisplay *display)
#define SDL_MINOR_VERSION
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)
int(* GL_MakeCurrent)(_THIS, SDL_Window *window, SDL_GLContext context)
#define SDL_MAJOR_VERSION
SDL_bool UIKit_IsDisplayLandscape(UIScreen *uiscreen)
SDL_uikitviewcontroller * viewcontroller
DECLSPEC void SDLCALL SDL_free(void *mem)
The structure that defines a display mode.
EGLSurface EGLint EGLint EGLint EGLint height
void UIKit_RaiseWindow(_THIS, SDL_Window *window)
id initWithSDLWindow:(SDL_Window *_window)
void UIKit_HideWindow(_THIS, SDL_Window *window)
static SDL_VideoDevice * _this
SDL_GLContext current_glctx
void UIKit_SetWindowFullscreen(_THIS, SDL_Window *window, SDL_VideoDisplay *display, SDL_bool fullscreen)
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
EGLSurface EGLint EGLint EGLint width
SDL_DisplayMode * display_modes
SDL_DisplayMode current_mode
DECLSPEC int SDLCALL SDL_SetError(const char *fmt,...)
DECLSPEC void *SDLCALL SDL_malloc(size_t size)
union SDL_SysWMinfo::@78 info
#define SDL_assert(condition)
#define SDL_OutOfMemory()
UIScreenMode * uiscreenmode
SDL_VideoDisplay * SDL_GetDisplayForWindow(SDL_Window *window)
BOOL SDL_UIKit_supports_multiple_displays
void UIKit_ShowWindow(_THIS, SDL_Window *window)
SDL_Window * current_glwin
SDL_uikitopenglview * view
typedef BOOL(WINAPI *PFNWGLSETSTEREOEMITTERSTATE3DLPROC)(HDC hDC