本文整理汇总了C++中ogre::Root::getHlmsManager方法的典型用法代码示例。如果您正苦于以下问题:C++ Root::getHlmsManager方法的具体用法?C++ Root::getHlmsManager怎么用?C++ Root::getHlmsManager使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ogre::Root
的用法示例。
在下文中一共展示了Root::getHlmsManager方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: keyReleased
void GameState::keyReleased(const SDL_KeyboardEvent &arg)
{
if (arg.keysym.sym == SDLK_F1 && (arg.keysym.mod & ~(KMOD_NUM | KMOD_CAPS)) == 0)
{
mDisplayHelpMode = (mDisplayHelpMode + 1) % mNumDisplayHelpModes;
Ogre::String finalText;
generateDebugText(0, finalText);
mpDebugText->setCaption(finalText);
mpDebugTextShadow->setCaption(finalText);
}
else if (arg.keysym.sym == SDLK_F1 && (arg.keysym.mod & (KMOD_LCTRL | KMOD_RCTRL)))
{
//Hot reload of PBS shaders. We need to clear the microcode cache
//to prevent using old compiled versions.
Ogre::Root *root = mpGraphicsSystem->getRoot();
Ogre::HlmsManager *hlmsManager = root->getHlmsManager();
Ogre::Hlms *hlms = hlmsManager->getHlms(Ogre::HLMS_PBS);
Ogre::GpuProgramManager::getSingleton().clearMicrocodeCache();
hlms->reloadFrom(hlms->getDataFolder());
}
else if (arg.keysym.sym == SDLK_F2 && (arg.keysym.mod & (KMOD_LCTRL | KMOD_RCTRL)))
{
//Hot reload of Unlit shaders.
Ogre::Root *root = mpGraphicsSystem->getRoot();
Ogre::HlmsManager *hlmsManager = root->getHlmsManager();
Ogre::Hlms *hlms = hlmsManager->getHlms(Ogre::HLMS_UNLIT);
Ogre::GpuProgramManager::getSingleton().clearMicrocodeCache();
hlms->reloadFrom(hlms->getDataFolder());
}
else if (arg.keysym.sym == SDLK_F3 && (arg.keysym.mod & (KMOD_LCTRL | KMOD_RCTRL)))
{
//Hot reload of Unlit shaders.
Ogre::Root *root = mpGraphicsSystem->getRoot();
Ogre::HlmsManager *hlmsManager = root->getHlmsManager();
Ogre::Hlms *hlms = hlmsManager->getComputeHlms();
Ogre::GpuProgramManager::getSingleton().clearMicrocodeCache();
hlms->reloadFrom(hlms->getDataFolder());
}
else
{
bool handledEvent = false;
if (mpCameraController)
handledEvent = mpCameraController->keyReleased(arg);
if (!handledEvent)
IGameState::keyReleased(arg);
}
}