From Art Trevs, add support for saving external shader files.

From Robert Osfield, adding missing member variable initializes and Output::getShaderFileNameForOutput() implementation
This commit is contained in:
Robert Osfield
2008-03-04 14:04:48 +00:00
parent 02b52cb73a
commit c4d07194a2
22 changed files with 515 additions and 19 deletions

View File

@@ -105,6 +105,26 @@ inline bool writeNodeFile(const osg::Node& node, const std::string& filename)
return writeNodeFile( node, filename, Registry::instance()->getOptions() );
}
/** Write an osg::Shader to file.
* Return true on success,
* return false on failure.
* Use the Options object to control cache operations and file search paths in osgDB::Registry.
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to write the specified file.*/
extern OSGDB_EXPORT bool writeShaderFile(const osg::Shader& shader, const std::string& filename, const ReaderWriter::Options* options );
/** Write an osg::Shader to file.
* Return true on success,
* return false on failure.
* The osgDB::Registry is used to load the appropriate ReaderWriter plugin
* for the filename extension, and this plugin then handles the request
* to write the specified file.*/
inline bool writeShaderFile(const osg::Shader& shader, const std::string& filename)
{
return writeShaderFile( shader, filename, Registry::instance()->getOptions() );
}
}
#endif