Once again, we'll use the code from the previous example:
Remove all code inside the
createScene()
function.Add a new function to the application class called
chooseSceneManager():
virtual void chooseSceneManager(void) { }
Now add code into the new function to load an archive containing the map we want to be rendered:
ResourceGroupManager::getSingleton().addResourceLocation("../../media/packs/chiropteraDM.pk3", "Zip", ResourceGroupManager::getSingleton().getWorldResourceGroupName(), true);
After adding the map, we need to load it completely:
ResourceGroupManager::getSingleton().initialiseResourceGroup(ResourceGroupManager::getSingleton().getWorldResourceGroupName());
Then we need to use
createSceneManager():
mSceneMgr = mRoot->createSceneManager("BspSceneManager");
Now tell the scene manager we want to display the previously loaded map:
mSceneMgr->setWorldGeometry("maps/chiropteradm.bsp");
Compile and run the application. You should see...