diff --git a/CMakeLists.txt b/CMakeLists.txt index d88eb378f..cb0f07560 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -226,7 +226,13 @@ ENDIF(USE_GLUT) ENDIF() ENDIF(BUILD_BULLET2_DEMOS) -OPTION(BUILD_BULLET3_DEMOS "Set when you want to build the Bullet 3 demos" ON) +OPTION(BUILD_BULLET3 "Set when you want to build Bullet 3" ON) +IF(BUILD_BULLET3) + OPTION(BUILD_BULLET3_DEMOS "Set when you want to build the Bullet 3 demos" ON) +ELSE(BUILD_BULLET3) + unset(BUILD_BULLET3_DEMOS CACHE) + OPTION(BUILD_BULLET3_DEMOS "Set when you want to build the Bullet 3 demos" OFF) +ENDIF(BUILD_BULLET3) IF(BUILD_BULLET3_DEMOS) IF(EXISTS ${BULLET_PHYSICS_SOURCE_DIR}/Demos3 AND IS_DIRECTORY ${BULLET_PHYSICS_SOURCE_DIR}/Demos3) SUBDIRS(Demos3) diff --git a/Demos/BasicDemo/BasicDemo.cpp b/Demos/BasicDemo/BasicDemo.cpp index fc38f27dd..c8dcfcc5c 100644 --- a/Demos/BasicDemo/BasicDemo.cpp +++ b/Demos/BasicDemo/BasicDemo.cpp @@ -15,9 +15,9 @@ subject to the following restrictions: ///create 125 (5x5x5) dynamic object -#define ARRAY_SIZE_X 10 -#define ARRAY_SIZE_Y 10 -#define ARRAY_SIZE_Z 10 +#define ARRAY_SIZE_X 5 +#define ARRAY_SIZE_Y 5 +#define ARRAY_SIZE_Z 5 //maximum number of objects (and allow user to shoot additional boxes) #define MAX_PROXIES (ARRAY_SIZE_X*ARRAY_SIZE_Y*ARRAY_SIZE_Z + 1024) @@ -81,8 +81,8 @@ void BasicDemo::clientMoveAndDisplay() MyOverlapCallback aabbOverlap(aabbMin,aabbMax); m_dynamicsWorld->getBroadphase()->aabbTest(aabbMin,aabbMax,aabbOverlap); - if (aabbOverlap.m_numOverlap) - printf("#aabb overlap = %d\n", aabbOverlap.m_numOverlap); + //if (aabbOverlap.m_numOverlap) + // printf("#aabb overlap = %d\n", aabbOverlap.m_numOverlap); } renderme(); diff --git a/Demos3/CMakeLists.txt b/Demos3/CMakeLists.txt index b1f54a968..edc1c06dc 100644 --- a/Demos3/CMakeLists.txt +++ b/Demos3/CMakeLists.txt @@ -1,3 +1,3 @@ -if (BUILD_BULLET3) +if (BUILD_BULLET3_DEMOS) SUBDIRS( AllBullet2Demos GpuDemos SimpleOpenGL3 ) -endif(BUILD_BULLET3) +endif(BUILD_BULLET3_DEMOS) diff --git a/btgui/CMakeLists.txt b/btgui/CMakeLists.txt index f95d9cc8c..1bce7969e 100644 --- a/btgui/CMakeLists.txt +++ b/btgui/CMakeLists.txt @@ -1 +1,3 @@ +if (OPENGL_FOUND) SUBDIRS( Gwen OpenGLWindow ) +endif(OPENGL_FOUND) diff --git a/btgui/OpenGLTrueTypeFont/opengl_fontstashcallbacks.cpp b/btgui/OpenGLTrueTypeFont/opengl_fontstashcallbacks.cpp index 1ef12906f..d15485219 100644 --- a/btgui/OpenGLTrueTypeFont/opengl_fontstashcallbacks.cpp +++ b/btgui/OpenGLTrueTypeFont/opengl_fontstashcallbacks.cpp @@ -180,7 +180,7 @@ void InternalOpenGL2RenderCallbacks::updateTexture(sth_texture* texture, sth_gly glDeleteTextures(1, id); //delete id; - delete texture->m_userData; + delete id;//texture->m_userData; texture->m_userData = 0; } diff --git a/btgui/OpenGLWindow/premake4.lua b/btgui/OpenGLWindow/premake4.lua index be45bbe0d..e98cb5105 100644 --- a/btgui/OpenGLWindow/premake4.lua +++ b/btgui/OpenGLWindow/premake4.lua @@ -43,4 +43,3 @@ "../OpenGLWindow/MacOpenGLWindow.mm", } end - diff --git a/build3/findOpenGLGlewGlut.lua b/build3/findOpenGLGlewGlut.lua index dd72ae923..b8fe64664 100644 --- a/build3/findOpenGLGlewGlut.lua +++ b/build3/findOpenGLGlewGlut.lua @@ -1,3 +1,11 @@ + function findOpenGL() + configuration{} + if os.is("Linux") then + return false + end + --assume OpenGL is available on Mac OSX, Windows etc + return true + end function initOpenGL() configuration {} diff --git a/build3/premake4.lua b/build3/premake4.lua index 9f3c22fde..359600dbb 100644 --- a/build3/premake4.lua +++ b/build3/premake4.lua @@ -4,10 +4,10 @@ -- Multithreaded compiling if _ACTION == "vs2010" or _ACTION=="vs2008" then buildoptions { "/MP" } - end - + end + act = "" - + if _ACTION then act = _ACTION end @@ -18,9 +18,9 @@ trigger = "midi", description = "Use Midi controller to control parameters" } - + -- _OPTIONS["midi"] = "1"; - + newoption { trigger = "bullet2gpu", @@ -32,19 +32,20 @@ trigger = "enet", description = "Enable enet NAT punchthrough test" } - + newoption { trigger = "gtest", description = "Enable unit tests using gtest" - } + } + configurations {"Release", "Debug"} configuration "Release" flags { "Optimize", "EnableSSE2","StaticRuntime", "NoMinimalRebuild", "FloatFast"} configuration "Debug" defines {"_DEBUG=1"} flags { "Symbols", "StaticRuntime" , "NoMinimalRebuild", "NoEditAndContinue" ,"FloatFast"} - + if os.is("Linux") then if os.is64bit() then platforms {"x64"} @@ -57,7 +58,7 @@ configuration {"x32"} targetsuffix ("_" .. act) - configuration "x64" + configuration "x64" targetsuffix ("_" .. act .. "_64" ) configuration {"x64", "debug"} targetsuffix ("_" .. act .. "_x64_debug") @@ -65,7 +66,7 @@ targetsuffix ("_" .. act .. "_x64_release" ) configuration {"x32", "debug"} targetsuffix ("_" .. act .. "_debug" ) - + configuration{} postfix="" @@ -78,45 +79,46 @@ } end - + flags { "NoRTTI", "NoExceptions"} defines { "_HAS_EXCEPTIONS=0" } targetdir "../bin" location("./" .. act .. postfix) - + projectRootDir = os.getcwd() .. "/../" - print("Project root directroy: " .. projectRootDir); + print("Project root directory: " .. projectRootDir); dofile ("findOpenCL.lua") dofile ("findDirectX11.lua") dofile ("findOpenGLGlewGlut.lua") - + language "C++" - if _OPTIONS["gtest"] then + if _OPTIONS["gtest"] then include "../test/gtest-1.7.0" -- include "../test/hello_gtest" - include "../test/TestBullet3OpenCL" end - - + +if findOpenGL() then include "../Demos3/AllBullet2Demos" include "../Demos3/GpuDemos" -- include "../Demos3/CpuDemos" +-- include "../Demos3/Wavefront" +-- include "../btgui/MultiThreading" - include "../Demos3/Wavefront" - include "../btgui/MultiThreading" include "../btgui/OpenGLWindow" - -include "../Demos3/ImplicitCloth" -include "../Demos3/SimpleOpenGL3" - +-- include "../Demos3/ImplicitCloth" +-- include "../Demos3/SimpleOpenGL3" + include "../btgui/lua-5.2.3" include "../test/lua" - + include "../btgui/Gwen" + include "../btgui/GwenOpenGLTest" +end + -- include "../demo/gpudemo" if _OPTIONS["midi"] then include "../btgui/MidiTest" @@ -124,58 +126,49 @@ end -- include "../opencl/vector_add_simplified" -- include "../opencl/vector_add" - include "../btgui/Gwen" - include "../btgui/GwenOpenGLTest" - include "../test/clew" - include "../Demos3/GpuGuiInitialize" - - include "../test/OpenCL/BasicInitialize" - include "../test/OpenCL/KernelLaunch"-- +-- include "../test/clew" +-- include "../Demos3/GpuGuiInitialize" + +-- include "../test/OpenCL/BasicInitialize" + include "../test/OpenCL/KernelLaunch"-- -- include "../test/OpenCL/BroadphaseCollision" -- include "../test/OpenCL/NarrowphaseCollision" include "../test/OpenCL/ParallelPrimitives" include "../test/OpenCL/RadixSortBenchmark" - - include "../src/BulletSoftBody" + + include "../src/BulletSoftBody" include "../src/BulletDynamics" include "../src/BulletCollision" include "../src/LinearMath" - + include "../src/Bullet3Dynamics" include "../src/Bullet3Common" include "../src/Bullet3Geometry" include "../src/Bullet3Collision" include "../src/Bullet3Serialize/Bullet2FileLoader" - include "../src/Bullet3OpenCL" - - - + -- include "../demo/gpu_initialize" -- include "../opencl/lds_bank_conflict" -- include "../opencl/reduce" - include "../btgui/OpenGLTrueTypeFont" +-- include "../btgui/OpenGLTrueTypeFont" -- include "../btgui/OpenGLWindow" -- include "../demo/ObjLoader" - - -- include "../test/b3DynamicBvhBroadphase" - + if _OPTIONS["enet"] then include "../btgui/enet" include "../test/enet/server" include "../test/enet/client" end - if _OPTIONS["bullet2gpu"] then - include "../src/LinearMath" - include "../src/BulletCollision" - include "../src/BulletDynamics" - include "../src/BulletSoftBody" - include "../ObsoleteDemos/HelloWorld" - - include "../Demos3" + include "../src/LinearMath" + include "../src/BulletCollision" + include "../src/BulletDynamics" + include "../src/BulletSoftBody" + include "../ObsoleteDemos/HelloWorld" + include "../Demos3" end