[osg-users] multiple windows

Alberto Luaces aluaces at udc.es
Thu Oct 25 04:08:14 PDT 2007


Hi Manu,

I'm doing the very same thing, but with two views of a same scene on every 
tab. Currently it works well, but I suspect there are duplicated resources, so 
I have to say that my code is not in its final version.

I'm attaching it, it works for me on Linux and wx 2.6.3 unmodified.

Feel free to compare it with yours so we can learn together :)

HTH,

Alberto

El Thursday 25 October 2007 12:37:45 Emmanuel Roche escribió:
> Hello everyone!
>
> I've got a simple question, but I can't find any practical solution:
>
> In my application, I have to display a notebook with a 3D window on each
> tab... and I want to be able to add/remove tabs dynamically... so, what can
> I use to achieve this result ?
>
> I'm usig wxWidgets + OSG 2.2.0
> I'm on Win XP
>
> I tried with a CompositeViewer :
> - creating the conpositeViewer when requested (so everything should be in
> the wx event handling thread...)
> - building my graphicswindowWX
> - creating a view
> - adding this view to the compositeview
> - relying on an Idle function to call viewer->frame()...
>
> ... this works as long as there is a single tab...  but when I had others,
> then only the last tab added display something : the others only display
> the blue background with no model anymore... ? why that ??
>
> by the way I had to make a small change in the
> GraphicsWindowWx::makeCurrentImplementation() :
>
> bool GraphicsWindowWX::makeCurrentImplementation() {
>   // Bouml preserved body begin 0001FE83
>     if(!GetParent()->IsShown())
>         return false;
>
>     SetCurrent();
>     return true;
>   // Bouml preserved body end 0001FE83
> }
>
> --> So the hidden tabs should return false here... could this be the source
> of the problem ?? (anyway wxWidgets doesn't accept SetCurrent() when the
> corresponding tab is not visible... :-S )
>
> regards !
>
> Thanks for your help !
> Manu.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: main.cpp
Type: text/x-c++src
Size: 4220 bytes
Desc: not available
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20071025/7740ac25/attachment-0003.cpp>


More information about the osg-users mailing list