From 68e1f2a67d73b67e124ba8df479bd432ce3e13a8 Mon Sep 17 00:00:00 2001 From: hybrid Date: Thu, 7 Feb 2008 15:57:49 +0000 Subject: [PATCH] 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 --- examples/09.Meshviewer/main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/examples/09.Meshviewer/main.cpp b/examples/09.Meshviewer/main.cpp index 93c7d19b..3c98b596 100644 --- a/examples/09.Meshviewer/main.cpp +++ b/examples/09.Meshviewer/main.cpp @@ -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,7 +648,8 @@ int main() */ // show about message box and load default model - showAboutText(); + if (argc==1) + showAboutText(); loadModel(StartUpModelFile.c_str()); // add skybox @@ -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] );