Skip to content

Instantly share code, notes, and snippets.

@webmonch
Created July 21, 2014 12:49
Show Gist options
  • Save webmonch/fef8a1e1c43b863c9bf7 to your computer and use it in GitHub Desktop.
Save webmonch/fef8a1e1c43b863c9bf7 to your computer and use it in GitHub Desktop.
Mac changes
bool AppDelegate::applicationDidFinishLaunching() {
// initialize director
auto director = Director::getInstance();
auto glview = director->getOpenGLView();
if(!glview) {
glview = GLView::create("SimpleRPG");
director->setOpenGLView(glview);
}
//glview->setFrameSize(1024, 768);
glview->setDesignResolutionSize(DESIGN_WIDTH,
DESIGN_HEIGHT,
kResolutionShowAll);
std::vector<std::string> paths;
paths.push_back("pyramid");
Size frameSize = glview->getFrameSize();
if (frameSize.width == 2048) {
paths.push_back(RETINA_RESOLUTION_PATH);
} else {
paths.push_back(REGULAR_RESOLUTION_PATH);
}
FileUtils::getInstance()->setSearchPaths(paths);
// turn on display FPS
director->setDisplayStats(true);
director->setAnimationInterval(1.0 / 60);
App::get()->showSplash();
return true;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment