From a72a929d1208b567f0443e2cd0b58f0128e8b2e2 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 27 Nov 2017 11:05:31 +0000 Subject: [PATCH] Fixed build issues when compiling with OSG_PROVIDE_READFILE to OFF --- examples/osgdeferred/osgdeferred.cpp | 12 ++++++------ examples/osgtext3D/osgtext3D.cpp | 4 +++- examples/osgviewerFLTK/osgviewerFLTK.cpp | 2 +- 3 files changed, 10 insertions(+), 8 deletions(-) diff --git a/examples/osgdeferred/osgdeferred.cpp b/examples/osgdeferred/osgdeferred.cpp index 2343c438e..e7bbbf7e5 100644 --- a/examples/osgdeferred/osgdeferred.cpp +++ b/examples/osgdeferred/osgdeferred.cpp @@ -188,12 +188,12 @@ osg::ref_ptr createSceneRoom() { // Room. osg::ref_ptr room = new osg::MatrixTransform; - osg::ref_ptr roomModel = osgDB::readNodeFile("simpleroom.osgt"); + osg::ref_ptr roomModel = osgDB::readRefNodeFile("simpleroom.osgt"); room->addChild(roomModel); room->setMatrix(osg::Matrix::translate(0, 0, 1)); // Torus. osg::ref_ptr torus = new osg::MatrixTransform; - osg::ref_ptr torusModel = osgDB::readNodeFile("torus.osgt"); + osg::ref_ptr torusModel = osgDB::readRefNodeFile("torus.osgt"); torus->addChild(torusModel); setAnimationPath(torus, osg::Vec3(0, 0, 15), 6, 16); // Torus2. @@ -240,7 +240,7 @@ osg::Geode *createScreenQuad(float width, osg::Texture2D *createTexture(const std::string &fileName) { osg::ref_ptr texture = new osg::Texture2D; - texture->setImage(osgDB::readImageFile(fileName)); + texture->setImage(osgDB::readRefImageFile(fileName)); texture->setWrap(osg::Texture2D::WRAP_S, osg::Texture2D::REPEAT); texture->setWrap(osg::Texture2D::WRAP_T, osg::Texture2D::REPEAT); texture->setFilter(osg::Texture::MIN_FILTER, osg::Texture::LINEAR_MIPMAP_LINEAR); @@ -292,8 +292,8 @@ osg::ref_ptr setShaderProgram(osg::ref_ptr pass, const std::string& frag) { osg::ref_ptr program = new osg::Program; - program->addShader(osgDB::readShaderFile(vert)); - program->addShader(osgDB::readShaderFile(frag)); + program->addShader(osgDB::readRefShaderFile(vert)); + program->addShader(osgDB::readRefShaderFile(frag)); osg::ref_ptr ss = pass->getOrCreateStateSet(); ss->setAttributeAndModes( program.get(), @@ -313,7 +313,7 @@ int main() // Shadowed scene. osg::ref_ptr shadowMap = new osgShadow::SoftShadowMap; shadowMap->setJitteringScale(16); - shadowMap->addShader(osgDB::readShaderFile("shaders/pass1Shadow.frag")); + shadowMap->addShader(osgDB::readRefShaderFile("shaders/pass1Shadow.frag")); shadowMap->setLight(light.get()); osg::ref_ptr shadowedScene = new osgShadow::ShadowedScene; shadowedScene->setShadowTechnique(shadowMap.get()); diff --git a/examples/osgtext3D/osgtext3D.cpp b/examples/osgtext3D/osgtext3D.cpp index 62197139b..15bdbfdc2 100644 --- a/examples/osgtext3D/osgtext3D.cpp +++ b/examples/osgtext3D/osgtext3D.cpp @@ -250,7 +250,9 @@ int main(int argc, char** argv) } if (arguments.read("--add-axes")) - group->addChild(osgDB::readNodeFile("axes.osgt")); + { + group->addChild(osgDB::readRefNodeFile("axes.osgt")); + } std::string mode; if (arguments.read("--character-size-mode", mode)) diff --git a/examples/osgviewerFLTK/osgviewerFLTK.cpp b/examples/osgviewerFLTK/osgviewerFLTK.cpp index e43e9d539..3210148de 100644 --- a/examples/osgviewerFLTK/osgviewerFLTK.cpp +++ b/examples/osgviewerFLTK/osgviewerFLTK.cpp @@ -140,7 +140,7 @@ int main( int argc, char **argv ) osg::ArgumentParser arguments(&argc, argv); // load the scene. - osg::ref_ptr loadedModel = osgDB::readNodeFiles(arguments); + osg::ref_ptr loadedModel = osgDB::readRefNodeFiles(arguments); if (!loadedModel) { std::cout << argv[0] <<": No data loaded." << std::endl;