Ejemplo n.º 1
0
void PlayerWin::relaunch()
{
    int x = 0;
    int y = 0;
	GLViewImpl* view = dynamic_cast<GLViewImpl*>(Director::getInstance()->getOpenGLView());
	glfwGetWindowPos(view->getWindow(), &x, &y);
    _project.setWindowOffset(Vec2(x, y));
    openNewPlayerWithProjectConfig(_project);

    quit();
}
Ejemplo n.º 2
0
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();
    }
}
Ejemplo n.º 3
0
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);
    }
}