diff --git a/Demos/Benchmarks/BenchmarkDemo.cpp b/Demos/Benchmarks/BenchmarkDemo.cpp index 0786947ab..d39fd54fe 100644 --- a/Demos/Benchmarks/BenchmarkDemo.cpp +++ b/Demos/Benchmarks/BenchmarkDemo.cpp @@ -13,6 +13,7 @@ subject to the following restrictions: 3. This notice may not be removed or altered from any source distribution. */ + // Collision Radius #define COLLISION_RADIUS 0.0f diff --git a/Demos/Benchmarks/CMakeLists.txt b/Demos/Benchmarks/CMakeLists.txt index 409622842..6fae30528 100644 --- a/Demos/Benchmarks/CMakeLists.txt +++ b/Demos/Benchmarks/CMakeLists.txt @@ -23,6 +23,21 @@ IF (USE_GLUT) BenchmarkDemo.cpp BenchmarkDemo.h ) + IF (WIN32) + IF (CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET AppBenchmarks + POST_BUILD + COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/glut64.dll ${CMAKE_CURRENT_BINARY_DIR} + ) + ELSE(CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET AppBenchmarks + POST_BUILD + COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/GLUT32.DLL ${CMAKE_CURRENT_BINARY_DIR} + ) + ENDIF(CMAKE_CL_64) + ENDIF(WIN32) ELSE (USE_GLUT) INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/src @@ -36,7 +51,6 @@ ELSE (USE_GLUT) ADD_EXECUTABLE(AppBenchmarks WIN32 ../OpenGL/Win32AppMain.cpp - main.cpp BenchmarkDemo.cpp BenchmarkDemo.h Win32BenchmarkDemo.cpp diff --git a/Demos/Benchmarks/main.cpp b/Demos/Benchmarks/main.cpp index 9027f7202..bd96a1cae 100644 --- a/Demos/Benchmarks/main.cpp +++ b/Demos/Benchmarks/main.cpp @@ -18,12 +18,12 @@ subject to the following restrictions: #include "LinearMath/btHashMap.h" #include -#ifdef USE_GLUT_GRAPHICAL_BENCHMARK +#ifdef USE_GRAPHICAL_BENCHMARK #include "GlutStuff.h" #include "GLDebugDrawer.h" GLDebugDrawer gDebugDrawer; #define benchmarkDemo benchmarkDemo1 -#endif //USE_GLUT_GRAPHICAL_BENCHMARK +#endif //USE_GRAPHICAL_BENCHMARK #define NUM_DEMOS 7 @@ -47,11 +47,11 @@ int main(int argc,char** argv) char* demoNames[NUM_DEMOS] = {"3000 fall", "1000 stack", "136 ragdolls","1000 convex", "prim-trimesh", "convex-trimesh","raytests"}; float totalTime[NUM_DEMOS] = {0.f,0.f,0.f,0.f,0.f,0.f,0.f}; -#ifdef USE_GLUT_GRAPHICAL_BENCHMARK +#ifdef USE_GRAPHICAL_BENCHMARK benchmarkDemo.initPhysics(); benchmarkDemo.getDynamicsWorld()->setDebugDrawer(&gDebugDrawer); return glutmain(argc, argv,640,480,"Bullet Physics Demo. http://bulletphysics.com",&benchmarkDemo); -#else //USE_GLUT_GRAPHICAL_BENCHMARK +#else //USE_GRAPHICAL_BENCHMARK int d; for (d=0;dinitPhysics(); - - collisionInterfaceDemo->clientResetScene(); - - return glutmain(argc, argv,screenWidth,screenHeight,"Collision Interface Demo",collisionInterfaceDemo); -} void CollisionInterfaceDemo::initPhysics() { @@ -260,7 +250,7 @@ void CollisionInterfaceDemo::displayCallback(void) { } glFlush(); - glutSwapBuffers(); + swapBuffers(); } void CollisionInterfaceDemo::clientResetScene() diff --git a/Demos/CollisionInterfaceDemo/CollisionInterfaceDemo.h b/Demos/CollisionInterfaceDemo/CollisionInterfaceDemo.h index 2ad072f78..d8e2124c8 100644 --- a/Demos/CollisionInterfaceDemo/CollisionInterfaceDemo.h +++ b/Demos/CollisionInterfaceDemo/CollisionInterfaceDemo.h @@ -15,10 +15,16 @@ subject to the following restrictions: #ifndef COLLISION_INTERFACE_DEMO_H #define COLLISION_INTERFACE_DEMO_H +#ifdef _WINDOWS +#include "Win32DemoApplication.h" +#define PlatformDemoApplication Win32DemoApplication +#else #include "GlutDemoApplication.h" +#define PlatformDemoApplication GlutDemoApplication +#endif ///CollisionInterfaceDemo shows how to use the collision detection without dynamics (btCollisionWorld/CollisionObject) -class CollisionInterfaceDemo : public GlutDemoApplication +class CollisionInterfaceDemo : public PlatformDemoApplication { public: diff --git a/Demos/CollisionInterfaceDemo/Win32CollisionInterfaceDemo.cpp b/Demos/CollisionInterfaceDemo/Win32CollisionInterfaceDemo.cpp new file mode 100644 index 000000000..ec2fab45c --- /dev/null +++ b/Demos/CollisionInterfaceDemo/Win32CollisionInterfaceDemo.cpp @@ -0,0 +1,25 @@ +#ifdef _WINDOWS +/* +Bullet Continuous Collision Detection and Physics Library +Copyright (c) 2003-2009 Erwin Coumans http://bulletphysics.org + +This software is provided 'as-is', without any express or implied warranty. +In no event will the authors be held liable for any damages arising from the use of this software. +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it freely, +subject to the following restrictions: + +1. The origin of this software must not be misrepresented; you must not claim that you wrote the original software. If you use this software in a product, an acknowledgment in the product documentation would be appreciated but is not required. +2. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. +3. This notice may not be removed or altered from any source distribution. +*/ + +#include "CollisionInterfaceDemo.h" + +///The 'createDemo' function is called from Bullet/Demos/OpenGL/Win32AppMain.cpp to instantiate this particular demo +DemoApplication* createDemo() +{ + return new CollisionInterfaceDemo(); +} + +#endif diff --git a/Demos/CollisionInterfaceDemo/main.cpp b/Demos/CollisionInterfaceDemo/main.cpp new file mode 100644 index 000000000..bb09a6a03 --- /dev/null +++ b/Demos/CollisionInterfaceDemo/main.cpp @@ -0,0 +1,15 @@ + +#include "CollisionInterfaceDemo.h" +#include "GlutStuff.h" +#include "btBulletDynamicsCommon.h" + +int main(int argc,char** argv) +{ + CollisionInterfaceDemo* collisionInterfaceDemo = new CollisionInterfaceDemo(); + + collisionInterfaceDemo->initPhysics(); + + collisionInterfaceDemo->clientResetScene(); + + return glutmain(argc, argv,screenWidth,screenHeight,"Collision Interface Demo",collisionInterfaceDemo); +} diff --git a/Demos/ConcaveDemo/CMakeLists.txt b/Demos/ConcaveDemo/CMakeLists.txt index 50569384a..ad973e811 100644 --- a/Demos/ConcaveDemo/CMakeLists.txt +++ b/Demos/ConcaveDemo/CMakeLists.txt @@ -22,6 +22,21 @@ IF (USE_GLUT) ConcavePhysicsDemo.cpp main.cpp ) + IF (WIN32) + IF (CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET AppConcaveDemo + POST_BUILD + COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/glut64.dll ${CMAKE_CURRENT_BINARY_DIR} + ) + ELSE(CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET AppConcaveDemo + POST_BUILD + COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/GLUT32.DLL ${CMAKE_CURRENT_BINARY_DIR} + ) + ENDIF(CMAKE_CL_64) + ENDIF(WIN32) ELSE (USE_GLUT) INCLUDE_DIRECTORIES( diff --git a/Demos/ConstraintDemo/CMakeLists.txt b/Demos/ConstraintDemo/CMakeLists.txt index 71473ffec..eabbb764f 100644 --- a/Demos/ConstraintDemo/CMakeLists.txt +++ b/Demos/ConstraintDemo/CMakeLists.txt @@ -29,6 +29,21 @@ IF (USE_GLUT) ConstraintDemo.h main.cpp ) + IF (WIN32) + IF (CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET AppConstraintDemo + POST_BUILD + COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/glut64.dll ${CMAKE_CURRENT_BINARY_DIR} + ) + ELSE(CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET AppConstraintDemo + POST_BUILD + COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/GLUT32.DLL ${CMAKE_CURRENT_BINARY_DIR} + ) + ENDIF(CMAKE_CL_64) + ENDIF(WIN32) ELSE (USE_GLUT) LINK_LIBRARIES( OpenGLSupport BulletWorldImporter BulletDynamics BulletCollision LinearMath BulletFileLoader ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} diff --git a/Demos/ConvexDecompositionDemo/CMakeLists.txt b/Demos/ConvexDecompositionDemo/CMakeLists.txt index 666d31c99..9d2ced035 100644 --- a/Demos/ConvexDecompositionDemo/CMakeLists.txt +++ b/Demos/ConvexDecompositionDemo/CMakeLists.txt @@ -30,6 +30,21 @@ IF (USE_GLUT) ConvexDecompositionDemo.cpp ConvexDecompositionDemo.h ) + IF (WIN32) + IF (CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET AppConvexDecompositionDemo + POST_BUILD + COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/glut64.dll ${CMAKE_CURRENT_BINARY_DIR} + ) + ELSE(CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET AppConvexDecompositionDemo + POST_BUILD + COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/GLUT32.DLL ${CMAKE_CURRENT_BINARY_DIR} + ) + ENDIF(CMAKE_CL_64) + ENDIF(WIN32) ELSE (USE_GLUT) LINK_LIBRARIES( diff --git a/Demos/GenericJointDemo/CMakeLists.txt b/Demos/GenericJointDemo/CMakeLists.txt index 08060582b..cd8f484e1 100644 --- a/Demos/GenericJointDemo/CMakeLists.txt +++ b/Demos/GenericJointDemo/CMakeLists.txt @@ -25,7 +25,21 @@ IF (USE_GLUT) Ragdoll.cpp main.cpp ) - + IF (WIN32) + IF (CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET AppGenericJointDemo + POST_BUILD + COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/glut64.dll ${CMAKE_CURRENT_BINARY_DIR} + ) + ELSE(CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET AppGenericJointDemo + POST_BUILD + COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/GLUT32.DLL ${CMAKE_CURRENT_BINARY_DIR} + ) + ENDIF(CMAKE_CL_64) + ENDIF(WIN32) ELSE(USE_GLUT) diff --git a/Demos/GimpactTestDemo/CMakeLists.txt b/Demos/GimpactTestDemo/CMakeLists.txt index 79364743a..31ed8fde1 100644 --- a/Demos/GimpactTestDemo/CMakeLists.txt +++ b/Demos/GimpactTestDemo/CMakeLists.txt @@ -23,6 +23,21 @@ IF (USE_GLUT) GimpactTestDemo.h main.cpp ) + IF (WIN32) + IF (CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET AppGimpactTestDemo + POST_BUILD + COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/glut64.dll ${CMAKE_CURRENT_BINARY_DIR} + ) + ELSE(CMAKE_CL_64) + ADD_CUSTOM_COMMAND( + TARGET AppGimpactTestDemo + POST_BUILD + COMMAND ${CMAKE_COMMAND} ARGS -E copy_if_different ${BULLET_PHYSICS_SOURCE_DIR}/GLUT32.DLL ${CMAKE_CURRENT_BINARY_DIR} + ) + ENDIF(CMAKE_CL_64) + ENDIF(WIN32) ELSE(USE_GLUT) INCLUDE_DIRECTORIES(