Show
Ignore:
Timestamp:
11/21/08 18:44:16 (9 years ago)
Author:
robert
Message:

Added handling of View::LightingMode?

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/src/osgViewer/Renderer.cpp

    r9130 r9208  
    178178    _sceneView[1] = new osgUtil::SceneView; 
    179179 
    180     unsigned int sceneViewOptions = osgUtil::SceneView::HEADLIGHT; 
    181180 
    182181    osg::Camera* masterCamera = _camera->getView() ? _camera->getView()->getCamera() : camera; 
     
    186185    osg::DisplaySettings* ds = _camera->getDisplaySettings() ?  _camera->getDisplaySettings() : 
    187186                               ((view && view->getDisplaySettings()) ?  view->getDisplaySettings() :  osg::DisplaySettings::instance()); 
     187 
     188    unsigned int sceneViewOptions = osgUtil::SceneView::HEADLIGHT; 
     189    if (view) 
     190    { 
     191        switch(view->getLightingMode()) 
     192        { 
     193            case(osg::View::NO_LIGHT): sceneViewOptions = 0; break; 
     194            case(osg::View::SKY_LIGHT): sceneViewOptions = osgUtil::SceneView::SKY_LIGHT; break; 
     195            case(osg::View::HEADLIGHT): sceneViewOptions = osgUtil::SceneView::HEADLIGHT; break; 
     196        } 
     197    } 
    188198 
    189199    _sceneView[0]->setGlobalStateSet(stateset);