| 45 | |
| 46 | |
| 47 | bool AppDelegate::applicationDidFinishLaunching() |
| 48 | { |
| 49 | // Enable logging output colored text style and prefix timestamp |
| 50 | ax::setLogFmtFlag(ax::LogFmtFlag::Full); |
| 51 | |
| 52 | // whether enable global SDF font render support, since axmol-2.0.1 |
| 53 | FontFreeType::setGlobalSDFEnabled(true); |
| 54 | |
| 55 | // initialize director |
| 56 | auto director = Director::getInstance(); |
| 57 | auto renderView = director->getRenderView(); |
| 58 | if (!renderView) |
| 59 | { |
| 60 | std::string title = "Unit Tests"; |
| 61 | #ifdef AX_PLATFORM_PC |
| 62 | renderView = RenderViewImpl::createWithRect(title, Rect(0, 0, gWindowSize.x, gWindowSize.y), 1.0F, true); |
| 63 | #else |
| 64 | renderView = RenderViewImpl::createWithRect(title, Rect(0, 0, gWindowSize.x, gWindowSize.y)); |
| 65 | #endif |
| 66 | director->setRenderView(renderView); |
| 67 | } |
| 68 | |
| 69 | director->setStatsDisplay(true); |
| 70 | |
| 71 | #ifdef AX_PLATFORM_PC |
| 72 | director->setAnimationInterval(1.0f / glfwGetVideoMode(glfwGetPrimaryMonitor())->refreshRate); |
| 73 | #else |
| 74 | director->setAnimationInterval(1.0f / 60); |
| 75 | #endif |
| 76 | |
| 77 | auto screenSize = renderView->getFrameSize(); |
| 78 | |
| 79 | renderView->setDesignResolutionSize(gWindowSize.x, gWindowSize.y, ResolutionPolicy::SHOW_ALL); |
| 80 | |
| 81 | return true; |
| 82 | } |
| 83 | |
| 84 | |
| 85 | void AppDelegate::applicationDidEnterBackground() |
nothing calls this directly
no test coverage detected