2014-10-11 88 views
1

運行SDL的演示,我注意到iPhone 5/5s上的屏幕,iPhone 6/6 Plus未顯示爲全尺寸。屏幕頂部和底部有黑條。無論選擇哪種手機模擬器,SDL顯示屏均爲320×480。SDL在iPhone 5/6/6上不顯示全屏+

這裏是打印出來的SDL_uikitappdelegate.m

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions 
{ 
    NSLog(@"Screen size: (%f, %f)", [UIScreen mainScreen].nativeBounds.size.width, [UIScreen mainScreen].nativeBounds.size.height); 
    UIScreen *mainScreen = [UIScreen mainScreen]; 
    NSLog(@"Screen bounds: %@, Screen resolution: %@, scale: %f, nativeScale: %f", 
      NSStringFromCGRect(mainScreen.bounds), mainScreen.coordinateSpace, mainScreen.scale, mainScreen.nativeScale); 
} 

2014-10-11 17:09:21.267 Happy[18363:725719] Screen size: (640.000000, 960.000000) 
2014-10-11 17:09:21.268 Happy[18363:725719] Screen bounds: {{0, 0}, {320, 480}}, Screen resolution: <UIScreen: 0x7feab951f1a0; bounds = {{0, 0}, {320, 480}}; mode = <UIScreenMode: 0x7feab9619420; size = 640.000000 x 960.000000>>, scale: 2.000000, nativeScale: 2.000000 

注意application:didFinishLaunchingWithOptionsSDL_init()SDL_CreateWindow()之前執行。

我期待下面的iPhone屏幕尺寸:

iPhone5 = 320x568, 
iPhone6 = 375x667, 
iPhone6 Plus = 414x736 

任何人有想法,爲什麼和如何使它全屏?

enter image description here

回答

0

我剛纔的戰鬥同樣的事情時,我發現您的文章。問題在於,SDL附帶的Xcode項目文件模板來自Xcode 6之前的版本,並且一系列設置需要啓動圖像才能顯示各種屏幕尺寸,以表明iPhone 5及更高版本均受支持。

顯然,繼續這樣做將是一個脆弱的解決方案。我創建了一個新的空白項目,並使用iOS 8 LaunchScreen.xib,但沒有任何啓動圖像。這使得該應用程序可以支持任何屏幕尺寸(使用可調整大小的iPhone模擬器進行測試)。