void cOSG::Render(void ptr)
{
cOSG* osg = (cOSG*)ptr;
osgViewer::Viewer* viewer = osg->getViewer();
// You have two options for the main viewer loop
// viewer->run() or
// while(!viewer->done()) { viewer->frame(); }
//viewer->run();
while(!viewer->done())
{
osg->PreFrameUpdate();
viewer->frame();
osg->PostFrameUpdate();
//Sleep(10); // Use this command if you need to allow other processes to have cpu time
}
// For some reason this has to be here to avoid issue:
// if you have multiple OSG windows up
// and you exit one then all stop rendering
// AfxMessageBox("Exit Rendering Thread");
_endthread();
}
debug提示:error C4716: 'cOSG::Render' : must return a value