thanks for your reply. But I think you are talking about Windows Phone development using c#? In fact, I just try to debug something using cocos2d-x C++ framework on Windows. And I found there is no interface to change device’s orientation on Simulator. by checking codes, I found this comments about class CCDirector:
The CCDirector is also responsible for:
initializing the OpenGL context
setting the OpenGL pixel format (default on is RGB565)
setting the OpenGL buffer depth (default one is 0-bit)
setting the projection (default one is 3D)
setting the orientation (default one is Protrait)
But by checking its declaration, seems no interface to change orientation. Only one member looks like defined for that purpose:
/* landscape mode ? */
bool m_bLandscape;
but this member is never used anywhere. So is this function is missed somehow? I am using cocos2d-x 2.0. thanks.
Current, I am aware that the function to set device orientation is platform dependent. on windows, it is done in the program’s main function generated by template:
eglView.setFrameSize(320, 480);
// set the design resolution screen size, if you want to use Design Resoulution scaled to current screen, please uncomment next line.
// eglView.setDesignResolutionSize(480, 320);
On iOS, it is done by the function I mentioned in the above message. On Adroid, I have not checked it.
I forced eglView to a portrait resolution like you did above (320,480), but my input and the window width/height returned incorrect values. Were you able to fix these issues?
What OS are you working on? I resolved the problem on iOS and Win-mobile. And I just tried cocos2d-x2.0, not sure whether the concerned logic is changed in higher version.