20,741
edits
mNo edit summary |
m (http://forum.flightgear.org/viewtopic.php?f=6&t=24933&p=231949#p231949) |
||
| Line 5: | Line 5: | ||
}} | }} | ||
{{FGCquote | |||
|The splash init routine seems to contain other init, code too - see: [https://gitorious.org/fg/flightgear/source/b485fa8a0d00a0c93d73e7c68713a0549da0a5cc:src/Viewer/renderer.cxx#L432 https://gitorious.org/fg/flightgear/sou ... r.cxx#L432]This is also where you can see that CompositeViewer isn't currently being used at all. | |||
|{{cite web |url=http://forum.flightgear.org/viewtopic.php?p=231949#p231949 | |||
|title=<nowiki>Re: How to create 2 master camera and 2 views in flightgear</nowiki> | |||
|author=<nowiki>Hooray</nowiki> | |||
|date=<nowiki>Thu Feb 12</nowiki> | |||
}} | |||
}} | |||
<syntaxhighlight lang="cpp" line start="435" highlight="449" enclose="div"> | |||
void | |||
FGRenderer::splashinit( void ) | |||
{ | |||
// important that we reset the viewer sceneData here, to ensure the reference | |||
// time for everything is in sync; otherwise on reset the Viewer and | |||
// GraphicsWindow clocks are out of sync. | |||
osgViewer::Viewer* viewer = getViewer(); | |||
viewer->setName("osgViewer"); | |||
_viewerSceneRoot = new osg::Group; | |||
_viewerSceneRoot->setName("viewerSceneRoot"); | |||
viewer->setSceneData(_viewerSceneRoot); | |||
ref_ptr<Node> splashNode = fgCreateSplashNode(); | |||
if (_classicalRenderer) { | |||
_viewerSceneRoot->addChild(splashNode.get()); | |||
} else { | |||
for ( CameraGroup::CameraIterator ii = CameraGroup::getDefault()->camerasBegin(); | |||
ii != CameraGroup::getDefault()->camerasEnd(); | |||
++ii ) | |||
{ | |||
CameraInfo* info = ii->get(); | |||
Camera* camera = info->getCamera(DISPLAY_CAMERA); | |||
if (camera == 0) continue; | |||
camera->addChild(splashNode.get()); | |||
} | |||
} | |||
_frameStamp = new osg::FrameStamp; | |||
viewer->setFrameStamp(_frameStamp.get()); | |||
// Scene doesn't seem to pass the frame stamp to the update | |||
// visitor automatically. | |||
_updateVisitor->setFrameStamp(_frameStamp.get()); | |||
viewer->setUpdateVisitor(_updateVisitor.get()); | |||
fgSetDouble("/sim/startup/splash-alpha", 1.0); | |||
} | |||
</syntaxhighlight> | |||
== Background == | == Background == | ||
{{FGCquote | {{FGCquote | ||