copy glut*.dll next to executable using cmake postbuild step

re-add CollisionInterfaceDemo to cmake
This commit is contained in:
erwin.coumans
2010-01-29 17:47:17 +00:00
parent 37f6df2c32
commit 8616ea07d8
15 changed files with 190 additions and 29 deletions

View File

@@ -10,15 +10,36 @@
########################################################
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/src ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenGL
)
IF (USE_GLUT)
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/src ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenGL
)
LINK_LIBRARIES(
OpenGLSupport BulletDynamics BulletCollision LinearMath ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}
)
LINK_LIBRARIES(
OpenGLSupport BulletDynamics BulletCollision LinearMath ${GLUT_glut_LIBRARY} ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}
)
ADD_EXECUTABLE(AppCollisionInterfaceDemo
CollisionInterfaceDemo.cpp
)
ADD_EXECUTABLE(AppCollisionInterfaceDemo
CollisionInterfaceDemo.cpp
CollisionInterfaceDemo.h
main.cpp
)
ELSE (USE_GLUT)
INCLUDE_DIRECTORIES(
${BULLET_PHYSICS_SOURCE_DIR}/src ${BULLET_PHYSICS_SOURCE_DIR}/Demos/OpenGL
)
LINK_LIBRARIES(
OpenGLSupport BulletDynamics BulletCollision LinearMath ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY}
)
ADD_EXECUTABLE(AppCollisionInterfaceDemo
WIN32
CollisionInterfaceDemo.cpp
CollisionInterfaceDemo.h
Win32CollisionInterfaceDemo.cpp
../OpenGL/Win32AppMain.cpp
)
ENDIF (USE_GLUT)

View File

@@ -44,16 +44,6 @@ int screenWidth = 640;
int screenHeight = 480;
GLDebugDrawer debugDrawer;
int main(int argc,char** argv)
{
CollisionInterfaceDemo* collisionInterfaceDemo = new CollisionInterfaceDemo();
collisionInterfaceDemo->initPhysics();
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()

View File

@@ -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:

View File

@@ -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

View File

@@ -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);
}