Hi Terry,
On 9 January 2012 18:35, Terry Welsh <[email protected]> wrote:
> Ideally, I would like to have total control over the paths to search
> just using environment variables, but I don't see a way to do this.
> Are there any ways to control the plugin search paths other than with
> setLibraryFilePathList() and OSG_LIBRARY_PATH? Would it be alright to
> modify or amend the way OSG searches plugin paths? Maybe we can come
> up with something more flexible.
Something like the FindFileCallback found in include/osgDB/Callbacks?
You can assign a FindFileCallback to osgDB::Options or the Registry.
class OSGDB_EXPORT FindFileCallback : public virtual osg::Referenced
{
public:
virtual std::string findDataFile(const std::string& filename,
const Options* options, CaseSensitivity caseSensitivity);
virtual std::string findLibraryFile(const std::string&
filename, const Options* options, CaseSensitivity caseSensitivity);
protected:
virtual ~FindFileCallback() {}
};
I don't recall using it in conjunction with loading libraries but as
there is the findLibraryFile method I guess I must have thought about
it! Below is my svn entry from 2009 for include/osgDB/Options.
-- svn entry for include/osgDB/Options:
r10171 | robert | 2009-05-09 09:49:27 +0100 (Sat, 09 May 2009) | 8 lines
Refactored the Registry::ReadFileCallback, WriteFileCallback and
ReaderWriter::Options to they are now defined in their own header and
in the osgDB namespace.
Introduced a new FindFileCallback to Registry to compliement the
existing ReadFileCallback and WriteFileCallback.
Added support for assign Find, Read and WriteFileCallbacks to
osdDB::Options to enable plugins/applications to override the
callbacks just for that
read/write call and any nested file operations
--
Hope this helps,
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org