Added command line support for loading meshes at startup.
git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@1228 dfc29bdd-3216-0410-991c-e03cc46cb475master
parent
de40041412
commit
68e1f2a67d
|
@ -420,7 +420,7 @@ public:
|
|||
As you can see, there is also a unusual call to IrrlichtDevice::setResizeAble().
|
||||
This makes the render window resizeable, which is quite useful for a mesh viewer.
|
||||
*/
|
||||
int main()
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
// ask user for driver
|
||||
|
||||
|
@ -515,6 +515,9 @@ int main()
|
|||
if (xml)
|
||||
xml->drop(); // don't forget to delete the xml reader
|
||||
|
||||
if (argc > 1)
|
||||
StartUpModelFile = argv[1];
|
||||
|
||||
/*
|
||||
That wasn't difficult. Now we'll set a nicer font and create the
|
||||
Menu. It is possible to create submenus for every menu item. The call
|
||||
|
@ -645,6 +648,7 @@ int main()
|
|||
*/
|
||||
|
||||
// show about message box and load default model
|
||||
if (argc==1)
|
||||
showAboutText();
|
||||
loadModel(StartUpModelFile.c_str());
|
||||
|
||||
|
@ -660,7 +664,9 @@ int main()
|
|||
|
||||
// add a camera scene node
|
||||
Camera[0] = smgr->addCameraSceneNodeMaya();
|
||||
Camera[0]->setFarValue(20000.f);
|
||||
Camera[1] = smgr->addCameraSceneNodeFPS();
|
||||
Camera[1]->setFarValue(20000.f);
|
||||
|
||||
setActiveCamera ( Camera[0] );
|
||||
|
||||
|
|
Loading…
Reference in New Issue