[osg-users] multiple windows

Emmanuel Roche roche.emmanuel at gmail.com
Mon Oct 29 06:06:20 PDT 2007


Hi !

thanks for testing Thibault, if it's working on your side, it's already a
good thing...
I compiled everything in multithreaded DLL, this should be ok... So, as you
suggest, maybe it's a good time to try VS 2005... :-)

Manu.

2007/10/29, Thibault Genessay <tibogens at gmail.com>:
>
> Hi Emmanuel
>
> I've just compiled your mod, and got the sample running.
>
> > Has someone already noticed that, if you remove the "start page" [you
> then
> > create the _auiNotebook the first time it is requested] and for example
> add
> > a Menu with an "Open..." command to load osg models, then each time you
> do
> > this sequence:
> >
> > 1) Open an osg file,
> > 2) Close the only tab created
> > 3) Try to open an other file
> >
> > ... the application crashes...
>
> I can't reproduce this crash on my machine (VS 2005 SP1), everything
> seems to work smoothly.
>
> > Or maybe it's a known issue and that's the very reason why you added the
> > "Start page" and prevented its detruction ?
>
> No, the only reason I did this in the first place is because we would
> have no way to spawn the startup page if we closed it - thus we would
> not be able to add anymore tabs.
> Also, it was a good way to check that we could add any window type as
> a tab - not only osg canvas.
>
> >
> > I can't say if the problem comes from OSG or wxWidgets: sometimes I have
> a
> > crash on osgViewer::View constructor but the debug version doesn't
> display
> > anything useful, and sometines I have the bug in other dlls like ntdll
> for
> > example... if it comes from wxWidgets, maybe that's the reason why you
> are
> > using version 2.9 (I built the application with the version 2.8.4, and
> in
> > non-unicode... so if you when to test this you may have to make small
> > changed in the code I added [every thing is in MainFrame.cpp in fact])
> >
>
> I'd bet the problem is a CRT issue. The bugs in wxAUI I had in the
> past were always triggered inside wxWidgets when you would remove a
> tab, it does not seem to be the case here.
> Have you made sure you used the multithreaded DLL everywhere ? (osg
> does this by default, wxWidgets needs to be compiled in DLL [Unicode]
> mode), and your app must use the multithreaded DLL.
> Also make sure you use the correct preprocessor macros (WXUSINGDLL and
> such).
>
> Bugs that occur at various places are hard to track. One thing you can
> do is regularly check the heap to see if a corruption occurs at some
> point by using the _heapchk() function. If something goes wrong you
> can be notified before the crash occurs (at a random place because the
> memory layout changes from execution to execution).
>
> Finally, try to switch to VS 2005 as the compiler (and the C++
> runtime) contains much less bugs than VS 7.x series.
>
> Cheers
>
> Thibault
>
>
> > regards,
> > Manu.
> >
> >
> > 2007/10/29, Thibault Genessay <tibogens at gmail.com>:
> > > Hi Mario
> > >
> > >
> > > On 10/26/07, Mario Valle <mvalle at cscs.ch> wrote:
> > > > I had to make some addition to have it compiling under VS 7.1 (and
> my wx
> > and osg
> > > > libraries). But beside this, I noticed a strange thing:
> > > > load spaceship.osg (or fountain.osg) and you notice the motor plumes
> > does not animate. If
> > > > you make the model rotate, they start animate again.
> > >
> > > That is quite expected. The update traversal is not normally
> > > triggered, so no updatecallback-based animations can work if the view
> > > is not being updated. If you throw the model, the manipulator calls
> > > requestContinuousUpdate(true) so animations are updated.
> > > If you want to override this behavior, you can call
> > > Canvas::setUpdateWhenIdleOverride(true). You'll get the
> > "normal",
> > > real-time OSG loop.
> > >
> > > The rationale is that GUI based applications more often display static
> > > scenes (e.g. in a 3D modeler, the update is not continuous).
> > >
> > > > It is something related to your OnIdle optimization. If you comment
> the
> > if line, then
> > > > everything animates as usual.
> > > > Hope it helps.
> > >
> > > Glad to see if compiles under 7.1
> > > Thanks for testing
> > >
> > > Thibault
> > >
> > > > Ciao!
> > > >         mario
> > > >
> > > >
> > > > Thibault Genessay wrote:
> > > > > Hi Emmanuel
> > > > >
> > > > > I have made a sample that demonstrate the integration of the OSG
> in
> > > > > wxWidgets. It is a simple frame with a wxAUINotebook containing
> OSG
> > > > > views. You can download source and binaries at
> > > > > http://ips-dil.unil.ch/osg
> > > > >
> > > > > Could you have a look at these and see if this suits your needs ?
> > > > >
> > > > > I am planning to release it as an "official" sample to
> OSG+wxWidgets,
> > > > > so I'll need to test it on more systems (not tested on Linux as of
> > > > > today) and more threading models.
> > > > >
> > > > > It uses a modified version of the osgCompositeViewer::Viewer that
> > > > > skips rendering if makeCurrent() returns false. Currently, the
> > > > > composite viewer ignores the return value of makeCurrent(). We'll
> need
> > > > > to address this issue with Robert as it is precisely the problem
> you
> > > > > and him are discussing in the thread "camera switching in
> composite
> > > > > viewer".
> > > > >
> > > > > Cheers
> > > > >
> > > > > Thibault
> > > > >
> > > > >
> > > > > On 10/26/07, Emmanuel Roche <roche.emmanuel at gmail.com> wrote:
> > > > >> Okay, with this version joined, we have two tabs (not added
> > dynamically,
> > > > >> sure, but it's a beginning...) with animation rendered
> correctly...
> > > > >>
> > > > >> The only issue left is the mouse handling problem:
> > > > >> I added a trackballmanipulator on the view1 on each tab, assigned
> an
> > > > >> handling function to the corresponding wxGLCanvas each time, and
> this
> > > > >> function is indeed called when I drag on the view1 BUT nothing
> > moves...
> > > > >> :-(...
> > > > >>
> > > > >> I'm using view->getEventQueue()... could it be somehow
> "disconnected"
> > ?
> > > > >> nothing happens either if I use the corresponding
> > > > >> graphicswindow->getEventQueue()... so what's left ??
> > > > >>
> > > > >> Manu.
> > > > >>
> > > > >>
> > > > >> 2007/10/26, Emmanuel Roche <roche.emmanuel at gmail.com>:
> > > > >>> Indeed, we are in a situation where the CompositeViewers don't
> share
> > the
> > > > >> GraphicsWindows and everything happen in the same thread... yet,
> it's
> > > > >> currently not working for me:
> > > > >>> as soon as I had a second tab only the last compositeviewer gets
> > updated
> > > > >> and drawn, the others are frozen... :-(...
> > > > >>> I keep investigating...
> > > > >>>
> > > > >>> Manu.
> > > > >>>
> > > > >>>
> > > > >>> 2007/10/26, Robert Osfield < robert.osfield at gmail.com>:
> > > > >>>
> > > > >>>> On 10/26/07, Alberto Luaces <aluaces at udc.es> wrote:
> > > > >>>>> If I recall correctly, you can have as many CompositeViewers
> as
> > you
> > > > >> like/need.
> > > > >>>> If the different viewers don't share any GaphicsWindows then it
> > should
> > > > >>>> be fine to have multiple Viewer/CompositeViewers.
> > > > >>>>
> > > > >>>> However, If all the viewers run in different threads then
> sharing a
> > > > >>>> single scene graph between them would be problematic.  Such
> usage
> > > > >>>> would lead to one viewers update running in parallel with
> another
> > > > >>>> viewer's cull/draw.
> > > > >>>>
> > > > >>>> Robert.
> > > > >>>> _______________________________________________
> > > > >>>> osg-users mailing list
> > > > >>>> osg-users at lists.openscenegraph.org
> > > > >>>>
> > > > >>
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > > > >>>
> > > > >>
> > > > >> _______________________________________________
> > > > >> osg-users mailing list
> > > > >> osg-users at lists.openscenegraph.org
> > > > >>
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > > > >>
> > > > >>
> > > > >>
> > > > > _______________________________________________
> > > > > osg-users mailing list
> > > > > osg-users at lists.openscenegraph.org
> > > > >
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > > > >
> > > >
> > > > --
> > > > Ing. Mario Valle
> > > > Visualization Group                              |
> > http://www.cscs.ch/~mvalle
> > > > Swiss National Supercomputing Centre (CSCS)      | Tel:  +41 (91)
> > 610.82.60
> > > > v. Cantonale Galleria 2, 6928 Manno, Switzerland | Fax:  +41 (91)
> > 610.82.82
> > > > _______________________________________________
> > > > osg-users mailing list
> > > > osg-users at lists.openscenegraph.org
> > > >
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > > >
> > > _______________________________________________
> > > osg-users mailing list
> > > osg-users at lists.openscenegraph.org
> > >
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > >
> >
> >
> > _______________________________________________
> > osg-users mailing list
> > osg-users at lists.openscenegraph.org
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20071029/b61bd7e2/attachment-0003.htm>


More information about the osg-users mailing list