0
試圖獲得Cocos2D和openFrameworks在iOS
上很好地一起玩。兩者都希望使用GL
/EAGLview
,當然,他們不能僅僅執行glView = [[EAGLView alloc] init]
,因爲您不能擁有兩個根視圖。一個必須init
,另一個需要將其指針glView
分配給另一個。我現在在做:Cocos2D應該從openFrameworks採用EAGLview,反之亦然?
#ifdef __COCOS2D__
glView = [[CCDirector sharedDirector] openGLView];
#else // this is the standard openFrameworks GL init code
glView = [[EAGLView alloc] initWithFrame:screenBounds andDepth:iPhoneGetOFWindow()->isDepthEnabled() andAA:iPhoneGetOFWindow()->isAntiAliasingEnabled() andNumSamples:iPhoneGetOFWindow()->getAntiAliasingSampleCount() andRetina:iPhoneGetOFWindow()->isRetinaSupported()];
,它給了我一個黑色的屏幕,如果我#define __COCOS2D__
。
我在哪裏可以學到什麼,我需要知道約EAGLView
以init
它的方式,使兩者的Cocos2D和快樂了openFrameworks?
或者,如果你感覺特別聖潔:爲什麼我會變黑屏,我該怎麼辦?