Show
Ignore:
Timestamp:
01/04/07 15:11:51 (7 years ago)
Author:
robert
Message:

Added Object::resizeGLObjectBuffers(uint) method to help improve the ability
to change the number of active graphics contexts on the fly during an applications
life.

Files:
1 modified

Legend:

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

    r5878 r5882  
    4141    if (gw) 
    4242    { 
    43         osg::notify(osg::NOTICE)<<"  GraphicsWindow has been created successfully."<<gw<<std::endl; 
     43        osg::notify(osg::INFO)<<"  GraphicsWindow has been created successfully."<<gw<<std::endl; 
    4444 
    4545        gw->getEventQueue()->getCurrentEventState()->setWindowRectangle(0, 0, width, height ); 
     
    8181 
    8282 
    83     unsigned int numCameras = 2; 
     83    unsigned int numCameras = 4; 
    8484    double aspectRatioScale = (double)numCameras; 
    8585    double translate_x = double(numCameras)-1; 
     
    8787    { 
    8888        osg::ref_ptr<osg::GraphicsContext::Traits> traits = new osg::GraphicsContext::Traits; 
     89        traits->screenNum = i / 2; 
    8990        traits->x = (i*width)/numCameras; 
    9091        traits->y = 0; 
    9192        traits->width = width/numCameras-1; 
    9293        traits->height = height; 
    93     #if 1 
     94    #if 0 
    9495        traits->windowDecoration = false; 
    9596    #else 
     
    104105        if (gw) 
    105106        { 
    106             osg::notify(osg::NOTICE)<<"  GraphicsWindow has been created successfully."<<gw<<std::endl; 
     107            osg::notify(osg::INFO)<<"  GraphicsWindow has been created successfully."<<gw<<std::endl; 
    107108 
    108109            gw->getEventQueue()->getCurrentEventState()->setWindowRectangle(0, 0, traits->width, traits->height ); 
     
    150151    } 
    151152 
    152     osg::DisplaySettings::instance()->setMaxNumberOfGraphicsContexts(2); 
     153    // osg::DisplaySettings::instance()->setMaxNumberOfGraphicsContexts(4); 
    153154    osg::Referenced::setThreadSafeReferenceCounting(true); 
    154155 
     
    172173    else viewer.setCameraManipulator( new osgGA::TrackballManipulator() ); 
    173174 
    174 #if 0 
     175#if 1 
    175176 
    176177    // singleWindowMultipleCameras(viewer); 
     
    183184    viewer.setUpViewAcrossAllScreens(); 
    184185 
    185 #endif     
     186#endif 
     187 
     188    loadedModel->resizeGLObjectBuffers(osg::DisplaySettings::instance()->getMaxNumberOfGraphicsContexts()); 
     189 
    186190     
    187191    viewer.realize();