Hello,
I cant get control back to my normal app after clean ending of director.
I invoke the director normally with:
[self presentModalViewController: myViewController animated:YES];
where myViewController implements using the normal code:
self.window = mainDelegate.mainWindow;
// CC_DIRECTOR_INIT()
//
// 1. Initializes an EAGLView with 0-bit depth format, and RGB565 render buffer
// 2. EAGLView multiple touches: disabled
// 3. creates a UIWindow, and assign it to the "window" var (it must already be declared)
// 4. Parents EAGLView to the newly created window
// 5. Creates Display Link Director
// 5a. If it fails, it will use an NSTimer director
// 6. It will try to run at 60 FPS
// 7. Display FPS: NO
// 8. Device orientation: Portrait
// 9. Connects the director to the EAGLView
//
CC_DIRECTOR_INIT();
// Obtain the shared director in order to...
CCDirector *director = [CCDirector sharedDirector];
// Sets landscape mode
[director setDeviceOrientation:kCCDeviceOrientationLandscapeLeft];
// Turn on display FPS
//[director setDisplayFPS:YES];
// Turn on multiple touches
//EAGLView *glview = [director openGLView]; // [EAGLView viewWithFrame:CGRectMake(0, 0, 250,350)];
//[self.view addSubview:glview];
//[director setOpenGLView:glview];
// Default texture format for PNG/BMP/TIFF/JPEG/GIF images
// It can be RGBA8888, RGBA4444, RGB5_A1, RGB565
// You can change anytime.
[CCTexture2D setDefaultAlphaPixelFormat:kTexture2DPixelFormat_RGBA8888];
EAGLView *glview = [EAGLView viewWithFrame:CGRectMake(0, 0, 300,460)];
[self.view addSubview:glview];
[glview setMultipleTouchEnabled:YES];
[director setOpenGLView:glview];
MyScene * myScene = [MyScene node];
[director runWithScene: myScene];
This works fine.
Now when I push a button on my cocos2d Layer which invokes:
`
CCDirector *director = [CCDirector sharedDirector];
// Since v0.99.4 you have to remove the OpenGL View manually
EAGLView *view = [director openGLView];
[view removeFromSuperview];
// kill the director
[director end];
[self.delegate stepsAnimationDidFinish: tmpStepsAnimation]; // to dismiss the modalView
I get the correct screen back where I started from BUT CANT GET CONTROL.
WIth this I mean, the screen shows the correct content but doesn´t react to any touch anymore.
DO you have an idea what could be the cause.
Basically I followed the "Attach" sample code - but can't get it to work.
Thank you very much for advice!