Show
Ignore:
Timestamp:
08/27/07 15:33:58 (7 years ago)
Author:
robert
Message:

From Brandon Hamm, changed WxWindows? example to use double buffering

Files:
1 modified

Legend:

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

    r7283 r7307  
    2828    // create osg canvas 
    2929    //    - initialize 
    30  
     30     
    3131 
    3232    int width = 800; 
    3333    int height = 600; 
    3434 
     35    int *attributes = new int[6]; 
     36    attributes[0] = int(WX_GL_DOUBLEBUFFER); 
     37    attributes[1] = WX_GL_RGBA; 
     38    attributes[2] = WX_GL_DEPTH_SIZE; 
     39    attributes[3] = 8; 
     40    attributes[4] = WX_GL_STENCIL_SIZE; 
     41    attributes[5] = 8; 
     42 
    3543    GraphicsWindowWX* gw = new GraphicsWindowWX(frame, wxID_ANY, wxDefaultPosition, 
    36                                                 wxSize(width, height), wxSUNKEN_BORDER); 
    37  
    38  
     44                                                wxSize(width, height), wxSUNKEN_BORDER, wxT("osgviewerWX"), attributes); 
     45     
    3946    osgViewer::Viewer *viewer = new osgViewer::Viewer; 
    4047    viewer->getCamera()->setGraphicsContext(gw); 
     
    96103 
    97104GraphicsWindowWX::GraphicsWindowWX(wxWindow *parent, wxWindowID id, 
    98     const wxPoint& pos, const wxSize& size, long style, const wxString& name) 
    99     : wxGLCanvas(parent, id, pos, size, style|wxFULL_REPAINT_ON_RESIZE, name) 
     105    const wxPoint& pos, const wxSize& size, long style, const wxString& name, int *attributes) 
     106    : wxGLCanvas(parent, id, pos, size, style|wxFULL_REPAINT_ON_RESIZE, name, attributes) 
    100107{ 
    101108    // default cursor to standard