Hi Akos The Canvas class derives from wxGLCanvas, and is the glue between the OSG and wxWidgets. It defines two child classes: View and GraphicsContext.
Canvas::GraphicsContext derives from osgViewer::GraphicsWindow (pure virtual). The OSG uses the GraphicsWindow to actually create the window, showing it and query its status. There is not much to do in the wxWidgets situation because the window itself is the Canvas. The Canvas *could* have derived from both wxGLCanvas and osgViewer::GraphicsContext, but since wxWidgets does not like multiple inheritance for controls, I have chosen to create the child class Canvas::GraphicsContext that mostly forwards the call to the Canvas. This is also why the Canvas::GraphicsContext is private - the user does not need to care about it. Canvas::View derives from osgViewer::View (pure virtual too). An OSG window can display multiple, independent views. The camera, manipulators and all other view-dependent features are part of the view. The view is also responsible for querying the graphics subsystem to redraw the window and continuously update it. To my current understanding, only osgGA::Manipulators actually perform those queries. If your application needs it (e.g. if your physics model is dependent on the OSG update traversal) you should also request redraws/continuous updates from your OSG code. The Canvas::View respond to those requests by asking wxWidgets to redraw the window - continuously through idle events or a single time. Have a look at the headers of osgViewer::GraphicsContext and osgViewer::View to have a more in-depth understanding of their roles. The simulation problem is quite unrelated. As Robert says, a real simulation should run at a constant frame rate. If your application is not a CAD software (or alike) and always needs redraws, you can use the method Canvas::setUpdateWhenIdleOverride(true). This will continuously update the window, thereby recreating the "normal" OSG loop. Be certain that it will be slower than a pure OSG application, though. Thibault On Nov 16, 2007 11:58 AM, Ákos Maróy <[EMAIL PROTECTED]> wrote: > Mario Valle wrote: > > No, methods from TrackballManipulator help you in understanding when you > > are interacting > > with the viewer and so when you need to call frame(). > > I'm looking at it, it's in the Canvas class, which is a descendant of > wxGLCanvas - which is not an OSG class, or is it? > > > > Akos > > _______________________________________________ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > _______________________________________________ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org