We’re building a game using Cocos2dx and Marmalade, and it’s intended to run on both desktop PC and mobile platforms.
On PC we want to offer the user to toggle between windowed and fullcsreen from the options menu, but still maintain the aspect ratio.
Our game runs at 1024x768.
This has turned out to be somewhat of an issue.. I am not sure how the correlation of Marmalade settings + Cocos works, and I wonder if anyone
has experience in this field?
Basically what we do right now is:
in the app.icf file, setting:
And then I do this in our AppDelegate class
CCSize screenSize = CCEGLView::sharedOpenGLView()->getFrameSize();
CCSize designSize = CCSizeMake( 1024, 768 );
CCEGLView::sharedOpenGLView()->setDesignResolutionSize( designSize.width, designSize.height, kResolutionShowAll );
This works great for windowed mode. If we toggle fullscreen using:
mode.m_Height = 768;
mode.m_Width = 1024;
mode.m_Refresh = 60;
s3eWindowSetFullscreen( &mode );
It sets the app to fullscreen, but it stretches the graphics. Trying other resolutions can get various results, but one big issue I’ve noticed is the
input doesnt’ work correctly after switching the resolution.
Any help is welcome!