Hi, all,
In OSGViewerMFC MDI or SDI, it begin a thread in OnInitialUpdate() of MFC_View:
" mThreadHandle = (HANDLE)_beginthread(&COSG::Render, 0, mOSG)" ,
and in Render(void* ptr) function, it likes this:
while(!viewer->done())
{
osg->PreFrameUpdate();
viewer->frame();
osg->PostFrameUpdate();
}
Well, if i do it with Delta3d in MFC SDI, how to put the Delta3d's function
corresponding to make it work like that ?
I had a try with dtABC::Widget refered to the example "testWidget", then i made
it like this :
1. class MyWidget : public dtABC::Widget
2. void MyWidget::InitWinData(HWND hwnd, int x, int y, int w, int h)
{
dtABC::WinData windata( hwnd, x, y, w, h );
SendMessage( dtABC::Widget::msgWindowData, &windata );
SendMessage( "setpath", &path );
SendMessage( "loadfile", &m_ModelFile );
}
3. void MyWidget::Render(void* ptr)
{
// I don't konw witch function i should put here!
}
4.void CD3DMFCView::OnInitialUpdate()
{
CView::OnInitialUpdate();
m_MyViewWidget->InitWinData();
// Here, should i begin a thread like OSGViewerMFC does in its
OnInitialUpdate() ?
// m_ThreadHandle = (HANDLE)_beginthread(&MyWidget::Render, 0,
m_MyViewWidget); ????????
}
Thank you indeed for your patient....
Best regardes !!!
2008-03-31
Kama
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org