From 34336931fa2993b06df87d68548baf2129aca217 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Mon, 27 Nov 2017 18:28:15 +0000 Subject: [PATCH] Deprecated the osg::Shader::reaDShaderFile() and osg::Shader::loadShaderSourceFromFile() methods. Programmers should use osgDB::readRefShaderFile()/readShaderFile() instead. --- include/osg/Shader | 9 ++++----- src/osg/Shader.cpp | 4 ++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/include/osg/Shader b/include/osg/Shader index fdfbc3f7e..4347cf9a5 100644 --- a/include/osg/Shader +++ b/include/osg/Shader @@ -162,14 +162,13 @@ class OSG_EXPORT Shader : public osg::Object /** Get the const Shader's ShaderBinary, return NULL if none is assigned. */ const ShaderBinary* getShaderBinary() const { return _shaderBinary.get(); } - - /** Read shader source from file and then constructor shader of specified type. - * Return the resulting Shader or 0 if no valid shader source could be read.*/ +#ifdef OSG_USE_DEPRECATED_API + /** Deorecated use osgDB::readRefShaderFile().*/ static Shader* readShaderFile( Type type, const std::string& fileName ); - /** Load the Shader's source code text from a file. */ + /** Deorecated use osgDB::readRefShaderFile(). */ bool loadShaderSourceFromFile( const std::string& fileName ); - +#endif /** The code injection map used when generating the main shader during main shader composition.*/ typedef std::multimap CodeInjectionMap; diff --git a/src/osg/Shader.cpp b/src/osg/Shader.cpp index 4a4309ccd..2b8481e42 100644 --- a/src/osg/Shader.cpp +++ b/src/osg/Shader.cpp @@ -314,7 +314,7 @@ void Shader::setShaderSource( const std::string& sourceText ) dirtyShader(); } - +#ifdef OSG_USE_DEPRECATED_API Shader* Shader::readShaderFile( Type type, const std::string& fileName ) { ref_ptr shader = new Shader(type); @@ -348,7 +348,7 @@ bool Shader::loadShaderSourceFromFile( const std::string& fileName ) delete [] text; return true; } - +#endif const char* Shader::getTypename() const {