Dear All,
When we try to integrate the OSG rendering context into another Win32/64 window 
via window handle do we need to hook also the message handling mechanism ? If 
so can you give me an example for that ?
Regards,

From: sonyablade2...@hotmail.com
To: osg-users@lists.openscenegraph.org
Date: Sat, 9 Aug 2014 11:32:27 +0100
Subject: [osg-users] Integrating OSG in C::B wxWidgets




Dear All,
I'm trying to integrate the OSG view into wxWidgets actually wxFrame object in 
C::B IDE, I configure the Window handles to match with wxFrame and OSG graphic 
context but I get only a blue screen without cessna loaded. 
I place the code which deals with window handle equalization in a kinda unusual 
way, under the button click, after clicking the button blue screen shows up but 
cessna is not loading, I mean physically the cessna is not loaded,I can not 
spot/testify exactly whether the malfuncitoning is due to the unusual way of 
placing the window handle dealing code under the button click or something else 
? 
So basically is there any workaround to load the object  ?
void wid_testFrame::OnButton1Click(wxCommandEvent& event)    
osg::ref_ptr<osg::Referenced> windata = new 
osgViewer::GraphicsWindowWin32::WindowData( HWND( wxFrame::GetHandle() ) );
    osg::ref_ptr<osg::GraphicsContext::Traits> traits = new 
osg::GraphicsContext::Traits;
    traits->x = 0;    traits->y = 0;    traits->width = 800;    traits->height 
= 600;    traits->windowDecoration = false;    traits->doubleBuffer = true;    
traits->inheritedWindowData = windata;
    osg::ref_ptr<osg::GraphicsContext> gc = 
osg::GraphicsContext::createGraphicsContext( traits.get() );
...........    osg::ref_ptr<osg::Node> load_model = 
osgDB::readNodeFile("cessna.osg");
if (!load_model )    {       ............     /////////////////ALWAYS FALSE     
        }............   viewer.run();                                     

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

Reply via email to