Show
Ignore:
Timestamp:
08/24/07 11:42:11 (7 years ago)
Author:
robert
Message:

From Mario Valle,

osgviewerWX: "To make the example compile using a wx build non UNICODE based.
Tested on Linux with wxGTK 2.8.4"

osgviewerFOX: "Added removeChore() call in the FOX_OSG_MDIView destructor to get rid of a Trace/BPT trap
error on exit on Linux. BTW this is suggested also in the FOX documentation."

Files:
1 modified

Legend:

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

    r6864 r7283  
    2828    // create osg canvas 
    2929    //    - initialize 
    30      
     30 
    3131 
    3232    int width = 800; 
     
    3535    GraphicsWindowWX* gw = new GraphicsWindowWX(frame, wxID_ANY, wxDefaultPosition, 
    3636                                                wxSize(width, height), wxSUNKEN_BORDER); 
    37      
    38      
     37 
     38 
    3939    osgViewer::Viewer *viewer = new osgViewer::Viewer; 
    4040    viewer->getCamera()->setGraphicsContext(gw); 
     
    4242    viewer->addEventHandler(new osgViewer::StatsHandler); 
    4343    viewer->setThreadingModel(osgViewer::Viewer::SingleThreaded); 
    44          
     44 
    4545    // load the scene. 
    4646    osg::ref_ptr<osg::Node> loadedModel = osgDB::readNodeFile("cow.osg"); 
     
    4949        return false; 
    5050    } 
    51      
     51 
    5252    viewer->setSceneData(loadedModel.get()); 
    5353    viewer->setCameraManipulator(new osgGA::TrackballManipulator); 
     
    8282{ 
    8383    _viewer->frame(); 
    84      
     84 
    8585    event.RequestMore(); 
    8686} 
     
    101101    // default cursor to standard 
    102102    _oldCursor = *wxSTANDARD_CURSOR; 
    103      
     103 
    104104    _traits = new GraphicsContext::Traits; 
    105105    _traits->x = pos.x; 
     
    109109 
    110110    init(); 
    111      
     111 
    112112} 
    113113 
     
    122122        { 
    123123            getState()->setContextID( _traits->sharedContext->getState()->getContextID() ); 
    124             incrementContextIDUsageCount( getState()->getContextID() );    
     124            incrementContextIDUsageCount( getState()->getContextID() ); 
    125125        } 
    126126        else 
     
    149149    int width, height; 
    150150    GetClientSize(&width, &height); 
    151      
     151 
    152152    // update the window dimensions, in case the window has been resized. 
    153153    getEventQueue()->windowResize(0, 0, width, height); 
     
    162162void GraphicsWindowWX::OnKeyDown(wxKeyEvent &event) 
    163163{ 
    164 #if 1 
     164#if wxUSE_UNICODE 
    165165    int key = event.GetUnicodeKey(); 
    166166#else 
    167167    int key = event.GetKeyCode(); 
    168168#endif 
    169     getEventQueue()->keyPress(key);     
     169    getEventQueue()->keyPress(key); 
    170170 
    171171    // propagate event 
     
    175175void GraphicsWindowWX::OnKeyUp(wxKeyEvent &event) 
    176176{ 
    177 #if 1 
     177#if wxUSE_UNICODE 
    178178    int key = event.GetUnicodeKey(); 
    179179#else 
    180180    int key = event.GetKeyCode(); 
    181181#endif 
    182     getEventQueue()->keyRelease(key);     
     182    getEventQueue()->keyRelease(key); 
    183183 
    184184    // propagate event