From 550c500ca7b60df773ebdcf3d3e46ef05fedc55d Mon Sep 17 00:00:00 2001 From: ejcoumans Date: Tue, 23 Oct 2007 01:16:31 +0000 Subject: [PATCH] Set debug drawer for demo Fixed issue with toggle of activation in the DemoApplication added hint/todo for Win32ThreadSupport --- Demos/CcdPhysicsDemo/main.cpp | 4 ++++ Demos/OpenGL/DemoApplication.cpp | 2 +- Extras/BulletMultiThreaded/Win32ThreadSupport.cpp | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Demos/CcdPhysicsDemo/main.cpp b/Demos/CcdPhysicsDemo/main.cpp index 4bbcfab19..82fd0eacc 100644 --- a/Demos/CcdPhysicsDemo/main.cpp +++ b/Demos/CcdPhysicsDemo/main.cpp @@ -15,7 +15,10 @@ subject to the following restrictions: #include "CcdPhysicsDemo.h" #include "GlutStuff.h" +#include "GLDebugDrawer.h" +#include "btBulletDynamicsCommon.h" +GLDebugDrawer gDebugDrawer; int main(int argc,char** argv) { @@ -23,6 +26,7 @@ int main(int argc,char** argv) CcdPhysicsDemo* ccdDemo = new CcdPhysicsDemo(); ccdDemo->initPhysics(); + ccdDemo->getDynamicsWorld()->setDebugDrawer(&gDebugDrawer); return glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bullet.sf.net",ccdDemo); diff --git a/Demos/OpenGL/DemoApplication.cpp b/Demos/OpenGL/DemoApplication.cpp index 7a60e5eeb..72f2ace68 100644 --- a/Demos/OpenGL/DemoApplication.cpp +++ b/Demos/OpenGL/DemoApplication.cpp @@ -312,7 +312,7 @@ void DemoApplication::keyboardCallback(unsigned char key, int x, int y) m_debugMode = m_debugMode & (~btIDebugDraw::DBG_NoDeactivation); else m_debugMode |= btIDebugDraw::DBG_NoDeactivation; - if (m_debugMode | btIDebugDraw::DBG_NoDeactivation) + if (m_debugMode & btIDebugDraw::DBG_NoDeactivation) { gDisableDeactivation = true; } else diff --git a/Extras/BulletMultiThreaded/Win32ThreadSupport.cpp b/Extras/BulletMultiThreaded/Win32ThreadSupport.cpp index af43e98fd..e81753aeb 100644 --- a/Extras/BulletMultiThreaded/Win32ThreadSupport.cpp +++ b/Extras/BulletMultiThreaded/Win32ThreadSupport.cpp @@ -22,6 +22,9 @@ subject to the following restrictions: #include +///The number of threads should be equal to the number of available cores +///Todo: each worker should be linked to a single core, using SetThreadIdealProcessor. + ///Win32ThreadSupport helps to initialize/shutdown libspe2, start/stop SPU tasks and communication ///Setup and initialize SPU/CELL/Libspe2 Win32ThreadSupport::Win32ThreadSupport(Win32ThreadConstructionInfo& threadConstructionInfo)