|Version 5 (modified by XenonofArcticus, 4 years ago)|
Views and Viewers
When choosing an OpenSceneGraph provided Viewer, one has two choices: Viewer or CompositeViewer. Both are derived off of osgViewer::ViewerBase. ViewerBase provides functionality such as controlling stats, threading, and frame calls.
osgViewer::Viewer along with being a ViewerBase is also a View. This simplifies the setup and interface if one is interested in a single view.
osgViewer::CompositeViewer, in contrast with Viewer, actually contains a list of multiple Views. This gives more versatility to the programmer but with more work to access View functionality.
Which Viewer to Use
So which Viewer class is right for your app? This is discussed in detail on this page.
Event and Pick Handling
TODO: This is just a stub.
Windows are created for each GraphicsContext created. When using some of helper funcions for osgView::View, such as setUpViewAcrossAllScreens(), setUpViewOnSingleScreen(), or setUpViewInWindow(), the graphics context with a new window will be created for each call. Therefore, using some combination of these calls with a CompositeViewer with multiple Views would produce multiple windows. If one did not want multiple windows or maybe didn't want window decorations, one can setup the Traits themselves. A single window with multiple views can be achieved by setting Traits::sharedContext to a previously created context. And, the decorations can be turned of with Traits::windowDecoration set to false.