本文整理汇总了C++中ogre::RenderWindow::getNumViewports方法的典型用法代码示例。如果您正苦于以下问题:C++ RenderWindow::getNumViewports方法的具体用法?C++ RenderWindow::getNumViewports怎么用?C++ RenderWindow::getNumViewports使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::RenderWindow
的用法示例。
在下文中一共展示了RenderWindow::getNumViewports方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: setGraphicsLevel
ShaderManager::GraphicsLevel ShaderManager::setGraphicsLevel(ShaderManager::GraphicsLevel newLevel)
{
if (newLevel > mBestGraphicsLevel) {
S_LOG_FAILURE("Cannot set graphics level " << mGraphicSchemes[newLevel]);
return mGraphicsLevel;
}
S_LOG_INFO("Using graphics level " << mGraphicSchemes[newLevel]);
Ogre::MaterialManager::getSingleton().setActiveScheme(mGraphicSchemes[newLevel]);
Ogre::RenderWindow* window = EmberOgre::getSingleton().getRenderWindow();
for (int i = 0; i < window->getNumViewports(); ++i) {
window->getViewport(i)->setMaterialScheme(mGraphicSchemes[newLevel]);
}
switch (newLevel) {
case LEVEL_EXPERIMENTAL:
case LEVEL_HIGH:
setPSSMShadows();
break;
case LEVEL_MEDIUM:
case LEVEL_LOW:
case LEVEL_DEFAULT:
setNoShadows();
break;
}
mGraphicsLevel = newLevel;
EventLevelChanged.emit();
return mGraphicsLevel;
}
示例2: renderQueueStarted
void renderQueueStarted(Ogre::uint8 queueGroupId, const Ogre::String& invocation, bool& skipThisInvocation)
{
Gui* gui = Gui::getInstancePtr();
if (gui == nullptr)
return;
if (Ogre::RENDER_QUEUE_OVERLAY != queueGroupId)
return;
Ogre::Viewport* viewport = mSceneManager->getCurrentViewport();
if (nullptr == viewport
|| !viewport->getOverlaysEnabled())
return;
if (mWindow->getNumViewports() <= mActiveViewport
|| viewport != mWindow->getViewport(mActiveViewport))
return;
mCountBatch = 0;
static Timer timer;
static unsigned long last_time = timer.getMilliseconds();
unsigned long now_time = timer.getMilliseconds();
unsigned long time = now_time - last_time;
onFrameEvent((float)((double)(time) / (double)1000));
last_time = now_time;
//begin();
setManualRender(true);
onRenderToTarget(this, mUpdate);
//end();
// сбрасываем флаг
mUpdate = false;
}