move OpenCL initialization for the unit tests in a shared header file, and support some basic command-line arguments

--cl_device=1 --cl_platform=1 --allow_opencl_cpu
add chaindemo, test for mass ratios
restore sleeping/activation mode in featherstone demo
Use _VARIADIC_MAX=10 to avoid Google Test issues with Visual Studio 2012, thanks to Mobeen for the report
Enable verbose printf for unit tests
This commit is contained in:
erwincoumans
2014-02-11 10:33:00 -08:00
parent bd5c2ff5ec
commit 122ceacb6d
26 changed files with 389 additions and 1388 deletions

View File

@@ -10,7 +10,7 @@
#include "../bullet2/RagdollDemo/RagdollDemo.h"
#include "../bullet2/LuaDemo/LuaDemo.h"
#include "../bullet2/ChainDemo/ChainDemo.h"
struct BulletDemoEntry
{
@@ -24,6 +24,7 @@ static BulletDemoEntry allDemos[]=
//{"emptydemo",EmptyBulletDemo::MyCreateFunc},
{"BasicDemo",BasicDemo::MyCreateFunc},
//{"ChainDemo",ChainDemo::MyCreateFunc},
{"HingeDemo",HingeDemo::MyCreateFunc},
{"Ragdoll",RagDollDemo::MyCreateFunc},
{"MultiBody1",FeatherstoneDemo1::MyCreateFunc},

View File

@@ -14,6 +14,8 @@ static int sCurrentDemoIndex = 0;
static BulletDemoInterface* sCurrentDemo = 0;
static b3AlignedObjectArray<const char*> allNames;
bool drawGUI=true;
extern bool useShadowMap;
static bool wireframe=false;
static bool pauseSimulation=false;
@@ -128,8 +130,10 @@ void MyComboBoxCallback(int comboId, const char* item)
}
extern bool sOpenGLVerbose;
int main(int argc, char* argv[])
{
sOpenGLVerbose = false;
float dt = 1./120.f;
int width = 1024;
@@ -175,12 +179,17 @@ int main(int argc, char* argv[])
app->m_instancingRenderer->updateCamera();
app->drawGrid();
if (0)
{
char bla[1024];
static int frameCount = 0;
frameCount++;
sprintf(bla,"Simple test frame %d", frameCount);
app->drawText(bla,10,10);
}
if (sCurrentDemo)
{
if (!pauseSimulation)

View File

@@ -31,6 +31,9 @@
"../bullet2/BasicDemo/BasicDemo.h",
"../bullet2/BasicDemo/HingeDemo.cpp",
"../bullet2/BasicDemo/HingeDemo.h",
"../bullet2/BasicDemo/ChainDemo.cpp",
"../bullet2/BasicDemo/ChainDemo.h",
"../bullet2/RagdollDemo/RagdollDemo.cpp",
"../bullet2/RagdollDemo/RagdollDemo.h",
"../bullet2/LuaDemo/LuaDemo.cpp",