Porting from win32 to iPhone

Porting from win32 to iPhone
0.0 0


I have started creating a project on my windows 7 computer. I was wondering if it would be possible to then port this to a iPhone project which I can then build on a mac and run on an iPhone (and submit to apple)?

Thanks, Scott


Ofcourse, it is possible. HelloWorld,HelloLua and tests are all done by this way.


Thanks! Is there a tutorial somewhere?


I think the wiki has some docs. You put all platform independented .cpp and .h files into “Classes”.


So today I tried to do this. I first made a new cocos2d-x project on my mac then replaced the AppDelegate’s and HelloWorldLayer’s with my AppDelegate’s and GameLayer’s from my windows pc. I then tried to run it with the iPhone simulator and I got a “EXC_BAD_ACCESS” pointing to:
_background = CCSprite::spriteWithFile("background.png"); _background->setPosition(ccp(240, 160)); this->addChild(_background);

the _background->setPosition…

Any help?


It look like you haven’t located background.png in the Resources correctly. Have you added it into xcode project?


Too right. Had completely forgotten that :L