ArgumentParser主要负责命令行参数的读取
#include <osgDB/ReadFile> #include <osgViewer/Viewer> int main(int argc, char **argv) { //命令行参数读取 osg::ArgumentParser arguments(&argc, argv); std::string filename; arguments.read("--model", filename); osg::ref_ptr<osg::Node> root = osgDB::readNodeFile(filename); osgViewer::Viewer viewer; viewer.setSceneData(root.get()); return viewer.run(); }
时间: 2024-10-13 04:45:24