Page 1 of 1

createSceneManager() using NULL Rendering System?

Posted: Sun Aug 12, 2018 4:08 pm
by mrmclovin
Hello,

I'm trying make my classes that depend on Ogre testable and to do it I need Ogre not to render anything. I'm using Ogre 2.1 on macOS.

Code: Select all

Ogre::NULLPlugin ogre_null_plugin;
  Ogre::Root       ogre_root;

  ogre_root.installPlugin(&ogre_null_plugin);

  Ogre::RenderSystem *rs = ogre_root.getRenderSystemByName("NULL Rendering Subsystem");
  ogre_root.setRenderSystem(rs);

  ogre_root.initialise(false);

  Ogre::SceneManager *ogre_scene_mgr = ogre_root.createSceneManager(1, 1, Ogre::INSTANCING_CULLING_SINGLETHREAD);
This results in an assertion error when executing createSceneManager():
Assertion failed: (index < mTechniques.size() && "Index out of bounds."), function getTechnique, file /ogre/ogre/OgreMain/src/OgreMaterial.cpp, line 277.
Any idea what I need to do?

Re: createSceneManager() using NULL Rendering System?

Posted: Thu Nov 15, 2018 5:25 pm
by mrmclovin
Simple fix. I had to let ogre create a render window automatically using:

Code: Select all

ogre_root.initialise(true);
Otherwise the MaterialManager would not setup default material technique and pass.