[osg-users] porting from osg-3.4.0 to osg-3.6.3

Herman Varma hermanvarma at eastlink.ca
Sun Oct 7 10:21:20 PDT 2018


Hi Robert

I followed your advice and used the Simple app in VTP with Debug statements.
I compared the debug statements wit those osg-3.4.0.

I was able to track it down to this section

      while (!viewer->done())
	{
		vtGetScene()->DoUpdate();		// calls
viewer::frame
	}
In 3.4.0 it executes and in 3.6.3 it bombs on

vtGetScene()->DoUpdate();


DoUpdate() is defined by vs2017 as void VTScene::DoUpdate() backward
compatibility

Also
viewer->done() value has a bool value of 0 at the bomb instant.


Full code below

int main(int argc, char ** argv)
{
#if WIN32 && defined(_MSC_VER) && VTDEBUG
	// sometimes, MSVC seems to need to be told to show unfreed memory
on exit
	_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
#endif

	// Log messages to make troubleshooting easier
	VTSTARTLOG("debug.txt");
	VTLOG("osgViewerSimple\n");

	// Make a scene and a viewer:
	vtGetScene()->Init(argc, argv);
	osgViewer::Viewer *viewer = vtGetScene()->getViewer();

	// Add a handler for GUI events.
	osg::ref_ptr<vtOSGEventHandler> pHandler = new vtOSGEventHandler;
	viewer->addEventHandler(pHandler);

	// We must call realize to be certain that a display/context is set
up.
	viewer->realize();

	// Tell our scene about OSG's context.
	
vtGetScene()->SetGraphicsContext(viewer->getCamera()->getGraphicsContext());

	// Only then can we safely get window size.
	vtGetScene()->GetWindowSizeFromOSG();

	printf("Creating the terrain..\n");
	CreateScene();

	printf("Running..\n");

	VTLOG("Getscene Loop %d\n", (int)viewer->done());

	while (!viewer->done())
	{
		vtGetScene()->DoUpdate();		// calls
viewer::frame
	}
	
	VTLOG("Done Updatescene.\n");

	g_terrscene->CleanupScene();
	delete g_terrscene;

	vtGetScene()->Shutdown();

	return 0;
}


Thanks
------------------------------

Message: 2
Date: Thu, 04 Oct 2018 15:31:14 +0200
From: "Herman Varma" <hermanvarma at eastlink.ca>
To: osg-users at lists.openscenegraph.org
Subject: Re: [osg-users] Problems porting from osg-3.4.0 to osg-3.6.0
Message-ID: <1538659874.m2f.75036 at forum.openscenegraph.org>
Content-Type: text/plain; charset=UTF-8

Hi,


I have upgraded the vtp code to osg 3.6.3
Everything compiled and linked properly. However I still have some execution
problems.

I just want to check if  the code below is coded properly

FQuat TransformExtension::GetOrient() const
{
	const osg::Matrix &xform = m_pTransform->getMatrix();
	osg::Quat q;

//	xform.get(q);   
// Replacing xform.get(q) 
// with
	q = xform.getRotate();

	return FQuat(q.x(), q.y(), q.z(), q.w());
}

... 

Thank you!

Cheers,
Herman

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=75036#75036







------------------------------

Subject: Digest Footer

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


------------------------------

End of osg-users Digest, Vol 136, Issue 4
*****************************************



More information about the osg-users mailing list