資源簡(jiǎn)介
編譯好的osg的所有例子的原程序 希望對(duì)大家有用

代碼片段和文件信息
#include?
#include?
#include?
#include?
#include?
#include?
void?writeShader(osg::Shader*?shader?const?std::string&?cppFileName?const?std::string&?variableName)
{
????osgDB::ofstream?fout(cppFileName.c_str());
????if?(!fout)
????{
????????std::cout<<“Error:?could?not?open?file?‘“< ????}
????std::string?shaderSource?=?shader->getShaderSource();
????std::string?variableString?=?std::string(“char?“)+variableName+std::string(“[]?=?“);
????
????std::string::size_type?startOfLine?=?0;
????std::string::size_type?endOfLine?=?shaderSource.find_first_of(‘\n‘?startOfLine);
????
????if?(endOfLine==std::string::npos)?
????{
????????fout< ????}
????else
????{
????????std::string?padding(variableString.size()‘?‘);
????????fout< ????????startOfLine?=?endOfLine+1;
????????endOfLine?=?shaderSource.find_first_of(‘\n‘?startOfLine);
????????while?(endOfLine?!=?std::string::npos)
????????{
????????????fout< ????????????startOfLine?=?endOfLine?+?1;
????????????endOfLine?=?shaderSource.find_first_of(‘\n‘?startOfLine);
????????}
????????fout< ????}
????std::cout<<“Written?shader?to?‘“< }
int?main(?int?argc?char?**argv?)
{
????//?use?an?ArgumentParser?object?to?manage?the?program?arguments.
????osg::ArgumentParser?arguments(&argcargv);
????
????//?set?up?the?usage?document?in?case?we?need?to?print?out?how?to?use?this?program.
????arguments.getApplicationUsage()->setApplicationName(arguments.getApplicationName());
????arguments.getApplicationUsage()->setDescription(arguments.getApplicationName()+“?is?a?utility?for?converting?between?various?input?and?output?databases?formats.“);
????arguments.getApplicationUsage()->setCommandLineUsage(arguments.getApplicationName()+“?[options]?filename?...“);
????arguments.getApplicationUsage()->addCommandLineOption(“--shader?““Shader?file?to?create?a?.cpp?file?for.“);
????arguments.getApplicationUsage()->addCommandLineOption(“-h?or?--help““Display?command?line?parameters“);
????//?if?user?request?help?write?it?out?to?cout.
????if?(arguments.read(“-h“)?||?arguments.read(“--help“))
????{?
????????arguments.getApplicationUsage()->write(std::cout);
????????return?1;
????}
????
????std::string?filename;
????if?(arguments.read(“--shader“filename))
????{
????????osg::ref_ptr?shader?=?osgDB::readShaderFile(filename);
????????if?(shader.valid())
????????{
????????????std::string?name?=?osgDB::getStrippedName(filename);
????????????std::string?invalidCharacters?=?“-+/\\*=(){}[]:;<>.?@‘~#‘!\““;
????????????s
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????6136??2009-01-29?14:17??examples\CMakeLists.txt
?????文件?????????85??2008-09-25?16:39??examples\osg2cpp\CMakeLists.txt
?????文件???????3887??2009-02-06?16:27??examples\osg2cpp\osg2cpp.cpp
?????文件????????159??2007-06-25?10:35??examples\osganimate\CMakeLists.txt
?????文件???????9383??2007-06-12?16:20??examples\osganimate\osganimate.cpp
?????文件????????120??2008-11-05?16:45??examples\osganimationmakepath\CMakeLists.txt
?????文件??????12164??2009-01-07?12:24??examples\osganimationmakepath\osganimationmakepath.cpp
?????文件????????112??2008-11-28?15:37??examples\osganimationnode\CMakeLists.txt
?????文件??????11049??2009-01-07?12:24??examples\osganimationnode\osganimationnode.cpp
?????文件????????120??2008-11-05?01:01??examples\osganimationskinning\CMakeLists.txt
?????文件??????10137??2009-02-09?23:59??examples\osganimationskinning\osganimationskinning.cpp
?????文件????????114??2008-11-05?01:01??examples\osganimationsolid\CMakeLists.txt
?????文件???????5045??2009-01-07?12:24??examples\osganimationsolid\osganimationsolid.cpp
?????文件????????120??2008-11-11?20:47??examples\osganimationtimeline\CMakeLists.txt
?????文件???????7982??2009-07-16?13:52??examples\osganimationtimeline\osganimationtimeline.cpp
?????文件???????3480??2008-12-16?21:29??examples\osganimationviewer\AnimtkViewer
?????文件???????6262??2009-01-21?20:02??examples\osganimationviewer\AnimtkViewer.cpp
?????文件???????1438??2008-12-16?21:29??examples\osganimationviewer\AnimtkViewerGUI
?????文件??????11166??2009-01-07?12:24??examples\osganimationviewer\AnimtkViewerGUI.cpp
?????文件???????1410??2008-12-18?14:56??examples\osganimationviewer\AnimtkViewerKeyHandler
?????文件???????2331??2009-02-06?16:27??examples\osganimationviewer\AnimtkViewerKeyHandler.cpp
?????文件????????175??2008-11-05?14:35??examples\osganimationviewer\CMakeLists.txt
?????文件?????????91??2008-11-26?12:23??examples\osgautocapture\CMakeLists.txt
?????文件??????11603??2008-11-27?10:45??examples\osgautocapture\osgautocapture.cpp
?????文件????????135??2007-06-25?10:35??examples\osgautotransform\CMakeLists.txt
?????文件???????6840??2008-03-18?16:37??examples\osgautotransform\osgautotransform.cpp
?????文件????????127??2007-06-25?10:35??examples\osgbillboard\CMakeLists.txt
?????文件???????6438??2007-06-12?16:20??examples\osgbillboard\osgbillboard.cpp
?????文件????????170??2007-06-25?10:35??examples\osgblendequation\CMakeLists.txt
?????文件???????5909??2007-06-12?16:20??examples\osgblendequation\osgblendequation.cpp
............此處省略502個(gè)文件信息
評(píng)論
共有 條評(píng)論