Hi Markus,
the code works great. The frame update through OSG methods is much
faster than using FOX's FXGLCanvas::makeCurrent(), no idea why.
I also tried to use one common FXGLVisual for all GraphicsWindowFOX's,
like in FOX's glviewer example. Works fine, initialization is much
faster of course.
Many thanks!
Tomas
Markus Hein napsal(a):
> Hi Tomas,
>
> today I could check how I implemented the frame-update for multiple Windows
> under Win32. It is done like this:
>
>
> long FOX_OSG_MDIView::OnIdle(FXObject *sender, FXSelector sel, void* ptr)
> {
>
> if(m_osgViewer.valid() )
> {
>
> if(m_osgViewer->getCamera()->getGraphicsContext()->makeCurrent())
> {
> m_osgViewer->frame();
>
> m_osgViewer->getCamera()->getGraphicsContext()->releaseContext();
> }
>
>
> }
>
> getApp()->addChore(this, ID_CHORE);
>
> return 1;
> }
>
>
>
> I justed checked if multiple Windows are updated correctly, but I havn't done
> further testings on this. Also tested resizing and closedown of some of the
> viewer-windows. it worked so long without probsunder win32.
>
>
>
> just instantiate multiple views like this:
>
> FOX_OSG_MDIView* mdichild;
>
> for(int i = 0 ; i < 2; i++)
> {
> for(int j = 0 ; j < 2; j++)
> {
> mdichild=new
> FOX_OSG_MDIView(__sharedScene.get(),mdiclient,"FOX osgViewer", NULL,
> mdimenu,MDI_TRACKING,10+(640*i),10+(480*j),640,480); //not MDI_MAXIMIZED!
>
> }
> }
>
> mdichild->setFocus();
> mdiclient->setActiveChild(mdichild);
>
>
> the GUI update mechanism is independent from the render-main-loops, so you
> will get stable update rates in the viewer windows. I'm running each of the
> viewer windows with stable frequency of 50 Hz, while the gui is also updated,
> but at very low frequency.
>
> Updating your osg related stuff is easy in fox (same as in qt, fltk,
> wxwindows etc.):
> simply create datatargets used by the gui-widgets, connect them with your
> application data make your application data accessible by update-callbacks
> and uniform-callbacks in osg.
>
> It works fine for me so long.
>
> Markus
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org