Show
Ignore:
Timestamp:
07/21/08 17:05:08 (6 years ago)
Author:
robert
Message:

Added --login <url> <username> <password> http authentication.

Files:
1 modified

Legend:

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

    r8610 r8639  
    237237    // use an ArgumentParser object to manage the program arguments. 
    238238    osg::ArgumentParser arguments(&argc,argv); 
     239    arguments.getApplicationUsage()->addCommandLineOption("-v","Set the terrain vertical scale."); 
     240    arguments.getApplicationUsage()->addCommandLineOption("-r","Set the terrain sample ratio."); 
     241    arguments.getApplicationUsage()->addCommandLineOption("--login <url> <username> <password>","Provide authentication information for http file access."); 
    239242    
    240243    // construct the viewer. 
     
    247250    while(arguments.read("-r",sampleRatio)) {} 
    248251 
     252    std::string url, username, password; 
     253    while(arguments.read("--login",url, username, password)) 
     254    { 
     255        if (!osgDB::Registry::instance()->getAuthenticationMap()) 
     256        { 
     257            osgDB::Registry::instance()->setAuthenticationMap(new osgDB::AuthenticationMap); 
     258            osgDB::Registry::instance()->getAuthenticationMap()->addAuthenticationDetails( 
     259                url, 
     260                new osgDB::AuthenticationDetails(username, password) 
     261            ); 
     262        } 
     263    } 
    249264 
    250265    // add all the event handlers to the viewer 
     
    364379    } 
    365380     
     381 
     382 
    366383    // create the windows and run the threads. 
    367384    viewer.realize();