jeudi 8 mars 2012

OpenGL ES et Projets iPhone SDK 3.0

Si vous rencontrez des problèmes pour obtenir l'un des plus âgés de l'échantillon de code OpenGL ES fonctionnant sous SDK 3.0 - spécialement si vous obtenez un écran blanc plutôt que ce que vous êtes censé voir, voici le problème - supprimer la ligne de code spécifiée ci-après le Délégué App applicationDidFinishLaunching: méthode:

- (void)applicationDidFinishLaunching:(UIApplication*)application
{
CGRect rect = [[UIScreen mainScreen] bounds];

window = [[UIWindow alloc] initWithFrame:rect]; // <-- Delete this

GLViewController *theController = [[GLViewController alloc] init];
self.controller = theController;
[theController release];

GLView *glView = [[GLView alloc] initWithFrame:rect];
[window addSubview:glView];

glView.controller = controller;
glView.animationInterval = 1.0 / kRenderingFrequency;
[glView startAnimation];
[glView release];

[window makeKeyAndVisible];

}



Le problème est qu'il ya déjà par exemple dans la fenêtre de MainWindow.xib, créant ainsi un nouveau est problématique - il ne peut être sur l'instance du UIWindow. Sous 2.2.1 et avant, il a travaillé, sous 3.0, il provoque des problèmes. Dans les deux cas, la ligne de code doit être supprimé, cependant.

Aucun commentaire: