Show
Ignore:
Timestamp:
01/16/08 16:07:40 (1 year ago)
Author:
cneumann
Message:

changed: - factory functions return a TransitPtr? that can not be implicitly

converted to C Ptr. Should help with porting.

added: - GlobalRefPtr?, needed for cases where upon return from main

a RefPtr? goes out of scope (it would attempt to access the
FCFactory which is already shutdown at that point).

status: - vrml loader does not compile (needs porting to ref ptr)

  • tutorials compile, run and exit cleanly
  • multithreading and cluster are untested, yet
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/Carsten_PtrWork2/Tutorials/28SortLastClusterClient.cpp

    r835 r1039  
    6464int main(int argc, char **argv) 
    6565{ 
    66     char     *opt; 
    67     NodePtr   scene=NullFC
     66    char              *opt; 
     67    NodeGlobalRefPtr   scene
    6868 
    6969    // OSG init 
     
    7474 
    7575    // the connection between this client and the servers 
    76     SortLastWindowPtr mwin= SortLastWindow::create(); 
    77  
    78     // all changes must be enclosed in beginEditCP and endEditCP 
    79     // otherwise the changes will not be transfered over the network. 
     76    SortLastWindowGlobalRefPtr mwin = SortLastWindow::create(); 
    8077 
    8178    // evaluate params 
     
    106103                          break; 
    107104                case 'L': 
    108                     mwin->setComposer(PipelineComposer::create()); 
     105                    mwin->setComposer(ImageComposerRefPtr(PipelineComposer::create())); 
    109106                    break; 
    110107                case 'B': 
    111                     mwin->setComposer(BinarySwapComposer::create()); 
     108                    mwin->setComposer(ImageComposerRefPtr(BinarySwapComposer::create())); 
    112109                    break; 
    113110                case 'P': 
    114                     mwin->setComposer(ParallelComposer::create()); 
     111                    mwin->setComposer(ImageComposerRefPtr(ParallelComposer::create())); 
    115112                    break; 
    116113                default:  std::cout << argv[0]   
     
    134131    if(mwin->getComposer() == NullFC) 
    135132    { 
    136         mwin->setComposer(PipelineComposer::create()); 
     133        mwin->setComposer(ImageComposerRefPtr(PipelineComposer::create())); 
    137134    } 
    138135 
     
    144141    // Create/set the client window that will display the result 
    145142     
    146     GLUTWindowPtr clientWindow = GLUTWindow::create(); 
     143    GLUTWindowGlobalRefPtr clientWindow = GLUTWindow::create(); 
    147144     
    148145    glutReshapeWindow(300,300); 
     
    160157    if(scene == NullFC) 
    161158    { 
    162         scene = makeNodeFor(Group::create()); 
    163  
    164         scene->addChild(makeTorus(.5, 2, 16, 16)); 
    165         scene->addChild(makeCylinder(1, .3, 8, true, true, true)); 
     159        scene = makeNodeFor(GroupRefPtr(Group::create())); 
     160 
     161        scene->addChild(NodeRefPtr(makeTorus(.5, 2, 16, 16))); 
     162        scene->addChild(NodeRefPtr(makeCylinder(1, .3, 8, true, true, true))); 
    166163    } 
    167164     
     
    231228        case 27:     
    232229        { 
     230            delete mgr; 
     231         
    233232            OSG::osgExit(); 
    234233            exit(0);