From 5609d04c1d862cb5b35fabd0732398561a4892ac Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 1 May 2010 13:50:56 -0400 Subject: [PATCH] Test for system version in the Apple Recommended way. (a similar test is output by Xcode for the iPhone View Application template). --- src/video/uikit/SDL_uikitvideo.m | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/video/uikit/SDL_uikitvideo.m b/src/video/uikit/SDL_uikitvideo.m index dd5454882..7f7747e3f 100644 --- a/src/video/uikit/SDL_uikitvideo.m +++ b/src/video/uikit/SDL_uikitvideo.m @@ -184,8 +184,10 @@ static void UIKit_DeleteDevice(SDL_VideoDevice * device) { _this->gl_config.driver_loaded = 1; - const float version = [[[UIDevice currentDevice] systemVersion] floatValue]; - supports_multiple_displays = (version >= 3.2f); + NSString *reqSysVer = @"3.2"; + NSString *currSysVer = [[UIDevice currentDevice] systemVersion]; + if ([currSysVer compare:reqSysVer options:NSNumericSearch] != NSOrderedAscending) + supports_multiple_displays = YES; // If this is iPhoneOS < 3.2, all devices are one screen, 320x480 pixels. // The iPad added both a larger main screen and the ability to use