Show
Ignore:
Timestamp:
05/12/10 13:37:27 (5 years ago)
Author:
robert
Message:

Fixes for building OSG with OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION set to OFF.

Fixed copy and paste error in Camera::getImplicitBufferAttachmentResolveMask().

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osgfpdepth/osgfpdepth.cpp

    r11367 r11420  
    405405    textInverted->addDrawable(inverted); 
    406406    textInverted->setNodeMask(~0u); 
    407     textProjection->addChild(textInverted); 
     407    textProjection->addChild(textInverted.get()); 
    408408    textProjection->getOrCreateStateSet()->setRenderBinDetails(11, "RenderBin"); 
    409409} 
     
    642642{ 
    643643    gc->resizedImplementation(x, y, width, height); 
    644     makeTexturesAndGeometry(width, height, _appState->sw); 
     644    makeTexturesAndGeometry(width, height, _appState->sw.get()); 
    645645    _appState->setStateFromConfig(validConfigs[_appState 
    646646                                               ->currentConfig]); 
     
    694694    } 
    695695 
    696     DisplaySettings* ds = viewer.getDisplaySettings(); 
    697     if (!ds) 
    698         ds = DisplaySettings::instance(); 
     696    DisplaySettings* ds = viewer.getDisplaySettings() ? viewer.getDisplaySettings() : DisplaySettings::instance().get(); 
    699697    GraphicsContext::ScreenIdentifier si; 
    700698    si.readDISPLAY(); 
     
    770768    BufferConfigList depthConfigs; 
    771769    vector<int> coverageConfigs; 
    772     getPossibleConfigs(gc, colorConfigs, depthConfigs, coverageConfigs); 
     770    getPossibleConfigs(gc.get(), colorConfigs, depthConfigs, coverageConfigs); 
    773771    int coverageSampleConfigs = (coverageConfigs.size() - 4) / 2; 
    774772    cout << "color configs\nname\tbits\n"; 
     
    787785                             colorItr->bits, depthItr->bits); 
    788786            FboData data; 
    789             if (createFBO(gc, config, data)) 
     787            if (createFBO(gc.get(), config, data)) 
    790788                validConfigs.push_back(config); 
    791             destroyFBO(gc, data); 
     789            destroyFBO(gc.get(), data); 
    792790            if (coverageConfigs.size() > 0) 
    793791            { 
     
    814812                    config.name = msText.str(); 
    815813 
    816                     if (createFBO(gc, config, data)) { 
     814                    if (createFBO(gc.get(), config, data)) { 
    817815                        validConfigs.push_back( config); 
    818816                    } 
    819                     destroyFBO(gc, data); 
     817                    destroyFBO(gc.get(), data); 
    820818                } 
    821819            } 
     
    886884        camera->attach(Camera::DEPTH_BUFFER, config.depthFormat); 
    887885    else if (config.depthFormat == GL_DEPTH_COMPONENT24) 
    888         camera->attach(Camera::DEPTH_BUFFER, depthTexture24); 
     886        camera->attach(Camera::DEPTH_BUFFER, depthTexture24.get()); 
    889887    else 
    890         camera->attach(Camera::DEPTH_BUFFER, depthTexture); 
     888        camera->attach(Camera::DEPTH_BUFFER, depthTexture.get()); 
    891889} 
    892890 
     
    912910        depthTexture = depthTexture24; 
    913911    sw->removeChildren(0, sw->getNumChildren()); 
    914     sw->addChild(createTextureQuad(colorTexture)); 
    915     sw->addChild(createTextureQuad(depthTexture)); 
    916     sw->addChild(createTextureQuad(depthTexture24)); 
     912    sw->addChild(createTextureQuad(colorTexture.get())); 
     913    sw->addChild(createTextureQuad(depthTexture.get())); 
     914    sw->addChild(createTextureQuad(depthTexture24.get())); 
    917915    sw->setSingleChildOn(0); 
    918916    return sw; 
     
    966964    optimizer.optimize(loadedModel.get()); 
    967965    // creates texture to be rendered 
    968     Switch* sw = makeTexturesAndGeometry(width, height, appState->sw); 
     966    Switch* sw = makeTexturesAndGeometry(width, height, appState->sw.get()); 
    969967    ref_ptr<Camera> rttCamera = makeRttCamera(gc, width, height); 
    970968    rttCamera->setRenderOrder(Camera::PRE_RENDER); 
    971     viewer.addSlave(rttCamera); 
     969    viewer.addSlave(rttCamera.get()); 
    972970    appState->camera = rttCamera; 
    973971    // geometry and slave camera to display the result 
    974972    Group* displayRoot = new Group; 
    975973    displayRoot->addChild(sw); 
    976     displayRoot->addChild(appState->textProjection); 
     974    displayRoot->addChild(appState->textProjection.get()); 
    977975    StateSet* displaySS = displayRoot->getOrCreateStateSet(); 
    978976    displaySS->setMode(GL_LIGHTING, StateAttribute::OFF); 
     
    991989    texCamera->setProjectionResizePolicy(Camera::FIXED); 
    992990    viewer.addSlave(texCamera, Matrixd(), Matrixd(), false); 
    993     viewer.addEventHandler(new ConfigHandler(appState)); 
     991    viewer.addEventHandler(new ConfigHandler(appState.get())); 
    994992 
    995993    // add model to the viewer.