Пример #1
0
void OgreMinimalSetup::debugRenderList(const Ogre::RenderSystemList& rsl)
{
  assert(rsl.size() && "RenderSystemList size is 0");
  cout << "RenderSystemList size is " << rsl.size() << endl;
  Ogre::RenderSystem* rs = rsl[0];
  assert(rs && "First RenderSystem is NULL");
  cout << "First RenderSystem name is '" << rs->getName() << "'" << endl;
}
Пример #2
0
void
dmz::RenderModuleCoreOgreBasic::_init_render_system (Config &local) {

   if (_root) {

      String renderSystemName (
         config_to_string ("renderSystem.name", local, "OpenGL"));

      Ogre::RenderSystem *renderSystem (0);

      Ogre::RenderSystemList *renderSystemList = _root->getAvailableRenderers ();
      if (renderSystemList) {

         Ogre::RenderSystemList::iterator it = renderSystemList->begin ();
         while (it != renderSystemList->end () && !renderSystem) {

            if (renderSystemList->size () == 1) {

               renderSystem = *it;
            }
            else {

               Ogre::String curName ((*it)->getName ());
               if (curName.find (renderSystemName.get_buffer ()) >= 0) {

                  renderSystem = *it;
               }
            }

            it++;
         }
      }

      if (renderSystem) {

         _root->setRenderSystem (renderSystem);
         _root->initialise (false); // don't autocreate a window
      }
      else {

         _log.error
            << "Specified render system (" << renderSystemName << ") not found" << endl;
      }
   }
}