Can you post the class header where that appears? glView is declared as a parameter, so that error doesn't make sense. There should also be a line above those that reads: CCDirector *director = [CCDirector sharedDirector];
Return of the Startup Flicker!
(41 posts) (15 voices)-
Posted 1 year ago #
-
here is the whole function
- (void) removeStartupFlicker { // // THIS CODE REMOVES THE STARTUP FLICKER // // Uncomment the following code if you Application only supports landscape mode // #if GAME_AUTOROTATION == kGameAutorotationUIViewController CC_ENABLE_DEFAULT_GL_STATES(); CGSize size = [director winSize]; CCSprite *sprite = [CCSprite spriteWithFile:@"Default.png"]; sprite.position = ccp(size.width/2, size.height/2); sprite.rotation = -90; [sprite visit]; [glView swapBuffers]; CC_ENABLE_DEFAULT_GL_STATES(); #endif // GAME_AUTOROTATION == kGameAutorotationUIViewController }Posted 1 year ago # -
Did you look at Questor's post, two posts above yours, which addresses EXACTLY that issue?
Posted 1 year ago # -
missed that im sorry :/
all fixed :)
Posted 1 year ago # -
I get the odd result with using the new template code of not having flicker, but having the Default.png that is loaded in the removeStartupFlicker be the one created when the app the goes to the background. Anyone else seeing this?
Posted 1 year ago # -
One additional note... doesn't do it on the simulator, just the device, in this case an iPhone 3gs.
Posted 1 year ago # -
I'm still getting a flicker (device only, iPad2 ) using 16-bit depth buffer on cocos 1.0.0rc3. My app is landscape only and I've uncommented appropriate code in AppDelegate.m. When I switch to back to 0, the flicker goes away. Any suggestions?
Posted 10 months ago # -
So, if I change supported device orientation from right to left, the flicker goes away. However, then the app seems to start "upside down" and then rotates (while Default.png is displayed). Kinda confused here.. Moreover, when I set the deviceOrientation in the AppDelegate to kCCDeviceOrientationPortraitRight, I get a flicker. Basically, the left orientation works but the right orientation flickers. This is an issue for me since Apple's own stand holds the iPad in a right orientation (the one causing a flicker).
Posted 10 months ago # -
Hi Codebrella,
I've also had this problem, but I found a solution. I hope this works for you as well. I think it's a combination of factors that cause this, one of them being the depth testing for 3d buffers, and the other being 16 bit depth buffer. Just flick this off and on, this is what I did:Before the call to removeStartupFlicker in appDelegate, insert this line
[director setDepthTest: NO];then before you need any 3d transitions (I set it in my first scene init), you can turn it back on.
[[CCDirector sharedDirector] setDepthTest: YES];Hope this helps.
Posted 9 months ago # -
I'm using cocos 1.0.1 and tried various fixes. This change to CCDirector (no other changes required) seems to work the best for me:
- (void)runWithScene:(CCScene*) scene
{
NSAssert( scene != nil, @"Argument must be non-nil");
NSAssert( runningScene_ == nil, @"You can't run an scene if another Scene is running. Use replaceScene or pushScene instead");[self pushScene:scene];
[self startAnimation];// Fix: render the 1st frame to avoid flicker
[self drawScene];
}Posted 8 months ago # -
After many searches about this issue and attempts with different fixes proposed, I can confirm that on the iPhone/iPod 4 running iOS 4.3 and Cocos2D 1.0 the fix described by @erich is the one that actually works for me.
If you use @erich's suggestion, comment out or remove the call to [self removeStartupFlicker]
Posted 3 months ago #
Reply
You must log in to post.