15#define OSGDB_READFILE 1
231#ifdef OSG_PROVIDE_READFILE
247inline osg::Object* readObjectFile(
const std::string& filename)
253inline T* readFile(
const std::string& filename,
const Options* options)
256 osg::ref_ptr<T> t =
dynamic_cast<T*
>(
object.get());
262inline T* readFile(
const std::string& filename)
275extern OSGDB_EXPORT osg::Image* readImageFile(
const std::string& filename,
const Options* options);
283inline osg::Image* readImageFile(
const std::string& filename)
295extern OSGDB_EXPORT osg::HeightField* readHeightFieldFile(
const std::string& filename,
const Options* options);
303inline osg::HeightField* readHeightFieldFile(
const std::string& filename)
315extern OSGDB_EXPORT osg::Node* readNodeFile(
const std::string& filename,
const Options* options);
323inline osg::Node* readNodeFile(
const std::string& filename)
333extern OSGDB_EXPORT osg::Node* readNodeFiles(std::vector<std::string>& fileList,
const Options* options);
337inline osg::Node* readNodeFiles(std::vector<std::string>& fileList)
346extern OSGDB_EXPORT osg::Node* readNodeFiles(osg::ArgumentParser& parser,
const Options* options);
350inline osg::Node* readNodeFiles(osg::ArgumentParser& parser)
362extern OSGDB_EXPORT osg::Shader* readShaderFile(
const std::string& filename,
const Options* options);
370inline osg::Shader* readShaderFile(
const std::string& filename)
384 osg::Shader* shader = readShaderFile(filename, options);
395inline osg::Shader* readShaderFile(
osg::Shader::Type type,
const std::string& filename)
406inline osg::Shader* readShaderFileWithFallback(
osg::Shader::Type type,
const std::string& filename,
const Options* options,
const char* fallback)
408 osg::Shader* shader = readShaderFile(filename, options);
410 if (!shader) shader =
new osg::Shader(type, fallback);
418inline osg::Shader* readShaderFileWithFallback(
osg::Shader::Type type,
const std::string& filename,
const char* fallback)
420 return osgDB::readShaderFileWithFallback(type, filename,
Registry::instance()->getOptions(), fallback);
430extern OSGDB_EXPORT osg::Script* readScriptFile(
const std::string& filename,
const Options* options);
438inline osg::Script* readScriptFile(
const std::string& filename)
static Registry * instance(bool erase=false)
Definition ArgumentParser:28
@ UNDEFINED
Definition Shader:99
T * release()
Definition ref_ptr:126
bool valid() const
Definition ref_ptr:120
OSGDB_EXPORT osg::ref_ptr< osg::Node > readRefNodeFile(const std::string &filename, const Options *options)
OSGDB_EXPORT osg::ref_ptr< osg::Object > readRefObjectFile(const std::string &filename, const Options *options)
OSGDB_EXPORT osg::ref_ptr< osg::Script > readRefScriptFile(const std::string &filename, const Options *options)
OSGDB_EXPORT osg::ref_ptr< osg::Shader > readRefShaderFile(const std::string &filename, const Options *options)
OSGDB_EXPORT osg::ref_ptr< osg::Image > readRefImageFile(const std::string &filename, const Options *options)
OSGDB_EXPORT osg::ref_ptr< osg::Shader > readRefShaderFileWithFallback(osg::Shader::Type type, const std::string &filename, const Options *options, const char *fallback)
OSGDB_EXPORT osg::ref_ptr< osg::Node > readRefNodeFiles(std::vector< std::string > &fileList, const Options *options)
osg::ref_ptr< T > readRefFile(const std::string &filename, const Options *options)
Definition ReadFile:50
OSGDB_EXPORT osg::ref_ptr< osg::HeightField > readRefHeightFieldFile(const std::string &filename, const Options *options)
#define OSGDB_EXPORT
Definition osgDB/Export:39