Suppose you want to preload assets on the mac while your app's icon is bouncing in the dock (thus avoiding any empty game window on screen while you pre-load). What you would want to do is bring in your textures during awakeFromNib instead of applicationDidFinishLaunching. It looks like the only thing standing in the way of doing this is the call to setGLDefaultValues when setting the director's openGLView. For some reason calling glEnable before the view is on screen blows chunks. It seems CCDirectorMac can be modified to do this by changing setOpenGLView and drawScene as follows:
static BOOL defaultValuesSet = NO;
-(void) setOpenGLView:(MacGLView *)view
{
NSAssert( view, @"OpenGLView must be non-nil");
if( view != openGLView_ ) {
[openGLView_ release];
openGLView_ = [view retain];
// set size
winSizeInPixels_ = winSizeInPoints_ = CCNSSizeToCGSize( [view bounds].size );
}
// cache the NSWindow and NSOpenGLView created from the NIB
if( ! isFullScreen_ && ! windowGLView_) {
windowGLView_ = [view retain];
originalWinSize_ = winSizeInPixels_;
}
}
- (void) drawScene
{
if(!defaultValuesSet){
[self setGLDefaultValues];
defaultValuesSet = YES;
}
...
Any reason a change like this would be bad ?