Commit 68e1f2a6 authored by hybrid's avatar hybrid

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-e03cc46cb475
parent de400414
...@@ -420,7 +420,7 @@ public: ...@@ -420,7 +420,7 @@ public:
As you can see, there is also a unusual call to IrrlichtDevice::setResizeAble(). 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. 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 // ask user for driver
...@@ -515,6 +515,9 @@ int main() ...@@ -515,6 +515,9 @@ int main()
if (xml) if (xml)
xml->drop(); // don't forget to delete the xml reader 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 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 Menu. It is possible to create submenus for every menu item. The call
...@@ -645,7 +648,8 @@ int main() ...@@ -645,7 +648,8 @@ int main()
*/ */
// show about message box and load default model // show about message box and load default model
showAboutText(); if (argc==1)
showAboutText();
loadModel(StartUpModelFile.c_str()); loadModel(StartUpModelFile.c_str());
// add skybox // add skybox
...@@ -660,7 +664,9 @@ int main() ...@@ -660,7 +664,9 @@ int main()
// add a camera scene node // add a camera scene node
Camera[0] = smgr->addCameraSceneNodeMaya(); Camera[0] = smgr->addCameraSceneNodeMaya();
Camera[0]->setFarValue(20000.f);
Camera[1] = smgr->addCameraSceneNodeFPS(); Camera[1] = smgr->addCameraSceneNodeFPS();
Camera[1]->setFarValue(20000.f);
setActiveCamera ( Camera[0] ); setActiveCamera ( Camera[0] );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment