Hi Ulrich, Art ,

Thanks for the answers.

So if I understand well, when the dll is loaded by dynamic_library, the
REGISTER_OSGPLUGIN(...) create a static function, which is stacked in the
registry, just because of the load.
This is just native C++ behaviour, or do I miss some things...  ?

I just want to reproduce that behavior on dll which is not osg based, I can
do similar things just with these informations ?

Thanks.

Regards,
   Vincent.

2009/5/14 Ulrich Hertlein <[email protected]>

> Hi Vincent,
>
> On 14/5/09 10:44 AM, Vincent Bourdier wrote:
>
>> I've just spent some hours running into the osgDB code, and some littles
>> things are more clear but there is the big question I cannot answer :
>>
>> The method
>> DynamicLibrary::PROC_ADDRESS DynamicLibrary::getProcAddress(const
>> std::string& procName)
>>
>> is for me the only one which the loader must use each time a plugin dll
>> have to be loaded.
>> But, there is no utilization, at no place ! So how can the osgDB core
>> find the good methods in the dLL without using this method ?
>> I'm not a c++ master, but for now, I feel lost in the c++ myst ...
>>
>
> Interesting questions!
> Reader/Writers create a static instance
> osgDB::RegisterReaderWriterProxy<CLASS> in their implementation (look for
> the REGISTER_OSGPLUGIN macro, defined in osgDB/Registry).
>
> This static is automatically create when the plugin is loaded.  The
> RegisterReaderWriteProxy constructor creates an object of the appropriate
> class (such as ReaderWriterOBJ) and adds it to the Registry singleton.
>
> So no call to getProcAddress() is necessary.
>
> Hope this helps.
> Cheers,
> /ulrich
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to