Hmmm okay... i've just looked at the definition of USE_OSGPLUGIN(...) and I
finally understood what you mean by "static object" to register the
plugin...

By the way, the difference between you and me could be the compiler: I'm
using gcc-4.1.2 with a target=i686-pc-linux-gnu... i'm on FedoraCore 6,
kernel 2.6.18, and running this in VMWare workstation 5.5.3 with a WinXP
host computer.


Manu.



2007/6/1, Emmanuel Roche <[EMAIL PROTECTED]>:

Hi Robert !

Sorry I took so long to answer, I was absent for a few days :-). Any way,
I tried the changes you made :

- The compilation went fine, osgstaticviewer was created,
- First I noticed the function graphicwindow_X11 was commented in
osgstaticviewer.cpp,
- This function also had an empty body in GraphicWindowX11.cpp, I simply
added something like osg::GraphicsContext:setWindowingSystemInterface(new
X11WindowingSystemInterface);

And this worked for me... I tryed to start osgstaticviewer multiple times
with an .ive file and had no particular error...


if i can make a small suggestion by the way: wouldn't it be more logical
to simply have a "graphicwindow()" function (and a more friendly function
name or a MACRO could be even better...) rather than "graphicwindow_X11()"
--> we could then define this same function in GraphicWindowX11.cpp,
GraphicWindowWin32.cpp, etc... as only a single .o file is linked there
should be no conflict no ? and we would hide implementation details for this
default windowing system to the users... (they would not have to change the
function they call depending on the platform used...).

Any way, concerning your sudden pointer reset, I've trully never seen this
and have now clue either.... (try a linux reboot  maybe :-D )...


Manu.


2007/5/25, Robert Osfield < [EMAIL PROTECTED]>:
>
> Hi Manu,
>
> I have done some experiments with the static build side, and while its
> not a full solution, I've checked in a few additions.  First up is
> some additions to osgDB that add a proxy help class and a couple of
> macros. The first macro replaces the old Proxy object usage in the
> plugin, for the ive plugin it now looks like:
>
> // now register with Registry to instantiate the above
> // reader/writer.
> REGISTER_OSGPLUGIN(ive, ReaderWriterIVE)
>
> This both constructs the C++ proxy and provides the extern "C" void
> osgdb_ive(void) function.
>
> Then in the application you now add:
>
> #include<...>
>
> USE_OSGPLUGIN(ive)
>
> main(...)
> {
> ...
> }
>
> Note, the macro doesn't require you to add the function call to the
> main.  This is thanks the USE_OSGPLUGIN use a local C++ proxy object
> to call it for you automatically.
>
> I also copied and pasted osgviewer app across to example and called it
> osgstaticviewer, this example only builds during static build.  It
> includes the extra plugin link line in the CMakeLists.txt as well as
> the above USE_OSGPLUGIN(ive).  It'll need further expanding on in
> future.
>
> I have also add a C function into GraphicsWindowX11.cpp call void
> graphicswindow_X11(void), and calling of this in osgstaticviewer's
> main but while it does cause the GraphicsWindowX11.o to be linked and
> even the proxies to register the WindowSystemInterfaceX11, the related
> static pointer in src/osg/GraphicsContext.cpp resets itself to 0 for
> some unknown reason, programatically its never reset to 0, it just
> happens?#!.   I have now clue why it doesn't work.
>
> Anyway, what I've checked in might inch us closer to a final easing of
> making static apps.
>
> Robert.
> _______________________________________________
> osg-users mailing list
> osg-users@openscenegraph.net
> http://openscenegraph.net/mailman/listinfo/osg-users
> http://www.openscenegraph.org/
>


_______________________________________________
osg-users mailing list
osg-users@openscenegraph.net
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to