DemoEntityManager::DemoEntityManager(NewtonDemos* const parent)
	:wxGLCanvas(parent, wxID_ANY, m_attributes, wxDefaultPosition, wxSize(300, 300), wxSUNKEN_BORDER|wxFULL_REPAINT_ON_RESIZE, _("GLRenderCanvas"))
	,dList <DemoEntity*>() 
	,m_mainWindow(parent)
	,m_world(NULL)
	,m_sky(NULL)
	,m_microsecunds(0)
	,m_physicsTime(0.0f)
	,m_currentListenerTimestep(0.0f)
	,m_physicsUpdate(true) 
	,m_reEntrantUpdate (false)
	,m_renderHoodContext(NULL)
	,m_renderHood(NULL)
	,m_font(0)
	,m_fontImage(0)
	,m_cameraManager(NULL)
    ,m_tranparentHeap()
//	,m_visualDebugger(NULL)

	,m_mainThreadGraphicsTime(0.0f)
	,m_mainThreadPhysicsTime(0.0f)
{
	// initialized the physics world for the new scene
	Cleanup ();

	ResetTimer();

	dTimeTrackerSetThreadName ("mainThread");
	m_context = new wxGLContext(this);
}
예제 #2
0
void* dgThread::dgThreadSystemCallback(void* threadData)
{
	dgFloatExceptions exception;
	dgSetPrecisionDouble precision;

	dgThread* const me = (dgThread*) threadData;

	dTimeTrackerSetThreadName(me->m_name);

	dgInterlockedExchange(&me->m_threadRunning, 1);
	me->Execute(me->m_id);
	dgInterlockedExchange(&me->m_threadRunning, 0);
	dgThreadYield();
	return 0;
}