How do I prevent startup flicker?

Using Cocos2d-x There’s a black flicker between the iOS default.png startup image being displayed and then the Cocos2d-x OpenGL view displaying. In my startup Scene, I load the corresponding default.png for the screen size and add it to the scene. But there’s still a flicker. So, as a hack, I’m creating a UIImageView in the AppController.mm which loads the Default.png and then removes it after 2 seconds. But, I’d rather remove it when I know the OpenGL view is rendering something to replace it with. What’s the best practice here?

_startupView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"Default-568h.png"]];
[window addSubview:_startupView];

You may want to ask this on the cocos2d-x-iphone forums. This forum is for cocos2d-x. Not the same :smile:

http://forum.cocos2d-swift.org

Maybe I’m mistaken and in the wrong forums, but this is specifically C++ Cocos2d-x that I’m using, not Cocos2d for iOS. I’m coding C++ for most of my game. The portion of example code I have there is Objective-C, but it’s only just a little bit of Objective-C that I’m using as a hack. And I’d imagine I’ll have to write some other code/hack in Java for when I build the Android version. Unless there’s some easy Cocos2d-x generic C++ way to fix this issue. Somewhere between the handoff of the iOS app startup to the Cocos2d-x scene being rendered, there’s a black screen that I would like to get rid of.

oh, geez. I totally mis-read what you said in the initial post. I see why you are doing this now.

What version of Cocos2d-x are you using?

Hey, no problem! I’m using Cocos2d-x 3.1. Thanks for your help.

I also have this problem. And when I was using cocos2d-x 2.1.x, I can just change didFinishLaunchingWithOptions method to willFinishLaunchingWithOptions in AppController.mm to make the flicker go away, but it won’t work with cocos2d-x 3.1 now. Maybe it’s caused by the new rendering mechanism?
And another fact I find is, if I use a simple scene with just a LayerColor instance on it, there won’t be a flicker. But when I add a Sprite on the scene, the flicker appears.
Right now, I can’t find a better solution than the one mentioned by ThatOdieGuy. Any one can help with this?

I have this same problem with cocos2dx 3.2.

Has anyone solved this yet?

many thanks.

dana