IPhone 3GS OpenGL weird bug

I am developing a 2D game for iPhone and iPod Touch using OpenGL ES 1.1. Everything works fine on iPhone, iPhone 3G and all iPod Touch models. Usually a game plays scenes at ~ 60 FPS.

This also happens on the iPhone 3GS, but sometimes (by accident) 3GS reduces the frame rate to 40 FPS, and the animation seems unstable. This also happens if the user locks the phone and resumes it from sleep mode.

I think this is due to NSTimer, because if I change the jitter trigger mode to the new CADisplayLink class, available from SDK 3.1+, everything will be fine on all devices ... and on 3GS too.

I do not know how to solve this problem, and I do not want to publish my application with a restriction of 3.1+. There are many more users with 3.0 devices.

Anyone who has a problem with the iPhone 3GS too? If yes, please help me with a workaround.

Thanks!

+3
source share
1 answer

You can use both libraries and get the best result on devices 3.0 or 3.1. That would be nice, since the minimum version of iPhone OS used by the AppStore is contained in your application's Info.plist file.

The iPhone OS version is restored using the following Apple code. Link to the UI device class :

float iPhoneOSVersion = [[[UIDevice currentDevice] systemVersion] floatValue];

if ( iPhoneOSVersion >= 3.1 ) {
    useNewerFramework();
} else {
    useOlderFramework();
}

However, you must also make sure that you set the deployment target in Xcode to version 3.0 or any minimum version that you want to run.

+2
source

Source: https://habr.com/ru/post/1724473/


All Articles