本文整理汇总了C++中ogre::RenderWindow::isActive方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderWindow::isActive方法的具体用法?C++ RenderWindow::isActive怎么用?C++ RenderWindow::isActive使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::RenderWindow
的用法示例。
在下文中一共展示了RenderWindow::isActive方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: run
void ClientApplication::run()
{
Ogre::Root* root = mGraphicsManager->getRoot();
Ogre::RenderWindow* window = mGraphicsManager->getWindow();
root->getRenderSystem()->_initRenderTargets();
root->clearEventTimes();
boost::timer timer;
while( !mShutdown )
{
if( mShutdownRequested )
{
mStateMachine->popTo( 0 );
mShutdown = true;
}
const Real elapsed = timer.elapsed();
timer.restart();
mEarlyUpdateSignal();
mEarlyFrameSignal( elapsed );
mUpdateSignal();
mFrameSignal( elapsed );
mLateUpdateSignal();
mLateFrameSignal( elapsed );
Ogre::WindowEventUtilities::messagePump();
// Render even when the window is inactive.
if( window->isActive() )
{
root->renderOneFrame();
}
else if( window->isVisible() )
{
root->renderOneFrame();
window->update();
#if DIVERSIA_PLATFORM == DIVERSIA_PLATFORM_WIN32
Sleep( ( 1.0 / 60.0 ) * 1000.0 );
#else
usleep( ( 1.0 / 60.0 ) * 1000000.0 );
#endif
}
else if( !window->isActive() && !window->isVisible() )
{
#if DIVERSIA_PLATFORM == DIVERSIA_PLATFORM_WIN32
Sleep( ( 1.0 / 60.0 ) * 1000.0 );
#else
usleep( ( 1.0 / 60.0 ) * 1000000.0 );
#endif
}
}
}
示例2: Update
//-----------------------------------------------------------------------------
bool Engine::Update()
{
bool bContinue = !(m_pRenderWnd->isClosed());
Ogre::WindowEventUtilities::messagePump();
if(m_pRenderWnd->isActive())
{
float timeDelta = 0.033f;
if(!m_pRoot->renderOneFrame(timeDelta))
bContinue = false;
}
else
{
Sleep(1000);
}
return bContinue;
}
示例3: EnterMainLoop
void Main::EnterMainLoop()
{
/* Setup 3D engine */
OgreSubsystem* ror_ogre_subsystem = RoR::Application::GetOgreSubsystem();
assert(ror_ogre_subsystem != nullptr);
m_viewport = ror_ogre_subsystem->GetRenderWindow()->addViewport(nullptr);
int viewport_width = m_viewport->getActualWidth();
m_viewport->setBackgroundColour(m_config->viewport_background_color);
m_camera->setAspectRatio(m_viewport->getActualHeight() / viewport_width);
m_viewport->setCamera(m_camera);
InitializeOrRestoreGui();
/* Setup input */
RoR::Application::GetInputEngine()->SetKeyboardListener(m_input_handler);
RoR::Application::GetInputEngine()->SetMouseListener(m_input_handler);
/* Show debug box */
m_debug_box->setVisible(true);
while (! m_exit_loop_requested)
{
UpdateMainLoop();
Ogre::RenderWindow* rw = RoR::Application::GetOgreSubsystem()->GetRenderWindow();
if (rw->isClosed())
{
RoR::Application::GetMainThreadLogic()->RequestShutdown();
break;
}
/* Render */
RoR::Application::GetOgreSubsystem()->GetOgreRoot()->renderOneFrame();
if (!rw->isActive() && rw->isVisible())
{
rw->update(); // update even when in background !
}
}
/* Hide GUI */
m_gui_menubar->Hide();
if (m_gui_open_save_file_dialog->isModal())
{
m_gui_open_save_file_dialog->endModal(); // Hides the dialog
}
m_gui_delete_menu->Hide();
// Supress node/beam panels (if visible)
m_nodes_panel ->HideTemporarily();
m_beams_panel ->HideTemporarily();
m_hydros_panel ->HideTemporarily();
m_commands2_panel->HideTemporarily();
m_shocks_panel ->HideTemporarily();
m_shocks2_panel ->HideTemporarily();
m_meshwheels2_panel ->HideTemporarily();
m_flexbodywheels_panel ->HideTemporarily();
/* Hide debug box */
m_debug_box->setVisible(false);
m_exit_loop_requested = false;
}