2011-09-05 29 views
0

試圖獲得Cocos2DopenFrameworksiOS上很好地一起玩。兩者都希望使用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__

我在哪裏可以學到什麼,我需要知道EAGLViewinit它的方式,使兩者的Cocos2D和快樂了openFrameworks?

或者,如果你感覺特別聖潔:爲什麼我會變黑屏,我該怎麼辦?

回答

2

我的工作答案:只有一個框架(Cocos2D)做所有的繪圖。 openFrameworks可以在幕後處理建模等,但實際上並沒有設置openGL上下文。

還是很想聽聽,如果你已經得到了他們,充分,一起工作,但...

相關問題