Hi Rick,

On 31/07/09 1:46 AM, Rick Pingry wrote:
I am writing a plugin to handle the "nsm" file type, so my plugin is named
"osgdb_nsm(d).dll".  That is working well, but I have found that my customer 
also uses
the extension "csg" for exactly the same file type.  I would like my plugin to 
be
called for the "csg" extension as well.

I call supportsExtension() in the c'tor for both nsm and csg.  I also override
acceptsExtension() to handle both csg and nsm.  I even made two classes so that 
I could
have:

REGISTER_OSGPLUGIN(nsm, ReaderWriterNSM) REGISTER_OSGPLUGIN(csg, 
ReaderWriterCSG)

all to no avail.  None of it gets called on my "csg" file, but my "nsm" file 
works
fine, presumably because of the filename convention.  I figure there must be a 
way to
do this, since there are the supportsExtension function and virtual 
acceptsExtension
functions.  What am I missing?

Do you create a library 'osgdb_csg.dll'? This is what OSG is looking for if it encounters a request for 'model.csg'.

You can preload osgdb_nsm and after that OSG will pick that for .csg files (because of the 'supportsExtension' call). There should be no need for a separate ReaderWriterCSG class or a separate REGISTER_OSGPLUGIN call.

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

Reply via email to