To run the game on the Windows desktop, go to the Cocos2d-x-2.2.3
project folder and instead of going to the proj.wp8Game - XAML
folder, go to the proj.win32
folder. Right-click on the .sln
file and open it with Visual Studio.
After the project opens up, go to the Solutions Explorer and right-click on the wp8Game
project; right-click on the classes
folder and select Add Existing Item. Navigate to the classes
folder in the wp8Game
project folder and select all the files except the AppDelegate
and HelloWorldScene
files and click on Add.
Next, since our game is designed to run on an 800 x 480 resolution, we have to change the window size to the same. In the AppDelegate.cpp
file, add the following lines of code in the applicaitonDidFinishLaunching
function:
CCDirector* pDirector = CCDirector::sharedDirector(); CCEGLView* pEGLView = CCEGLView::sharedOpenGLView(); #if (CC_TARGET_PLATFORM == CC_PLATFORM_WIN32) pEGLView->setFrameSize(800,480); #endif ...