Hi all,

    I'm developing an ActiveX for a web browser using osgViewer. This is the 
configuration that I have used in order to attach the viewer to the window. It 
is included in my main activex control class:
    
    RECT RectDLG;
    GetWindowRect(&RectDLG);

    // Init the GraphicsContext Traits
    osg::ref_ptr<osg::GraphicsContext::Traits> traits = new 
osg::GraphicsContext::Traits;

    // Init the Windata Variable that holds the handle for the Window to 
display OSG in.
    osg::ref_ptr<osg::Referenced> windata = new 
osgViewer::GraphicsWindowWin32::WindowData(GetSafeHwnd());
    
    // Setup the traits parameters
    traits->x = RectDLG.left;
    traits->y = RectDLG.top;
    traits->width = RectDLG.right - RectDLG.left;
    traits->height = RectDLG.bottom - RectDLG.top;
    traits->windowDecoration = false;
    traits->doubleBuffer = true;
    traits->sharedContext = 0;
    traits->setInheritedWindowPixelFormat = true;
    traits->inheritedWindowData = windata;

    // Create the Graphics Context
    osg::GraphicsContext* gc = 
osg::GraphicsContext::createGraphicsContext(traits.get());
    m_SceneView->getCamera()->setViewport(new 
osg::Viewport(0,0,traits->width,traits->height));
    m_SceneView->getCamera()->setProjectionMatrixAsPerspective(30.0f, 
static_cast<double>(traits->width)/static_cast<double>(traits->height), 1.0f, 
10000.0f);
    m_SceneView->getCamera()->setGraphicsContext(gc);

    m_SceneView->setThreadingModel(osgViewer::Viewer::SingleThreaded);

    

The update of the scene is done in the OnPaint function (with 
m_SceneView->frame()). My problem is that the OnPaint function is called but my 
scene is not visually updated.
I think my problem is due to osg doesn't know that the scene is active and i 
need a function as makeCurrent in Producer::RenderSurface. I have seen this 
function in osgViewer it is protected, is there another similar function or 
something that tells osg that the scene is active?

Thank you in advance,

David.
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to