visual studio - cocos2d-x 3.x on Windows: How do I change the size of my game window? -


when developing using cocos2d-x 3.x device, automatically sets gl view fit device. in vs2012 on windows, creates seemingly-arbitrarily sized window. how set size of window?

my solution follows.

in appdelegate.cpp:

bool appdelegate::applicationdidfinishlaunching() {     auto director = director::getinstance();     auto glview = director->getopenglview();     if(!glview) {          glview = glview::create("my game");         glview->setframesize(800, 600);     // or whatever         director->setopenglview(glview);     }     ... } 

in particular use case, i'm setting window sizes various resolutions , aspect ratios test layouts. i'm sharing q&a format because couldn't find straight answer anywhere.


Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

thorough guide for profiling racket code -