Platform dependent code

Platform dependent code
0.0 0



Thank you for the great work!

The following snippets are copied from the HelloWorld app:

// init the window
if (!(m_pMainWnd = new CCXEGLView(this)) ||
! m_pMainWnd~~>Create,GetScreenHeight)))
#elif defined
if ) ||
! m_pMainWnd~~>Create(L“HelloWorld”, 320, 480))
#elif defined(CCX_PLATFORM_IPHONE)
if (! (m_pMainWnd = new CCXEGLView() ) )
if (!(m_pMainWnd = CCDirector::sharedDirector()->getOpenGLView()))
delete m_pMainWnd;
return false;

Is it possible move these to cocos2d-x itself so that those #if/else statements can be remove?


I agree, it’s so ugly to write such codes in our games.
We will move this into engine internal
an issue is created here #297