void ApplicationContextAndroid::pollEvents()
{
    for(WindowList::iterator it = mWindows.begin(); it != mWindows.end(); ++it)
    {
        Ogre::RenderWindow* win = it->render;
        win->windowMovedOrResized();
        windowResized(win);
    }
}
Пример #2
0
		//-----------------------------------------------------------------------------
		void Engine::OnRenderViewSize()
		{
				if(m_pRenderWnd)
						m_pRenderWnd->windowMovedOrResized();

				if(m_pCamera)
						m_pCamera->setAspectRatio(
						Ogre::Real(m_pViewport->getActualWidth()) / Ogre::Real(m_pViewport->getActualHeight()));
		}
Пример #3
0
void ApplicationContextSDL::pollEvents()
{
    if(mWindows.empty())
    {
        // SDL events not initialized
        return;
    }

    SDL_Event event;
    while (SDL_PollEvent(&event))
    {
        switch (event.type)
        {
        case SDL_QUIT:
            mRoot->queueEndRendering();
            break;
        case SDL_WINDOWEVENT:
            if(event.window.event != SDL_WINDOWEVENT_RESIZED)
                continue;

            for(WindowList::iterator it = mWindows.begin(); it != mWindows.end(); ++it)
            {
                if(event.window.windowID != SDL_GetWindowID(it->native))
                    continue;

                Ogre::RenderWindow* win = it->render;
                win->windowMovedOrResized();
                windowResized(win);
            }
            break;
        default:
            _fireInputEvent(convert(event), event.window.windowID);
            break;
        }
    }

#if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
    // hacky workaround for black window on OSX
    for(const auto& win : mWindows)
    {
        SDL_SetWindowSize(win.native, win.render->getWidth(), win.render->getHeight());
        win.render->windowMovedOrResized();
    }
#endif
}