void Cocos2dRenderer::Resume() { auto director = cocos2d::Director::getInstance(); auto glview = director->getOpenGLView(); if (!glview) { GLViewImpl* glview = GLViewImpl::create("Test Cpp"); glview->setDispatcher(m_dispatcher.Get()); glview->setPanel(m_panel.Get()); glview->Create(static_cast<float>(m_width), static_cast<float>(m_height), m_dpi, DisplayOrientations::Landscape); director->setOpenGLView(glview); CCApplication::getInstance()->run(); } else { Application::getInstance()->applicationWillEnterForeground(); } }
void Cocos2dRenderer::Resume() { auto director = cocos2d::Director::getInstance(); if (!director->getOpenGLView()) { GLViewImpl* glview = GLViewImpl::create("Test Cpp"); glview->setDispatcher(m_dispatcher.Get()); glview->setPanel(m_panel.Get()); glview->Create(static_cast<float>(m_width), static_cast<float>(m_height), m_dpi, m_orientation); director->setOpenGLView(glview); CCApplication::getInstance()->run(); } else { Application::getInstance()->applicationWillEnterForeground(); cocos2d::EventCustom foregroundEvent(EVENT_COME_TO_FOREGROUND); cocos2d::Director::getInstance()->getEventDispatcher()->dispatchEvent(&foregroundEvent); } }