author | koda |
Thu, 03 Nov 2011 01:10:25 +0100 | |
changeset 6266 | b02a1e92dba2 |
parent 6259 | 02765411a912 |
child 6337 | 84e7d1a5e3df |
permissions | -rw-r--r-- |
6207 | 1 |
diff -r 50560ca58f80 Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj |
2 |
--- a/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj Mon Oct 24 23:18:53 2011 -0400 |
|
6259
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
3 |
+++ b/Xcode-iPhoneOS/SDL/SDLiPhoneOS.xcodeproj/project.pbxproj Wed Nov 02 09:22:08 2011 +0100 |
5702 | 4 |
@@ -1596,9 +1596,12 @@ |
5697 | 5 |
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; |
6 |
GCC_C_LANGUAGE_STANDARD = c99; |
|
7 |
GCC_DEBUGGING_SYMBOLS = full; |
|
8 |
+ GCC_OPTIMIZATION_LEVEL = 0; |
|
9 |
+ GCC_THUMB_SUPPORT = NO; |
|
6207 | 10 |
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0; |
5697 | 11 |
GCC_WARN_ABOUT_RETURN_TYPE = YES; |
12 |
GCC_WARN_UNUSED_VARIABLE = NO; |
|
13 |
- IPHONEOS_DEPLOYMENT_TARGET = 3.1.3; |
|
6207 | 14 |
+ IPHONEOS_DEPLOYMENT_TARGET = 3.0; |
5697 | 15 |
ONLY_ACTIVE_ARCH = NO; |
16 |
PREBINDING = NO; |
|
17 |
SDKROOT = iphoneos; |
|
5702 | 18 |
@@ -1613,9 +1616,12 @@ |
5697 | 19 |
ARCHS = "$(ARCHS_STANDARD_32_BIT)"; |
20 |
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer"; |
|
21 |
GCC_C_LANGUAGE_STANDARD = c99; |
|
22 |
+ GCC_FAST_MATH = YES; |
|
23 |
+ GCC_THUMB_SUPPORT = NO; |
|
6207 | 24 |
+ GCC_VERSION = com.apple.compilers.llvm.clang.1_0; |
5697 | 25 |
GCC_WARN_ABOUT_RETURN_TYPE = YES; |
26 |
GCC_WARN_UNUSED_VARIABLE = NO; |
|
27 |
- IPHONEOS_DEPLOYMENT_TARGET = 3.1.3; |
|
6207 | 28 |
+ IPHONEOS_DEPLOYMENT_TARGET = 3.0; |
5697 | 29 |
PREBINDING = NO; |
30 |
SDKROOT = iphoneos; |
|
31 |
TARGETED_DEVICE_FAMILY = "1,2"; |
|
6207 | 32 |
diff -r 50560ca58f80 include/SDL_config_iphoneos.h |
33 |
--- a/include/SDL_config_iphoneos.h Mon Oct 24 23:18:53 2011 -0400 |
|
6259
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
34 |
+++ b/include/SDL_config_iphoneos.h Wed Nov 02 09:22:08 2011 +0100 |
5697 | 35 |
@@ -106,7 +106,7 @@ |
36 |
/* enable iPhone version of Core Audio driver */ |
|
5702 | 37 |
#define SDL_AUDIO_DRIVER_COREAUDIO 1 |
5697 | 38 |
/* Enable the dummy audio driver (src/audio/dummy/\*.c) */ |
39 |
-#define SDL_AUDIO_DRIVER_DUMMY 1 |
|
40 |
+#define SDL_AUDIO_DRIVER_DUMMY 0 |
|
41 |
||
42 |
/* Enable the stub haptic driver (src/haptic/dummy/\*.c) */ |
|
43 |
#define SDL_HAPTIC_DISABLED 1 |
|
6207 | 44 |
@@ -132,16 +132,16 @@ |
5697 | 45 |
/* enable OpenGL ES */ |
46 |
#define SDL_VIDEO_OPENGL_ES 1 |
|
47 |
#define SDL_VIDEO_RENDER_OGL_ES 1 |
|
48 |
-#define SDL_VIDEO_RENDER_OGL_ES2 1 |
|
49 |
+#define SDL_VIDEO_RENDER_OGL_ES2 0 |
|
50 |
||
51 |
/* Enable system power support */ |
|
52 |
-#define SDL_POWER_UIKIT 1 |
|
53 |
+#define SDL_POWER_UIKIT 0 |
|
54 |
||
55 |
/* enable iPhone keyboard support */ |
|
56 |
#define SDL_IPHONE_KEYBOARD 1 |
|
57 |
||
6207 | 58 |
/* enable joystick subsystem */ |
59 |
-#define SDL_JOYSTICK_DISABLED 0 |
|
5697 | 60 |
+#define SDL_JOYSTICK_DISABLED 1 |
6207 | 61 |
|
5697 | 62 |
/* Set max recognized G-force from accelerometer |
63 |
See src/joystick/uikit/SDLUIAccelerationDelegate.m for notes on why this is needed |
|
6207 | 64 |
diff -r 50560ca58f80 src/video/uikit/SDL_uikitopenglview.m |
65 |
--- a/src/video/uikit/SDL_uikitopenglview.m Mon Oct 24 23:18:53 2011 -0400 |
|
6259
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
66 |
+++ b/src/video/uikit/SDL_uikitopenglview.m Wed Nov 02 09:22:08 2011 +0100 |
6207 | 67 |
@@ -114,8 +114,8 @@ |
5697 | 68 |
|
69 |
// !!! FIXME: use the screen this is on! |
|
70 |
/* Use the main screen scale (for retina display support) */ |
|
71 |
- if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) |
|
72 |
- self.contentScaleFactor = [UIScreen mainScreen].scale; |
|
73 |
+ if ([self respondsToSelector:@selector(contentScaleFactor)]) |
|
74 |
+ self.contentScaleFactor = [[UIScreen mainScreen] scale]; |
|
75 |
||
76 |
self.autoresizingMask = 0; // don't allow autoresize, since we need to do some magic in -(void)updateFrame. |
|
77 |
} |
|
6207 | 78 |
@@ -144,8 +144,8 @@ |
79 |
||
5697 | 80 |
// !!! FIXME: use the screen this is on! |
81 |
/* Use the main screen scale (for retina display support) */ |
|
82 |
- if ([[UIScreen mainScreen] respondsToSelector:@selector(scale)]) |
|
83 |
- self.contentScaleFactor = [UIScreen mainScreen].scale; |
|
84 |
+ if ([self respondsToSelector:@selector(contentScaleFactor)]) |
|
85 |
+ self.contentScaleFactor = [[UIScreen mainScreen] scale]; |
|
86 |
} |
|
87 |
||
6207 | 88 |
- (void)setCurrentContext |
6259
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
89 |
diff -r 50560ca58f80 src/video/uikit/SDL_uikitvideo.m |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
90 |
--- a/src/video/uikit/SDL_uikitvideo.m Mon Oct 24 23:18:53 2011 -0400 |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
91 |
+++ b/src/video/uikit/SDL_uikitvideo.m Wed Nov 02 09:22:08 2011 +0100 |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
92 |
@@ -178,7 +178,7 @@ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
93 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
94 |
// UIScreenMode showed up in 3.2 (the iPad and later). We're |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
95 |
// misusing this supports_multiple_displays flag here for that. |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
96 |
- if (!SDL_UIKit_supports_multiple_displays) { |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
97 |
+ if (SDL_UIKit_supports_multiple_displays) { |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
98 |
UIScreenMode *uimode = [uiscreen currentMode]; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
99 |
[uimode retain]; // once for the desktop_mode |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
100 |
[uimode retain]; // once for the current_mode |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
101 |
@@ -200,10 +200,8 @@ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
102 |
{ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
103 |
_this->gl_config.driver_loaded = 1; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
104 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
105 |
- NSString *reqSysVer = @"3.2"; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
106 |
- NSString *currSysVer = [[UIDevice currentDevice] systemVersion]; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
107 |
- if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
108 |
- SDL_UIKit_supports_multiple_displays = YES; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
109 |
+ // this tells us whether we are running on ios >= 3.2 |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
110 |
+ SDL_UIKit_supports_multiple_displays = [UIScreen instancesRespondToSelector:@selector(currentMode)]; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
111 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
112 |
// Add the main screen. |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
113 |
UIScreen *uiscreen = [UIScreen mainScreen]; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
114 |
diff -r 50560ca58f80 src/video/uikit/SDL_uikitview.m |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
115 |
--- a/src/video/uikit/SDL_uikitview.m Mon Oct 24 23:18:53 2011 -0400 |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
116 |
+++ b/src/video/uikit/SDL_uikitview.m Wed Nov 02 09:22:08 2011 +0100 |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
117 |
@@ -311,7 +311,7 @@ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
118 |
/* iPhone keyboard addition functions */ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
119 |
#if SDL_IPHONE_KEYBOARD |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
120 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
121 |
-SDL_uikitview * getWindowView(SDL_Window * window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
122 |
+SDL_uikitview *SDL_getUikitView(SDL_Window *window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
123 |
{ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
124 |
if (window == NULL) { |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
125 |
SDL_SetError("Window does not exist"); |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
126 |
@@ -328,9 +328,9 @@ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
127 |
return view; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
128 |
} |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
129 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
130 |
-int SDL_iPhoneKeyboardShow(SDL_Window * window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
131 |
+int SDL_iPhoneKeyboardShow(SDL_Window *window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
132 |
{ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
133 |
- SDL_uikitview *view = getWindowView(window); |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
134 |
+ SDL_uikitview *view = SDL_getUikitView(window); |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
135 |
if (view == nil) { |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
136 |
return -1; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
137 |
} |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
138 |
@@ -339,9 +339,9 @@ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
139 |
return 0; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
140 |
} |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
141 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
142 |
-int SDL_iPhoneKeyboardHide(SDL_Window * window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
143 |
+int SDL_iPhoneKeyboardHide(SDL_Window *window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
144 |
{ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
145 |
- SDL_uikitview *view = getWindowView(window); |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
146 |
+ SDL_uikitview *view = SDL_getUikitView(window); |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
147 |
if (view == nil) { |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
148 |
return -1; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
149 |
} |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
150 |
@@ -350,9 +350,9 @@ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
151 |
return 0; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
152 |
} |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
153 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
154 |
-SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window * window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
155 |
+SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window *window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
156 |
{ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
157 |
- SDL_uikitview *view = getWindowView(window); |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
158 |
+ SDL_uikitview *view = SDL_getUikitView(window); |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
159 |
if (view == nil) { |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
160 |
return 0; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
161 |
} |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
162 |
@@ -360,9 +360,9 @@ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
163 |
return view.keyboardVisible; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
164 |
} |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
165 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
166 |
-int SDL_iPhoneKeyboardToggle(SDL_Window * window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
167 |
+int SDL_iPhoneKeyboardToggle(SDL_Window *window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
168 |
{ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
169 |
- SDL_uikitview *view = getWindowView(window); |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
170 |
+ SDL_uikitview *view = SDL_getUikitView(window); |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
171 |
if (view == nil) { |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
172 |
return -1; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
173 |
} |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
174 |
@@ -380,24 +380,24 @@ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
175 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
176 |
/* stubs, used if compiled without keyboard support */ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
177 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
178 |
-int SDL_iPhoneKeyboardShow(SDL_Window * window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
179 |
+int SDL_iPhoneKeyboardShow(SDL_Window *window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
180 |
{ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
181 |
SDL_SetError("Not compiled with keyboard support"); |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
182 |
return -1; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
183 |
} |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
184 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
185 |
-int SDL_iPhoneKeyboardHide(SDL_Window * window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
186 |
+int SDL_iPhoneKeyboardHide(SDL_Window *window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
187 |
{ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
188 |
SDL_SetError("Not compiled with keyboard support"); |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
189 |
return -1; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
190 |
} |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
191 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
192 |
-SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window * window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
193 |
+SDL_bool SDL_iPhoneKeyboardIsShown(SDL_Window *window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
194 |
{ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
195 |
return 0; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
196 |
} |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
197 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
198 |
-int SDL_iPhoneKeyboardToggle(SDL_Window * window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
199 |
+int SDL_iPhoneKeyboardToggle(SDL_Window *window) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
200 |
{ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
201 |
SDL_SetError("Not compiled with keyboard support"); |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
202 |
return -1; |
6207 | 203 |
diff -r 50560ca58f80 src/video/uikit/SDL_uikitviewcontroller.m |
204 |
--- a/src/video/uikit/SDL_uikitviewcontroller.m Mon Oct 24 23:18:53 2011 -0400 |
|
6259
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
205 |
+++ b/src/video/uikit/SDL_uikitviewcontroller.m Wed Nov 02 09:22:08 2011 +0100 |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
206 |
@@ -28,8 +28,8 @@ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
207 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
208 |
#include "SDL_uikitwindow.h" |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
209 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
210 |
-#import "SDL_uikitviewcontroller.h" |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
211 |
- |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
212 |
+#include "SDL_uikitviewcontroller.h" |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
213 |
+#include "SDL_uikitvideo.h" |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
214 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
215 |
@implementation SDL_uikitviewcontroller |
6207 | 216 |
|
6259
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
217 |
@@ -116,38 +116,17 @@ |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
218 |
const UIInterfaceOrientation toInterfaceOrientation = [self interfaceOrientation]; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
219 |
SDL_WindowData *data = self->window->driverdata; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
220 |
UIWindow *uiwindow = data->uiwindow; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
221 |
- UIScreen *uiscreen = [uiwindow screen]; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
222 |
+ UIScreen *uiscreen; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
223 |
+ if (SDL_UIKit_supports_multiple_displays) |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
224 |
+ uiscreen = [uiwindow screen]; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
225 |
+ else |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
226 |
+ uiscreen = [UIScreen mainScreen]; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
227 |
const int noborder = self->window->flags & SDL_WINDOW_BORDERLESS; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
228 |
CGRect frame = noborder ? [uiscreen bounds] : [uiscreen applicationFrame]; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
229 |
- const CGSize size = frame.size; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
230 |
- int w, h; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
231 |
- |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
232 |
- switch (toInterfaceOrientation) { |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
233 |
- case UIInterfaceOrientationPortrait: |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
234 |
- case UIInterfaceOrientationPortraitUpsideDown: |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
235 |
- w = (size.width < size.height) ? size.width : size.height; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
236 |
- h = (size.width > size.height) ? size.width : size.height; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
237 |
- break; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
238 |
- |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
239 |
- case UIInterfaceOrientationLandscapeLeft: |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
240 |
- case UIInterfaceOrientationLandscapeRight: |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
241 |
- w = (size.width > size.height) ? size.width : size.height; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
242 |
- h = (size.width < size.height) ? size.width : size.height; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
243 |
- break; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
244 |
- |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
245 |
- default: |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
246 |
- SDL_assert(0 && "Unexpected interface orientation!"); |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
247 |
- return; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
248 |
- } |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
249 |
- |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
250 |
- frame.size.width = w; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
251 |
- frame.size.height = h; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
252 |
- frame.origin.x = 0; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
253 |
- frame.origin.y = 0; |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
254 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
255 |
[uiwindow setFrame:frame]; |
5697 | 256 |
[data->view updateFrame]; |
6259
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
257 |
- SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, w, h); |
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
258 |
+ SDL_SendWindowEvent(self->window, SDL_WINDOWEVENT_RESIZED, frame.size.width, frame.size.height); |
5697 | 259 |
} |
6259
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
260 |
|
02765411a912
move objc overlay creation after sdlwindow has been created
koda
parents:
6207
diff
changeset
|
261 |
@end |