Show
Ignore:
Timestamp:
02/02/07 23:30:36 (7 years ago)
Author:
robert
Message:

Convert GraphicsThread/GraphicsOperation? to more generic OperationsThread/Operation?.
This paves the way to running cull traversals in seperate threads.

Updated wrappers

Files:
1 modified

Legend:

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

    r6051 r6088  
    241241} 
    242242 
    243 class TestSupportOperation: public osg::GraphicsOperation 
     243class TestSupportOperation: public osg::Operation 
    244244{ 
    245245public: 
    246246 
    247247    TestSupportOperation(): 
    248         osg::GraphicsOperation("TestSupportOperation",false), 
     248        osg::Operation("TestSupportOperation",false), 
    249249        _supported(true), 
    250250        _errorMessage() {} 
    251251 
    252     virtual void operator () (osg::GraphicsContext* gc) 
    253     { 
    254         osg::notify(osg::NOTICE)<<"Not called"<<std::endl; 
     252    virtual void operator () (osg::Object* object) 
     253    { 
     254        osg::GraphicsContext* gc = dynamic_cast<osg::GraphicsContext*>(object); 
     255        if (!gc) return; 
    255256     
    256257        OpenThreads::ScopedLock<OpenThreads::Mutex> lock(_mutex); 
     
    274275            } 
    275276        } 
    276  
    277         _supported = false; 
    278         _errorMessage = "ERROR: Pllalalal."; 
    279  
     277        else 
     278        { 
     279            _supported = false; 
     280            _errorMessage = "ERROR: GLSL not supported."; 
     281        } 
    280282    } 
    281283         
     
    298300     
    299301    osg::ref_ptr<TestSupportOperation> testSupportOperation = new TestSupportOperation; 
    300  
    301     osgViewer::Viewer::Windows windows; 
    302     viewer.getWindows(windows); 
    303     for(osgViewer::Viewer::Windows::iterator itr = windows.begin(); 
    304         itr != windows.end(); 
    305         ++itr) 
    306     { 
    307         (*itr)->add(testSupportOperation.get()); 
    308     } 
    309  
     302#if 0  
     303    // temporily commenting out as its causing the viewer to crash... no clue yet to why    
     304    viewer.setRealizeOperation(testSupportOperation.get()); 
     305#endif 
    310306    // create the windows and run the threads. 
    311307    viewer.realize();