Hi Bram,



On 16 July 2014 19:58, Bram Vaessen <[email protected]> wrote:

>
> -What are the steps that are involved in building the libraries, and
> loading them as plugins?
>

Have look at the Getting started and Platform specifics documentation on
the website:

   www.openscenegraph.org/index.php/documentation/getting-started
   www.openscenegraph.org/index.php/documentation/platform-specifics

The books will also provide guidance.

You should just need to provide the 3rd party dependencies and make sure
that CMake finds them OK and then build the OSG.

Loading wise you need to make sure either the PATH or OSG_LIBRARY_PATH env
var points to the parent directory of the osgPlugins-version directory that
you have built or installed. The OSG will then at runtime search for the
plugins and load them dynamically.

To see where the OSG is searrching for the plugins enable verbose debug out
by settings the env var OSG_NOTIFY_LEVEL to DEBUG and then look at the
console output, this will list what plugins it's trying to load and what
files it's trying to load.

The env var OSG_FILE_PATH is used to guide the searching of files.

You can also set the library and file search paths programatically via
osgDB::setDataFilePathList(..) and setLibraryFilePathList(..). See the
include osgDB/FileUtils.


-In each of these steps what files are supposed to be created and how can
> you check if that happened etc.?
>

All the plugins will be built as .dll's under windows and .so's under other
platforms and will be placed in a osgPlugins-version directory.  The OSG
will search for osgPlugins-version/osgdb_extension.dll/.so directory first
by default to avoid issues with different versions of the OSG/plugins being
binary incompatible (and issue known widely in the compute industry as DLL
hell.)  For this reason you should set the library path to the parent
directory where the osgPlugins-version directory rather than to the
directory itself, otherwise you could end up finding plugins for a
different version of the OSG.


> -how can you get more error information from the failing the loading of
> the plugin?
>

setting the OSG_NOTIFY_LEVEL to DEBUG will tell the OSG to output lots of
info to console, search through this to find references to the file loading.

--

As a general note, the OSG plugin system uses the Chain of Responsibility
Design Pattern, this scheme means that it tries all loaded plugins to see
if they can load a file before checking the file system for plugins that
may be able to load the plugin.  This scheme means that you can provide a
single plugin to load multiple formats, such as used in the Quicktime
plugin.  Another aspect to the scheme is that finding and loading of files
is deferred to the plugins, something that is important when handling files
accessed by http etc.  This loose coupling is very powerful, but it does
mean there isn't always 1:1 mapping between a file format extension and a
plugin, which is part of the reason why the OSG error reporting system
can't always be specific about what error there might be.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to