Fanatic
07-04-2006 05:11:13
I'm trying to get an app running without using the example framework and using PLSM2.
I have the following code:
Upon calling startRendering I'm getting an assertion in ogresharedptr.h (line 93).
If I switch to ST_GENERIC (and comment out setWorldGeometry) I get a blank black screen as expected.
Is there something else that must be done before PLSM2 to render? My cfg files *should* (assuming I've done them right) be pointing to the alpes landscape from the demo.
Note I do not have a framelistener set up yet, nor any lighting, loading of meshes, etc.
I have the following code:
Root * pRoot = new Root ();
pRoot -> showConfigDialog (); // ogre init failed
ConfigFile cFile;
cFile.load ("resources.cfg");
// Go through all sections & settings in the file
ConfigFile::SectionIterator seci = cFile.getSectionIterator ();
String secName, typeName, archName;
while (seci.hasMoreElements ())
{
secName = seci.peekNextKey ();
ConfigFile::SettingsMultiMap * pSettings = seci.getNext ();
ConfigFile::SettingsMultiMap::iterator i;
for (i = pSettings -> begin (); i != pSettings -> end (); ++i)
{
typeName = i -> first;
archName = i -> second;
ResourceGroupManager::getSingleton ().addResourceLocation (archName, typeName, secName);
}
}
RenderWindow * pWindow = pRoot -> initialise (true);
SceneManager * pSceneManager = pRoot -> createSceneManager (ST_EXTERIOR_REAL_FAR);
pSceneManager -> setWorldGeometry ("paginglandscape2.cfg");
Camera * pCamera = pSceneManager -> createCamera ("PlayerCam");
pCamera -> setPosition (Vector3 (0, 0, 500));
pCamera -> lookAt (Vector3 (0, 0, -300));
pCamera -> setNearClipDistance (5);
pCamera -> setFarClipDistance (0);
Viewport * pViewport = pWindow -> addViewport (pCamera);
pViewport -> setBackgroundColour (ColourValue (0, 0, 0));
pCamera -> setAspectRatio (Real (pViewport -> getActualWidth ()) / Real (pViewport -> getActualHeight ()));
pRoot -> startRendering ();
Upon calling startRendering I'm getting an assertion in ogresharedptr.h (line 93).
If I switch to ST_GENERIC (and comment out setWorldGeometry) I get a blank black screen as expected.
Is there something else that must be done before PLSM2 to render? My cfg files *should* (assuming I've done them right) be pointing to the alpes landscape from the demo.
Note I do not have a framelistener set up yet, nor any lighting, loading of meshes, etc.