#include <osg/TextureRectangle>
#include <osg/TextureCubeMap>
#include <osgDB/FileUtils>
+#include <osgDB/ReadFile>
#include <boost/lexical_cast.hpp>
#include <boost/tuple/tuple.hpp>
if (imageName.empty()) {
throw BuilderException("no image file");
} else {
- osgDB::ReaderWriter::ReadResult result
- = osgDB::Registry::instance()->readImage(imageName, options);
+ osgDB::ReaderWriter::ReadResult result;
+ result = osgDB::readImageFile(imageName, options);
if (result.success()) {
osg::ref_ptr<osg::Image> image = result.getImage();
image = computeMipmap( image.get(), attrs.get<7>() );
cubeTexture->setWrap(osg::Texture3D::WRAP_T, osg::Texture::CLAMP_TO_EDGE);
cubeTexture->setWrap(osg::Texture3D::WRAP_R, osg::Texture::CLAMP_TO_EDGE);
- osgDB::ReaderWriter::ReadResult result =
- osgDB::Registry::instance()->readImage(_tuple.get<0>(), options);
+ osgDB::ReaderWriter::ReadResult result;
+ result = osgDB::readImageFile(_tuple.get<0>(), options);
if(result.success()) {
osg::Image* image = result.getImage();
cubeTexture->setImage(TextureCubeMap::POSITIVE_X, image);
}
- result = osgDB::Registry::instance()->readImage(_tuple.get<1>(), options);
+ result = osgDB::readImageFile(_tuple.get<1>(), options);
if(result.success()) {
osg::Image* image = result.getImage();
cubeTexture->setImage(TextureCubeMap::NEGATIVE_X, image);
}
- result = osgDB::Registry::instance()->readImage(_tuple.get<2>(), options);
+ result = osgDB::readImageFile(_tuple.get<2>(), options);
if(result.success()) {
osg::Image* image = result.getImage();
cubeTexture->setImage(TextureCubeMap::POSITIVE_Y, image);
}
- result = osgDB::Registry::instance()->readImage(_tuple.get<3>(), options);
+ result = osgDB::readImageFile(_tuple.get<3>(), options);
if(result.success()) {
osg::Image* image = result.getImage();
cubeTexture->setImage(TextureCubeMap::NEGATIVE_Y, image);
}
- result = osgDB::Registry::instance()->readImage(_tuple.get<4>(), options);
+ result = osgDB::readImageFile(_tuple.get<4>(), options);
if(result.success()) {
osg::Image* image = result.getImage();
cubeTexture->setImage(TextureCubeMap::POSITIVE_Z, image);
}
- result = osgDB::Registry::instance()->readImage(_tuple.get<5>(), options);
+ result = osgDB::readImageFile(_tuple.get<5>(), options);
if(result.success()) {
osg::Image* image = result.getImage();
cubeTexture->setImage(TextureCubeMap::NEGATIVE_Z, image);
if (itr != _crossmaps.end())
return itr->second.get();
- osgDB::ReaderWriter::ReadResult result =
- osgDB::Registry::instance()->readImage(texname, options);
+ osgDB::ReaderWriter::ReadResult result;
+ result = osgDB::readImageFile(texname, options);
if(result.success()) {
osg::Image* image = result.getImage();
image->flipVertical(); // Seems like the image coordinates are somewhat funny, flip to get better ones
#include <osg/Geode>
#include <osg/MatrixTransform>
+#include <osgDB/ReadFile>
#include <osgDB/WriteFile>
#include <osgDB/Registry>
#include <osg/Switch>
texturepath = texturepath.dir();
options->setDatabasePath(texturepath.str());
- osgDB::ReaderWriter::ReadResult modelResult
- = osgDB::Registry::instance()->readNode(modelpath.str(),
- options.get());
+ osgDB::ReaderWriter::ReadResult modelResult;
+ modelResult = osgDB::readNodeFile(modelpath.str(), options.get());
if (!modelResult.validNode())
throw sg_io_exception("Failed to load 3D model:" + modelResult.message(),
modelpath.str());