| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 #include "app_delegate.h" | 4 #include "app_delegate.h" |
| 5 #include "frontend.h" | 5 #include "frontend.h" |
| 6 #include "CCLuaEngine.h" | 6 #include "CCLuaEngine.h" |
| 7 | 7 |
| 8 USING_NS_CC; | 8 USING_NS_CC; |
| 9 | 9 |
| 10 bool AppDelegate::applicationDidFinishLaunching() { | 10 bool AppDelegate::applicationDidFinishLaunching() { |
| 11 CCEGLView* view = CCEGLView::sharedOpenGLView(); | 11 CCEGLView* view = CCEGLView::sharedOpenGLView(); |
| 12 | 12 |
| 13 CCDirector* director = CCDirector::sharedDirector(); | 13 CCDirector* director = CCDirector::sharedDirector(); |
| 14 director->setOpenGLView(view); | 14 director->setOpenGLView(view); |
| 15 |
| 16 // This tells cocos that our application's assets are designed for |
| 17 // native display at 600x800. If the embed element is not this |
| 18 // size cocos will automatically scale all assets and coordinates |
| 19 // accordingly. |
| 20 view->setDesignResolutionSize(800, 600, kResolutionNoBorder); |
| 21 |
| 15 director->setDisplayStats(true); | 22 director->setDisplayStats(true); |
| 16 | 23 |
| 17 // Create lua engine | 24 // Create lua engine |
| 18 CCLuaEngine* engine = CCLuaEngine::defaultEngine(); | 25 CCLuaEngine* engine = CCLuaEngine::defaultEngine(); |
| 19 CCScriptEngineManager::sharedManager()->setScriptEngine(engine); | 26 CCScriptEngineManager::sharedManager()->setScriptEngine(engine); |
| 20 | 27 |
| 21 // Create the initial (autorelease) scene and run with it. | 28 // Create the initial (autorelease) scene and run with it. |
| 22 CCScene* scene = FrontEndScene::create(); | 29 CCScene* scene = FrontEndScene::create(); |
| 23 director->runWithScene(scene); | 30 director->runWithScene(scene); |
| 24 return true; | 31 return true; |
| 25 } | 32 } |
| OLD | NEW |