Added osgGA::Device class for integration of both physical and virtual devices.
Added template readFile(..) function to make it more convinient to cast to a specific object type. Added support for osgGA::Device to osgViewer. Added sdl plugin to provides very basic joystick osgGA::Device integration.
This commit is contained in:
@@ -43,9 +43,25 @@ extern OSGDB_EXPORT osg::Object* readObjectFile(const std::string& filename,cons
|
||||
* to read the specified file.*/
|
||||
inline osg::Object* readObjectFile(const std::string& filename)
|
||||
{
|
||||
return readObjectFile(filename,Registry::instance()->getOptions());
|
||||
return readObjectFile(filename, Registry::instance()->getOptions());
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline T* readFile(const std::string& filename, const Options* options)
|
||||
{
|
||||
osg::ref_ptr<osg::Object> object = readObjectFile(filename, options);
|
||||
osg::ref_ptr<T> t = dynamic_cast<T*>(object.get());
|
||||
object = 0;
|
||||
return t.release();
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline T* readFile(const std::string& filename)
|
||||
{
|
||||
return readFile<T>(filename, Registry::instance()->getOptions());
|
||||
}
|
||||
|
||||
|
||||
/** Read an osg::Image from file.
|
||||
* Return valid osg::Image on success,
|
||||
* return NULL on failure.
|
||||
|
||||
Reference in New Issue
Block a user