diff --git a/Demos/BasicDemo/BasicDemoPhysicsSetup.h b/Demos/BasicDemo/BasicDemoPhysicsSetup.h index 0b8a55147..0e6d86d5c 100644 --- a/Demos/BasicDemo/BasicDemoPhysicsSetup.h +++ b/Demos/BasicDemo/BasicDemoPhysicsSetup.h @@ -16,7 +16,7 @@ class btBoxShape; #include "LinearMath/btAlignedObjectArray.h" -#include "../CommonRigidBodySetup.h" +#include "Bullet3AppSupport/CommonRigidBodySetup.h" struct BasicDemoPhysicsSetup : public CommonRigidBodySetup { diff --git a/Demos/BasicDemo/CMakeLists.txt b/Demos/BasicDemo/CMakeLists.txt index cff25d285..87c0464cb 100644 --- a/Demos/BasicDemo/CMakeLists.txt +++ b/Demos/BasicDemo/CMakeLists.txt @@ -12,7 +12,7 @@ SET(GLUT_ROOT ${BULLET_PHYSICS_SOURCE_DIR}/Glut) ######################################################## INCLUDE_DIRECTORIES( -${BULLET_PHYSICS_SOURCE_DIR}/src ../OpenGL +${BULLET_PHYSICS_SOURCE_DIR}/src ../OpenGL ../../btgui ${GLUT_INCLUDE_DIR} ) diff --git a/Demos/CcdPhysicsDemo/CMakeLists.txt b/Demos/CcdPhysicsDemo/CMakeLists.txt index 7ce0d25ef..4224de545 100644 --- a/Demos/CcdPhysicsDemo/CMakeLists.txt +++ b/Demos/CcdPhysicsDemo/CMakeLists.txt @@ -14,6 +14,7 @@ INCLUDE_DIRECTORIES( ${BULLET_PHYSICS_SOURCE_DIR}/src ../OpenGL +../../btgui ${GLUT_INCLUDE_DIR} ) @@ -44,4 +45,4 @@ IF (INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES) SET_TARGET_PROPERTIES(AppCcdPhysicsDemo PROPERTIES DEBUG_POSTFIX "_Debug") SET_TARGET_PROPERTIES(AppCcdPhysicsDemo PROPERTIES MINSIZEREL_POSTFIX "_MinsizeRel") SET_TARGET_PROPERTIES(AppCcdPhysicsDemo PROPERTIES RELWITHDEBINFO_POSTFIX "_RelWithDebugInfo") -ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES) \ No newline at end of file +ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES) diff --git a/Demos/CcdPhysicsDemo/CcdPhysicsSetup.h b/Demos/CcdPhysicsDemo/CcdPhysicsSetup.h index 7355c3e3c..9fb58225d 100644 --- a/Demos/CcdPhysicsDemo/CcdPhysicsSetup.h +++ b/Demos/CcdPhysicsDemo/CcdPhysicsSetup.h @@ -3,7 +3,7 @@ #define CCD_PHYSICS_SETUP_H -#include "../CommonRigidBodySetup.h" +#include "Bullet3AppSupport/CommonRigidBodySetup.h" struct CcdPhysicsSetup : public CommonRigidBodySetup { diff --git a/Demos/SerializeDemo/SerializeSetup.h b/Demos/SerializeDemo/SerializeSetup.h index 7275d5b77..843135540 100644 --- a/Demos/SerializeDemo/SerializeSetup.h +++ b/Demos/SerializeDemo/SerializeSetup.h @@ -1,6 +1,6 @@ #ifndef SERIALIZE_SETUP_H #define SERIALIZE_SETUP_H -#include "../../Demos/CommonRigidBodySetup.h" +#include "Bullet3AppSupport/CommonRigidBodySetup.h" class SerializeSetup : public CommonRigidBodySetup { diff --git a/Demos/premake4.lua b/Demos/premake4.lua index 7b7b2ef35..cf4bf0b8d 100644 --- a/Demos/premake4.lua +++ b/Demos/premake4.lua @@ -88,15 +88,15 @@ end createDemos({"HelloWorld"},{"../src"},{"BulletDynamics","BulletCollision","LinearMath"}) - createDemos(localdemos,{"../src","OpenGL"},{"OpenGLSupport","BulletDynamics", "BulletCollision", "LinearMath"}) + createDemos(localdemos,{"../src","OpenGL","../btgui",},{"OpenGLSupport","BulletDynamics", "BulletCollision", "LinearMath"}) createDemos({"ConvexDecompositionDemo"},{"../Extras/HACD","../Extras/ConvexDecomposition","../src","OpenGL"},{"OpenGLSupport","BulletDynamics", "BulletCollision", "LinearMath","HACD","ConvexDecomposition"}) createDemos({"SoftDemo"},{"../src","OpenGL"}, {"OpenGLSupport","BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"}) - createDemos({"SerializeDemo"},{"../Extras/Serialize/BulletFileLoader","../Extras/Serialize/BulletWorldImporter","../src","OpenGL"},{"OpenGLSupport","BulletWorldImporter", "BulletFileLoader", "BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"}) + createDemos({"SerializeDemo"},{"../Extras/Serialize/BulletFileLoader","../Extras/Serialize/BulletWorldImporter","../src","OpenGL","../btgui"},{"OpenGLSupport","BulletWorldImporter", "BulletFileLoader", "BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"}) -createDemos({"BulletXmlImportDemo"},{"../Extras/Serialize/BulletFileLoader","../Extras/Serialize/BulletXmlWorldImporter", "../Extras/Serialize/BulletWorldImporter","../src","OpenGL"},{"OpenGLSupport","BulletXmlWorldImporter","BulletWorldImporter", "BulletFileLoader", "BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"}) +createDemos({"BulletXmlImportDemo"},{"../Extras/Serialize/BulletFileLoader","../Extras/Serialize/BulletXmlWorldImporter", "../Extras/Serialize/BulletWorldImporter","../src","OpenGL","btgui"},{"OpenGLSupport","BulletXmlWorldImporter","BulletWorldImporter", "BulletFileLoader", "BulletSoftBody", "BulletDynamics", "BulletCollision", "LinearMath"}) include "OpenGL" diff --git a/Demos3/AllBullet2Demos/BulletDemoEntries.h b/Demos3/AllBullet2Demos/BulletDemoEntries.h index a0162278c..47226393e 100644 --- a/Demos3/AllBullet2Demos/BulletDemoEntries.h +++ b/Demos3/AllBullet2Demos/BulletDemoEntries.h @@ -2,7 +2,7 @@ #ifndef BULLET_DEMO_ENTRIES_H #define BULLET_DEMO_ENTRIES_H -#include "BulletDemoInterface.h" +#include "Bullet3AppSupport/BulletDemoInterface.h" #include "../bullet2/BasicDemo/BasicDemo.h" #include "../bullet2/BasicDemo/HingeDemo.h" #include "../bullet2/BasicDemo/HingeDemo.h" diff --git a/Demos3/AllBullet2Demos/CMakeLists.txt b/Demos3/AllBullet2Demos/CMakeLists.txt index 535c1b9e6..e955147d2 100644 --- a/Demos3/AllBullet2Demos/CMakeLists.txt +++ b/Demos3/AllBullet2Demos/CMakeLists.txt @@ -8,19 +8,7 @@ INCLUDE_DIRECTORIES( SET(App_AllBullet2Demos_SRCS main.cpp - BulletDemoInterface.h BulletDemoEntries.h - GwenParameterInterface.cpp - GwenParameterInterface.h - GraphingTexture.h - GwenParameterInterface.h - GwenProfileWindow.h - GwenTextureWindow.h - GraphingTexture.cpp - GwenProfileWindow.cpp - GwenTextureWindow.cpp - ../bullet2/BasicDemo/Bullet2RigidBodyDemo.cpp - ../bullet2/BasicDemo/Bullet2RigidBodyDemo.h ../../Demos/BasicDemo/BasicDemoPhysicsSetup.cpp ../../Demos/BasicDemo/BasicDemoPhysicsSetup.h ../../Demos/CcdPhysicsDemo/CcdPhysicsSetup.cpp @@ -51,16 +39,14 @@ SET(App_AllBullet2Demos_SRCS # ../bullet2/RagdollDemo/RagdollDemo.h ../bullet2/LuaDemo/LuaPhysicsSetup.cpp ../bullet2/LuaDemo/LuaPhysicsSetup.h - ../GpuDemos/gwenUserInterface.cpp - ../GpuDemos/gwenUserInterface.h ../ImportURDFDemo/ImportURDFSetup.cpp ../ImportURDFDemo/ImportURDFSetup.h ../ImportObjDemo/ImportObjSetup.cpp ../ImportSTLDemo/ImportSTLSetup.cpp ../Wavefront/tiny_obj_loader.cpp ../Wavefront/tiny_obj_loader.h - ../../btgui/Timing/b3Clock.cpp - ../../btgui/Timing/b3Clock.h + ../../btgui/Bullet3AppSupport/b3Clock.cpp + ../../btgui/Bullet3AppSupport/b3Clock.h ../../btgui/urdf/urdfdom/urdf_parser/src/pose.cpp ../../btgui/urdf/urdfdom/urdf_parser/src/model.cpp ../../btgui/urdf/urdfdom/urdf_parser/src/link.cpp @@ -85,7 +71,7 @@ SET(App_AllBullet2Demos_SRCS ) LINK_LIBRARIES( - lua-5.2.3 Bullet3Common BulletSoftBody BulletDynamics BulletCollision LinearMath OpenGLWindow gwen ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} + Bullet3AppSupport lua-5.2.3 Bullet3Common BulletSoftBody BulletDynamics BulletCollision LinearMath OpenGLWindow gwen ${OPENGL_gl_LIBRARY} ${OPENGL_glu_LIBRARY} ) IF (WIN32) diff --git a/Demos3/AllBullet2Demos/main.cpp b/Demos3/AllBullet2Demos/main.cpp index 97eae1afe..5c4b9211e 100644 --- a/Demos3/AllBullet2Demos/main.cpp +++ b/Demos3/AllBullet2Demos/main.cpp @@ -1,16 +1,16 @@ -#include "../../btgui/OpenGLWindow/SimpleOpenGL3App.h" +#include "OpenGLWindow/SimpleOpenGL3App.h" #include "Bullet3Common/b3Vector3.h" #include "assert.h" #include -#include "../GpuDemos/gwenInternalData.h" -#include "../GpuDemos/gwenUserInterface.h" +#include "Bullet3AppSupport/gwenInternalData.h" +#include "Bullet3AppSupport/gwenUserInterface.h" #include "BulletDemoEntries.h" -#include "../../btgui/Timing/b3Clock.h" -#include "GwenParameterInterface.h" -#include "GwenProfileWindow.h" -#include "GwenTextureWindow.h" -#include "GraphingTexture.h" +#include "Bullet3AppSupport/b3Clock.h" +#include "Bullet3AppSupport/GwenParameterInterface.h" +#include "Bullet3AppSupport/GwenProfileWindow.h" +#include "Bullet3AppSupport/GwenTextureWindow.h" +#include "Bullet3AppSupport/GraphingTexture.h" #define DEMO_SELECTION_COMBOBOX 13 diff --git a/Demos3/AllBullet2Demos/premake4.lua b/Demos3/AllBullet2Demos/premake4.lua index 34136a950..f9003441f 100644 --- a/Demos3/AllBullet2Demos/premake4.lua +++ b/Demos3/AllBullet2Demos/premake4.lua @@ -13,7 +13,7 @@ } - links{"gwen", "OpenGL_Window","BulletDynamics","BulletCollision","LinearMath","Bullet3Common","lua-5.2.3"} + links{"Bullet3AppSupport","gwen", "OpenGL_Window","BulletDynamics","BulletCollision","LinearMath","Bullet3Common","lua-5.2.3"} initOpenGL() initGlew() @@ -39,8 +39,6 @@ files { "**.cpp", "**.h", - "../bullet2/BasicDemo/Bullet2RigidBodyDemo.cpp", - "../bullet2/BasicDemo/Bullet2RigidBodyDemo.h", "../bullet2/LuaDemo/LuaPhysicsSetup.cpp", "../bullet2/LuaDemo/LuaPhysicsSetup.h", "../bullet2/MultiBodyDemo/TestJointTorqueSetup.cpp", @@ -102,10 +100,6 @@ -- "../bullet2/LuaDemo/LuaDemo.h", - "../../btgui/Timing/b3Clock.cpp", - "../../btgui/Timing/b3Clock.h", - "../GpuDemos/gwenUserInterface.cpp", - "../GpuDemos/gwenUserInterface.h" } if os.is("Linux") then diff --git a/Demos3/BasicDemoConsole/premake4.lua b/Demos3/BasicDemoConsole/premake4.lua index 330128b24..13b66fd6c 100644 --- a/Demos3/BasicDemoConsole/premake4.lua +++ b/Demos3/BasicDemoConsole/premake4.lua @@ -3,7 +3,7 @@ project "App_BasicDemoConsole" kind "ConsoleApp" targetdir "../../bin" - includedirs {"../../src"} + includedirs {"../../src","../../btgui"} configuration { "Windows" } -- links { "opengl32","glu32","gdi32","winmm", "user32" } files { "../../build3/bullet.rc" } diff --git a/Demos3/CpuDemos/gwenUserInterface.cpp b/Demos3/CpuDemos/gwenUserInterface.cpp deleted file mode 100644 index 9c98fdc60..000000000 --- a/Demos3/CpuDemos/gwenUserInterface.cpp +++ /dev/null @@ -1,363 +0,0 @@ - -#include "gwenUserInterface.h" -#include "OpenGLWindow/GwenOpenGL3CoreRenderer.h" -#include "OpenGLWindow/GLPrimitiveRenderer.h" -#include "Gwen/Platform.h" -#include "Gwen/Controls/TreeControl.h" -#include "Gwen/Controls/RadioButtonController.h" -#include "Gwen/Controls/VerticalSlider.h" -#include "Gwen/Controls/HorizontalSlider.h" -#include "Gwen/Controls/GroupBox.h" -#include "Gwen/Controls/CheckBox.h" -#include "Gwen/Controls/StatusBar.h" -#include "Gwen/Controls/Button.h" -#include "Gwen/Controls/ComboBox.h" -#include "Gwen/Controls/MenuStrip.h" -#include "Gwen/Controls/Property/Text.h" -#include "Gwen/Controls/SplitterBar.h" -#include "Bullet3Common/b3AlignedObjectArray.h" -#include "Gwen/Gwen.h" -#include "Gwen/Align.h" -#include "Gwen/Utility.h" -#include "Gwen/Controls/WindowControl.h" -#include "Gwen/Controls/TabControl.h" -#include "Gwen/Controls/ListBox.h" -#include "Gwen/Skins/Simple.h" -//#include "Gwen/Skins/TexturedBase.h" - - -struct GwenInternalData -{ - struct sth_stash; - class GwenOpenGL3CoreRenderer* pRenderer; - Gwen::Skin::Simple skin; - Gwen::Controls::Canvas* pCanvas; - GLPrimitiveRenderer* m_primRenderer; - Gwen::Controls::TabButton* m_demoPage; - - Gwen::Controls::Label* m_rightStatusBar; - Gwen::Controls::Label* m_leftStatusBar; - - b3AlignedObjectArray m_handlers; - b3ToggleButtonCallback m_toggleButtonCallback; - b3ComboBoxCallback m_comboBoxCallback; - -}; -GwenUserInterface::GwenUserInterface() -{ - m_data = new GwenInternalData(); - m_data->m_toggleButtonCallback = 0; - m_data->m_comboBoxCallback = 0; - -} - -GwenUserInterface::~GwenUserInterface() -{ - for (int i=0;im_handlers.size();i++) - { - delete m_data->m_handlers[i]; - } - - m_data->m_handlers.clear(); - - - delete m_data->pCanvas; - - GLPrimitiveRenderer* prim = m_data->m_primRenderer; - GwenOpenGL3CoreRenderer* coreRend = m_data->pRenderer; - - delete m_data; - - delete prim; - delete coreRend; - -} - - -struct MyTestMenuBar : public Gwen::Controls::MenuStrip -{ - - - - MyTestMenuBar(Gwen::Controls::Base* pParent) - :Gwen::Controls::MenuStrip(pParent) - { -// Gwen::Controls::MenuStrip* menu = new Gwen::Controls::MenuStrip( pParent ); - { - Gwen::Controls::MenuItem* pRoot = AddItem( L"File" ); - - pRoot = AddItem( L"View" ); -// Gwen::Event::Handler* handler = GWEN_MCALL(&MyTestMenuBar::MenuItemSelect ); - pRoot->GetMenu()->AddItem( L"Profiler");//,,m_profileWindow,(Gwen::Event::Handler::Function)&MyProfileWindow::MenuItemSelect); - -/* pRoot->GetMenu()->AddItem( L"New", L"test16.png", GWEN_MCALL( ThisClass::MenuItemSelect ) ); - pRoot->GetMenu()->AddItem( L"Load", L"test16.png", GWEN_MCALL( ThisClass::MenuItemSelect ) ); - pRoot->GetMenu()->AddItem( L"Save", GWEN_MCALL( ThisClass::MenuItemSelect ) ); - pRoot->GetMenu()->AddItem( L"Save As..", GWEN_MCALL( ThisClass::MenuItemSelect ) ); - pRoot->GetMenu()->AddItem( L"Quit", GWEN_MCALL( ThisClass::MenuItemSelect ) ); - */ - } - } - -}; - -void GwenUserInterface::resize(int width, int height) -{ - m_data->pCanvas->SetSize(width,height); -} - - -struct MyComboBoxHander :public Gwen::Event::Handler -{ - GwenInternalData* m_data; - int m_buttonId; - - MyComboBoxHander (GwenInternalData* data, int buttonId) - :m_data(data), - m_buttonId(buttonId) - { - } - - void onSelect( Gwen::Controls::Base* pControl ) - { - Gwen::Controls::ComboBox* but = (Gwen::Controls::ComboBox*) pControl; - - - - Gwen::String str = Gwen::Utility::UnicodeToString( but->GetSelectedItem()->GetText()); - - if (m_data->m_comboBoxCallback) - (*m_data->m_comboBoxCallback)(m_buttonId,str.c_str()); - } - -}; - -struct MyButtonHander :public Gwen::Event::Handler -{ - GwenInternalData* m_data; - int m_buttonId; - - MyButtonHander (GwenInternalData* data, int buttonId) - :m_data(data), - m_buttonId(buttonId) - { - } - - void onButtonA( Gwen::Controls::Base* pControl ) - { - Gwen::Controls::Button* but = (Gwen::Controls::Button*) pControl; - int dep = but->IsDepressed(); - int tog = but->GetToggleState(); - if (m_data->m_toggleButtonCallback) - (*m_data->m_toggleButtonCallback)(m_buttonId,tog); - } - -}; - - -void GwenUserInterface::setStatusBarMessage(const char* message, bool isLeft) -{ - Gwen::UnicodeString msg = Gwen::Utility::StringToUnicode(message); - if (isLeft) - { - m_data->m_leftStatusBar->SetText( msg); - } else - { - m_data->m_rightStatusBar->SetText( msg); - - } -} - -void GwenUserInterface::init(int width, int height,struct sth_stash* stash,float retinaScale) -{ - m_data->m_primRenderer = new GLPrimitiveRenderer(width,height); - m_data->pRenderer = new GwenOpenGL3CoreRenderer(m_data->m_primRenderer,stash,width,height,retinaScale); - - m_data->skin.SetRender( m_data->pRenderer ); - - m_data->pCanvas= new Gwen::Controls::Canvas( &m_data->skin ); - m_data->pCanvas->SetSize( width,height); - m_data->pCanvas->SetDrawBackground( false); - m_data->pCanvas->SetBackgroundColor( Gwen::Color( 150, 170, 170, 255 ) ); - - MyTestMenuBar* menubar = new MyTestMenuBar(m_data->pCanvas); - Gwen::Controls::StatusBar* bar = new Gwen::Controls::StatusBar(m_data->pCanvas); - m_data->m_rightStatusBar = new Gwen::Controls::Label( bar ); - m_data->m_rightStatusBar->SetWidth(width/2); - //m_data->m_rightStatusBar->SetText( L"Label Added to Right" ); - bar->AddControl( m_data->m_rightStatusBar, true ); - - m_data->m_leftStatusBar = new Gwen::Controls::Label( bar ); - //m_data->m_leftStatusBar->SetText( L"Label Added to Left" ); - m_data->m_leftStatusBar->SetWidth(width/2); - bar->AddControl( m_data->m_leftStatusBar,false); - - /*Gwen::Controls::GroupBox* box = new Gwen::Controls::GroupBox(m_data->pCanvas); - box->SetText("text"); - box->SetName("name"); - box->SetHeight(500); - */ - Gwen::Controls::ScrollControl* windowLeft= new Gwen::Controls::ScrollControl(m_data->pCanvas); - windowLeft->Dock(Gwen::Pos::Right); - windowLeft->SetWidth(150); - windowLeft->SetHeight(250); - windowLeft->SetScroll(false,true); - - /*Gwen::Controls::WindowControl* windowLeft = new Gwen::Controls::WindowControl(m_data->pCanvas); - windowLeft->Dock(Gwen::Pos::Left); - windowLeft->SetTitle("title"); - windowLeft->SetWidth(150); - windowLeft->SetClosable(false); - windowLeft->SetShouldDrawBackground(true); - windowLeft->SetTabable(true); - */ - - //windowLeft->SetSkin( - Gwen::Controls::TabControl* tab = new Gwen::Controls::TabControl(windowLeft); - - //tab->SetHeight(300); - tab->SetWidth(140); - tab->SetHeight(250); - //tab->Dock(Gwen::Pos::Left); - tab->Dock( Gwen::Pos::Fill ); - //tab->SetMargin( Gwen::Margin( 2, 2, 2, 2 ) ); - - Gwen::UnicodeString str1(L"Main"); - m_data->m_demoPage = tab->AddPage(str1); - - - - - Gwen::UnicodeString str2(L"OpenCL"); - tab->AddPage(str2); - //Gwen::UnicodeString str3(L"page3"); -// tab->AddPage(str3); - - - - //but->onPress.Add(handler, &MyHander::onButtonA); - - - - //box->Dock(Gwen::Pos::Left); - - /*Gwen::Controls::WindowControl* windowBottom = new Gwen::Controls::WindowControl(m_data->pCanvas); - windowBottom->SetHeight(100); - windowBottom->Dock(Gwen::Pos::Bottom); - windowBottom->SetTitle("bottom"); - */ -// Gwen::Controls::Property::Text* prop = new Gwen::Controls::Property::Text(m_data->pCanvas); - //prop->Dock(Gwen::Pos::Bottom); - /*Gwen::Controls::SplitterBar* split = new Gwen::Controls::SplitterBar(m_data->pCanvas); - split->Dock(Gwen::Pos::Center); - split->SetHeight(300); - split->SetWidth(300); - */ - /* - - - */ -} - - -void GwenUserInterface::setToggleButtonCallback(b3ToggleButtonCallback callback) -{ - m_data->m_toggleButtonCallback = callback; -} -void GwenUserInterface::registerToggleButton(int buttonId, const char* name) -{ - assert(m_data); - assert(m_data->m_demoPage); - - Gwen::Controls::Button* but = new Gwen::Controls::Button(m_data->m_demoPage->GetPage()); - - ///some heuristic to find the button location - int ypos = m_data->m_handlers.size()*20; - but->SetPos(10, ypos ); - but->SetWidth( 100 ); - //but->SetBounds( 200, 30, 300, 200 ); - - MyButtonHander* handler = new MyButtonHander(m_data, buttonId); - m_data->m_handlers.push_back(handler); - but->onToggle.Add(handler, &MyButtonHander::onButtonA); - but->SetIsToggle(true); - but->SetToggleState(false); - but->SetText(name); - -} - -void GwenUserInterface::setComboBoxCallback(b3ComboBoxCallback callback) -{ - m_data->m_comboBoxCallback = callback; -} - -void GwenUserInterface::registerComboBox(int comboboxId, int numItems, const char** items) -{ - Gwen::Controls::ComboBox* combobox = new Gwen::Controls::ComboBox(m_data->m_demoPage->GetPage()); - MyComboBoxHander* handler = new MyComboBoxHander(m_data, comboboxId); - m_data->m_handlers.push_back(handler); - - combobox->onSelection.Add(handler,&MyComboBoxHander::onSelect); - int ypos = m_data->m_handlers.size()*20; - combobox->SetPos(10, ypos ); - combobox->SetWidth( 100 ); - //box->SetPos(120,130); - for (int i=0;iAddItem(Gwen::Utility::StringToUnicode(items[i])); - - -} - -void GwenUserInterface::draw(int width, int height) -{ - -// printf("width = %d, height=%d\n", width,height); - if (m_data->pCanvas) - { - m_data->pCanvas->SetSize(width,height); - m_data->m_primRenderer->setScreenSize(width,height); - m_data->pRenderer->resize(width,height); - m_data->pCanvas->RenderCanvas(); - //restoreOpenGLState(); - } - -} - -bool GwenUserInterface::mouseMoveCallback( float x, float y) -{ - bool handled = false; - - static int m_lastmousepos[2] = {0,0}; - static bool isInitialized = false; - if (m_data->pCanvas) - { - if (!isInitialized) - { - isInitialized = true; - m_lastmousepos[0] = x+1; - m_lastmousepos[1] = y+1; - } - handled = m_data->pCanvas->InputMouseMoved(x,y,m_lastmousepos[0],m_lastmousepos[1]); - } - return handled; - -} -bool GwenUserInterface::mouseButtonCallback(int button, int state, float x, float y) -{ - bool handled = false; - if (m_data->pCanvas) - { - handled = m_data->pCanvas->InputMouseMoved(x,y,x, y); - - if (button>=0) - { - handled = m_data->pCanvas->InputMouseButton(button,state); - if (handled) - { - //if (!state) - // return false; - } - } - } - return handled; -} diff --git a/Demos3/CpuDemos/gwenUserInterface.h b/Demos3/CpuDemos/gwenUserInterface.h deleted file mode 100644 index 9a48ad5cf..000000000 --- a/Demos3/CpuDemos/gwenUserInterface.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef _GWEN_USER_INTERFACE_H -#define _GWEN_USER_INTERFACE_H - -struct GwenInternalData; - -typedef void (*b3ComboBoxCallback) (int combobox, const char* item); -typedef void (*b3ToggleButtonCallback)(int button, int state); - -class GwenUserInterface -{ - GwenInternalData* m_data; - - public: - - GwenUserInterface(); - - virtual ~GwenUserInterface(); - - void init(int width, int height,struct sth_stash* stash,float retinaScale); - - void draw(int width, int height); - - void resize(int width, int height); - - bool mouseMoveCallback( float x, float y); - bool mouseButtonCallback(int button, int state, float x, float y); - - void setToggleButtonCallback(b3ToggleButtonCallback callback); - void registerToggleButton(int buttonId, const char* name); - - void setComboBoxCallback(b3ComboBoxCallback callback); - void registerComboBox(int buttonId, int numItems, const char** items); - - void setStatusBarMessage(const char* message, bool isLeft=true); -}; - -#endif //_GWEN_USER_INTERFACE_H - diff --git a/Demos3/CpuDemos/main_opengl3core.cpp b/Demos3/CpuDemos/main_opengl3core.cpp index ec9bbadc1..456580d14 100644 --- a/Demos3/CpuDemos/main_opengl3core.cpp +++ b/Demos3/CpuDemos/main_opengl3core.cpp @@ -26,7 +26,7 @@ #include "OpenGLWindow/opengl_fontstashcallbacks.h" #include "gwenUserInterface.h" -#include "../btgui/Timing/b3Quickprof.h" +#include "../btgui/Bullet3AppSupport/b3Quickprof.h" #include "../btgui/OpenGLWindow/GLRenderToTexture.h" bool exportFrame=false; diff --git a/Demos3/CpuDemos/premake4.lua b/Demos3/CpuDemos/premake4.lua index 4d0366bf6..1c26293a6 100644 --- a/Demos3/CpuDemos/premake4.lua +++ b/Demos3/CpuDemos/premake4.lua @@ -50,10 +50,10 @@ files { "../../btgui/OpenGLWindow/OpenSans.cpp", "../../btgui/stb_image/stb_image.cpp", "../../btgui/stb_image/stb_image.h", - "../../btgui/Timing/b3Quickprof.cpp", - "../../btgui/Timing/b3Quickprof.h", - "../../btgui/Timing/b3Clock.cpp", - "../../btgui/Timing/b3Clock.h", + "../../btgui/Bullet3AppSupport/b3Quickprof.cpp", + "../../btgui/Bullet3AppSupport/b3Quickprof.h", + "../../btgui/Bullet3AppSupport/b3Clock.cpp", + "../../btgui/Bullet3AppSupport/b3Clock.h", } if os.is("Windows") then diff --git a/Demos3/GpuDemos/CMakeLists.txt b/Demos3/GpuDemos/CMakeLists.txt index 0cb6f2c0e..3dd1ec183 100644 --- a/Demos3/GpuDemos/CMakeLists.txt +++ b/Demos3/GpuDemos/CMakeLists.txt @@ -11,7 +11,6 @@ INCLUDE_DIRECTORIES( SET(App_Bullet3_OpenCL_Demos_SRCS ../../src/clew/clew.c GpuDemo.cpp - gwenUserInterface.cpp main_opengl3core.cpp ParticleDemo.cpp broadphase/PairBench.cpp @@ -28,8 +27,9 @@ SET(App_Bullet3_OpenCL_Demos_SRCS softbody/GpuSoftBodyDemo.cpp ../Wavefront/tiny_obj_loader.cpp ../../btgui/stb_image/stb_image.cpp - ../../btgui/Timing/b3Quickprof.cpp - ../../btgui/Timing/b3Clock.cpp + ../../btgui/Bullet3AppSupport/b3Quickprof.cpp + ../../btgui/Bullet3AppSupport/b3Clock.cpp + ../../btgui/Bullet3AppSupport/gwenUserInterface.cpp ${BULLET_PHYSICS_SOURCE_DIR}/build3/bullet.rc ) diff --git a/Demos3/GpuDemos/broadphase/PairBench.cpp b/Demos3/GpuDemos/broadphase/PairBench.cpp index 021f7e688..9ec61a217 100644 --- a/Demos3/GpuDemos/broadphase/PairBench.cpp +++ b/Demos3/GpuDemos/broadphase/PairBench.cpp @@ -1,6 +1,6 @@ //those header files need to be at the top, because of conflict __global and STL -#include "../gwenUserInterface.h" -#include "../gwenInternalData.h" +#include "Bullet3AppSupport/gwenUserInterface.h" +#include "Bullet3AppSupport/gwenInternalData.h" #include "PairBench.h" #include "OpenGLWindow/ShapeData.h" @@ -16,7 +16,7 @@ #include "OpenGLWindow/OpenGLInclude.h" #include "OpenGLWindow/GLInstanceRendererInternalData.h" #include "Bullet3OpenCL/ParallelPrimitives/b3LauncherCL.h" -#include "../../../btgui/Timing/b3Quickprof.h" +#include "../../../btgui/Bullet3AppSupport/b3Quickprof.h" #include diff --git a/Demos3/GpuDemos/constraints/ConstraintsDemo.cpp b/Demos3/GpuDemos/constraints/ConstraintsDemo.cpp index 19f6f6405..14101b00b 100644 --- a/Demos3/GpuDemos/constraints/ConstraintsDemo.cpp +++ b/Demos3/GpuDemos/constraints/ConstraintsDemo.cpp @@ -29,7 +29,7 @@ subject to the following restrictions: #include "Bullet3OpenCL/RigidBody/b3GpuNarrowPhase.h" #include "Bullet3Collision/NarrowPhaseCollision/b3Config.h" #include "../rigidbody/GpuRigidBodyDemoInternalData.h" -#include "../gwenUserInterface.h" +#include "Bullet3AppSupport/gwenUserInterface.h" #include "Bullet3Dynamics/ConstraintSolver/b3Point2PointConstraint.h" #include "Bullet3Dynamics/ConstraintSolver/b3Generic6DofConstraint.h" #include "Bullet3Dynamics/ConstraintSolver/b3FixedConstraint.h" @@ -287,4 +287,4 @@ void GpuConstraintsDemo::createStaticEnvironment(const ConstructionInfo& ci) int pid = m_data->m_rigidBodyPipeline->registerPhysicsInstance(0.f,position,orn,colIndex,index,false); } -} \ No newline at end of file +} diff --git a/Demos3/GpuDemos/main_opengl3core.cpp b/Demos3/GpuDemos/main_opengl3core.cpp index 1c8a26476..8ab230943 100644 --- a/Demos3/GpuDemos/main_opengl3core.cpp +++ b/Demos3/GpuDemos/main_opengl3core.cpp @@ -26,7 +26,7 @@ #include #include "OpenGLWindow/fontstash.h" #include "OpenGLWindow/opengl_fontstashcallbacks.h" -#include "gwenUserInterface.h" +#include "Bullet3AppSupport/gwenUserInterface.h" #include "ParticleDemo.h" #include "broadphase/PairBench.h" #include "rigidbody/GpuRigidBodyDemo.h" @@ -36,7 +36,7 @@ #include "rigidbody/GpuSphereScene.h" #include "rigidbody/Bullet2FileDemo.h" #include "softbody/GpuSoftBodyDemo.h" -#include "../btgui/Timing/b3Quickprof.h" +#include "../btgui/Bullet3AppSupport/b3Quickprof.h" #include "../btgui/OpenGLWindow/GLRenderToTexture.h" #include "raytrace/RaytracedShadowDemo.h" diff --git a/Demos3/GpuDemos/premake4.lua b/Demos3/GpuDemos/premake4.lua index 2ef0c17ac..87c492cc2 100644 --- a/Demos3/GpuDemos/premake4.lua +++ b/Demos3/GpuDemos/premake4.lua @@ -24,6 +24,7 @@ function createProject(vendor) } links { + "Bullet3AppSupport", "gwen", "Bullet2FileLoader", "Bullet3OpenCL_" .. vendor, @@ -59,10 +60,6 @@ function createProject(vendor) "../../btgui/OpenGLWindow/OpenSans.cpp", "../../btgui/stb_image/stb_image.cpp", "../../btgui/stb_image/stb_image.h", - "../../btgui/Timing/b3Quickprof.cpp", - "../../btgui/Timing/b3Quickprof.h", - "../../btgui/Timing/b3Clock.cpp", - "../../btgui/Timing/b3Clock.h", } if _OPTIONS["midi"] then diff --git a/Demos3/GpuDemos/raytrace/RaytracedShadowDemo.cpp b/Demos3/GpuDemos/raytrace/RaytracedShadowDemo.cpp index 5c75d12e0..9446a1571 100644 --- a/Demos3/GpuDemos/raytrace/RaytracedShadowDemo.cpp +++ b/Demos3/GpuDemos/raytrace/RaytracedShadowDemo.cpp @@ -19,7 +19,7 @@ #include "Bullet3OpenCL/RigidBody/b3GpuNarrowPhase.h" #include "Bullet3Collision/NarrowPhaseCollision/b3Config.h" #include "../rigidbody/GpuRigidBodyDemoInternalData.h" -#include "../gwenUserInterface.h" +#include "Bullet3AppSupport/gwenUserInterface.h" #include "Bullet3Dynamics/ConstraintSolver/b3Point2PointConstraint.h" #include "OpenGLWindow/GLPrimitiveRenderer.h" #include "Bullet3OpenCL/Raycast/b3GpuRaycast.h" diff --git a/Demos3/GpuDemos/rigidbody/ConcaveScene.cpp b/Demos3/GpuDemos/rigidbody/ConcaveScene.cpp index daf4c151a..1abb93b8a 100644 --- a/Demos3/GpuDemos/rigidbody/ConcaveScene.cpp +++ b/Demos3/GpuDemos/rigidbody/ConcaveScene.cpp @@ -19,7 +19,7 @@ #include "Bullet3Common/b3Transform.h" #include "Bullet3Collision/NarrowPhaseCollision/b3ConvexUtility.h" -#include "../gwenUserInterface.h" +#include "Bullet3AppSupport/gwenUserInterface.h" #include "OpenGLWindow/GLInstanceGraphicsShape.h" #define CONCAVE_GAPX 14 #define CONCAVE_GAPY 5 diff --git a/Demos3/GpuDemos/rigidbody/GpuConvexScene.cpp b/Demos3/GpuDemos/rigidbody/GpuConvexScene.cpp index b1e4218fb..10c334d3f 100644 --- a/Demos3/GpuDemos/rigidbody/GpuConvexScene.cpp +++ b/Demos3/GpuDemos/rigidbody/GpuConvexScene.cpp @@ -15,7 +15,7 @@ #include "Bullet3OpenCL/RigidBody/b3GpuNarrowPhase.h" #include "Bullet3Collision/NarrowPhaseCollision/b3Config.h" #include "GpuRigidBodyDemoInternalData.h" -#include "../gwenUserInterface.h" +#include "Bullet3AppSupport/gwenUserInterface.h" #include "Bullet3Dynamics/ConstraintSolver/b3Point2PointConstraint.h" #include "OpenGLWindow/GLPrimitiveRenderer.h" #include "Bullet3OpenCL/Raycast/b3GpuRaycast.h" diff --git a/Demos3/GpuDemos/rigidbody/GpuSphereScene.cpp b/Demos3/GpuDemos/rigidbody/GpuSphereScene.cpp index e3b77baf8..b3f0f4629 100644 --- a/Demos3/GpuDemos/rigidbody/GpuSphereScene.cpp +++ b/Demos3/GpuDemos/rigidbody/GpuSphereScene.cpp @@ -14,7 +14,7 @@ #include "Bullet3OpenCL/RigidBody/b3GpuNarrowPhase.h" #include "Bullet3Collision/NarrowPhaseCollision/b3Config.h" #include "GpuRigidBodyDemoInternalData.h" -#include "../gwenUserInterface.h" +#include "Bullet3AppSupport/gwenUserInterface.h" @@ -201,4 +201,4 @@ void GpuSphereScene::setupScene(const ConstructionInfo& ci) int numInstances = index; sprintf(msg,"Num objects = %d",numInstances); ci.m_gui->setStatusBarMessage(msg,true); -} \ No newline at end of file +} diff --git a/Demos3/GpuGuiInitialize/main.cpp b/Demos3/GpuGuiInitialize/main.cpp index 386d6a563..30a4c7289 100644 --- a/Demos3/GpuGuiInitialize/main.cpp +++ b/Demos3/GpuGuiInitialize/main.cpp @@ -18,7 +18,7 @@ #include "OpenGLWindow/opengl_fontstashcallbacks.h" #include "OpenGLWindow/GwenOpenGL3CoreRenderer.h" -#include "../btgui/Timing/b3Quickprof.h" +#include "../btgui/Bullet3AppSupport/b3Quickprof.h" #include "Gwen/Gwen.h" #include "Gwen/Controls/Button.h" diff --git a/Demos3/GpuGuiInitialize/premake4.lua b/Demos3/GpuGuiInitialize/premake4.lua index 511a8e21a..61a09a3ab 100644 --- a/Demos3/GpuGuiInitialize/premake4.lua +++ b/Demos3/GpuGuiInitialize/premake4.lua @@ -52,10 +52,10 @@ function createProject(vendor) "../../src/Bullet3Common/b3AlignedAllocator.cpp", "../../src/Bullet3Common/b3Logging.cpp", "../../src/Bullet3Common/b3Logging.h", - "../../btgui/Timing/b3Quickprof.cpp", - "../../btgui/Timing/b3Quickprof.h", - "../../btgui/Timing/b3Clock.cpp", - "../../btgui/Timing/b3Clock.h", + "../../btgui/Bullet3AppSupport/b3Quickprof.cpp", + "../../btgui/Bullet3AppSupport/b3Quickprof.h", + "../../btgui/Bullet3AppSupport/b3Clock.cpp", + "../../btgui/Bullet3AppSupport/b3Clock.h", } diff --git a/Demos3/ImplicitCloth/premake4.lua b/Demos3/ImplicitCloth/premake4.lua index 6a1c8e254..93be4a3af 100644 --- a/Demos3/ImplicitCloth/premake4.lua +++ b/Demos3/ImplicitCloth/premake4.lua @@ -42,8 +42,8 @@ "../../btgui/OpenGLWindow/opengl_fontstashcallbacks.h", "../../src/Bullet3Common/**.cpp", "../../src/Bullet3Common/**.h", - "../../btgui/Timing/b3Clock.cpp", - "../../btgui/Timing/b3Clock.h" + "../../btgui/Bullet3AppSupport/b3Clock.cpp", + "../../btgui/Bullet3AppSupport/b3Clock.h" } diff --git a/Demos3/ImportObjDemo/ImportObjSetup.h b/Demos3/ImportObjDemo/ImportObjSetup.h index 2d552a108..cdeb649e7 100644 --- a/Demos3/ImportObjDemo/ImportObjSetup.h +++ b/Demos3/ImportObjDemo/ImportObjSetup.h @@ -2,7 +2,7 @@ #define IMPORT_OBJ_SETUP_H -#include "../../Demos/CommonRigidBodySetup.h" +#include "Bullet3AppSupport/CommonRigidBodySetup.h" class ImportObjDemo : public CommonRigidBodySetup { diff --git a/Demos3/ImportSTLDemo/ImportSTLSetup.h b/Demos3/ImportSTLDemo/ImportSTLSetup.h index 8b0c94edc..94b04fc3f 100644 --- a/Demos3/ImportSTLDemo/ImportSTLSetup.h +++ b/Demos3/ImportSTLDemo/ImportSTLSetup.h @@ -2,7 +2,7 @@ #define IMPORT_STL_SETUP_H -#include "../../Demos/CommonRigidBodySetup.h" +#include "Bullet3AppSupport/CommonRigidBodySetup.h" class ImportSTLDemo : public CommonRigidBodySetup { diff --git a/Demos3/ImportURDFDemo/ImportURDFSetup.h b/Demos3/ImportURDFDemo/ImportURDFSetup.h index 9151804e2..a9e0e4ef5 100644 --- a/Demos3/ImportURDFDemo/ImportURDFSetup.h +++ b/Demos3/ImportURDFDemo/ImportURDFSetup.h @@ -2,7 +2,7 @@ #define IMPORT_URDF_SETUP_H -#include "../../Demos/CommonMultiBodySetup.h" +#include "Bullet3AppSupport/CommonMultiBodySetup.h" class ImportUrdfDemo : public CommonMultiBodySetup { diff --git a/Demos3/bullet2/BasicDemo/BasicDemo.h b/Demos3/bullet2/BasicDemo/BasicDemo.h index 7bc77b306..5898c2dc7 100644 --- a/Demos3/bullet2/BasicDemo/BasicDemo.h +++ b/Demos3/bullet2/BasicDemo/BasicDemo.h @@ -2,7 +2,7 @@ #define BASIC_DEMO_H #include "LinearMath/btVector3.h" -#include "Bullet2RigidBodyDemo.h" +#include "Bullet3AppSupport/Bullet2RigidBodyDemo.h" #include "../../../Demos/BasicDemo/BasicDemoPhysicsSetup.h" diff --git a/Demos3/bullet2/ChainDemo/ChainDemo.h b/Demos3/bullet2/ChainDemo/ChainDemo.h index 09f0b4707..c69e46ab7 100644 --- a/Demos3/bullet2/ChainDemo/ChainDemo.h +++ b/Demos3/bullet2/ChainDemo/ChainDemo.h @@ -2,7 +2,7 @@ #define CHAIN_DEMO_H #include "LinearMath/btVector3.h" -#include "../BasicDemo/Bullet2RigidBodyDemo.h" +#include "Bullet3AppSupport/Bullet2RigidBodyDemo.h" diff --git a/Demos3/bullet2/ConstraintDemo/ConstraintPhysicsSetup.h b/Demos3/bullet2/ConstraintDemo/ConstraintPhysicsSetup.h index 59cc66b08..ec1267622 100644 --- a/Demos3/bullet2/ConstraintDemo/ConstraintPhysicsSetup.h +++ b/Demos3/bullet2/ConstraintDemo/ConstraintPhysicsSetup.h @@ -1,16 +1,16 @@ -#ifndef CONSTAINT_PHYSICS_SETUP_H -#define CONSTAINT_PHYSICS_SETUP_H - -#include "../../../Demos/CommonRigidBodySetup.h" - -struct ConstraintPhysicsSetup : public CommonRigidBodySetup -{ - ConstraintPhysicsSetup(); - virtual ~ConstraintPhysicsSetup(); - virtual void initPhysics(GraphicsPhysicsBridge& gfxBridge); - - virtual void stepSimulation(float deltaTime); - -}; - -#endif //CONSTAINT_PHYSICS_SETUP_H +#ifndef CONSTAINT_PHYSICS_SETUP_H +#define CONSTAINT_PHYSICS_SETUP_H + +#include "Bullet3AppSupport/CommonRigidBodySetup.h" + +struct ConstraintPhysicsSetup : public CommonRigidBodySetup +{ + ConstraintPhysicsSetup(); + virtual ~ConstraintPhysicsSetup(); + virtual void initPhysics(GraphicsPhysicsBridge& gfxBridge); + + virtual void stepSimulation(float deltaTime); + +}; + +#endif //CONSTAINT_PHYSICS_SETUP_H diff --git a/Demos3/bullet2/FeatherstoneMultiBodyDemo/BulletMultiBodyDemos.h b/Demos3/bullet2/FeatherstoneMultiBodyDemo/BulletMultiBodyDemos.h index 928691fd1..9618cd2ed 100644 --- a/Demos3/bullet2/FeatherstoneMultiBodyDemo/BulletMultiBodyDemos.h +++ b/Demos3/bullet2/FeatherstoneMultiBodyDemo/BulletMultiBodyDemos.h @@ -4,7 +4,7 @@ #include "LinearMath/btVector3.h" -#include "../../AllBullet2Demos/BulletDemoInterface.h" +#include "Bullet3AppSupport/BulletDemoInterface.h" #include "LinearMath/btAlignedObjectArray.h" diff --git a/Demos3/bullet2/LuaDemo/LuaPhysicsSetup.h b/Demos3/bullet2/LuaDemo/LuaPhysicsSetup.h index cad0cbd34..fe9f8a5ec 100644 --- a/Demos3/bullet2/LuaDemo/LuaPhysicsSetup.h +++ b/Demos3/bullet2/LuaDemo/LuaPhysicsSetup.h @@ -1,12 +1,12 @@ #ifndef _LUA_PHYSICS_SETUP_H #define _LUA_PHYSICS_SETUP_H -#include "../Demos/CommonPhysicsSetup.h" +#include "Bullet3AppSupport/CommonPhysicsSetup.h" //we don't derive from CommonRigidBodySetup because we //create and own our own dynamics world (one or more) -//at run-time -struct LuaPhysicsSetup : public CommonPhysicsSetup +//at run-time +struct LuaPhysicsSetup : public CommonPhysicsSetup { LuaPhysicsSetup(class SimpleOpenGL3App* app); @@ -18,9 +18,9 @@ struct LuaPhysicsSetup : public CommonPhysicsSetup class btNNCGConstraintSolver* m_solver; class btDiscreteDynamicsWorld* m_dynamicsWorld; class SimpleOpenGL3App* m_glApp; - - virtual void initPhysics(GraphicsPhysicsBridge& gfxBridge); - + + virtual void initPhysics(GraphicsPhysicsBridge& gfxBridge); + virtual void exitPhysics(); virtual void stepSimulation(float deltaTime); @@ -36,8 +36,8 @@ struct LuaPhysicsSetup : public CommonPhysicsSetup virtual btRigidBody* createRigidBody(float mass, const btTransform& startTransform,btCollisionShape* shape, const btVector4& color=btVector4(1,0,0,1)); virtual btBoxShape* createBoxShape(const btVector3& halfExtents); - -}; + +}; #endif //_LUA_PHYSICS_SETUP_H diff --git a/Demos3/bullet2/MultiBodyDemo/TestJointTorqueSetup.h b/Demos3/bullet2/MultiBodyDemo/TestJointTorqueSetup.h index 89ae864fe..23a635d80 100644 --- a/Demos3/bullet2/MultiBodyDemo/TestJointTorqueSetup.h +++ b/Demos3/bullet2/MultiBodyDemo/TestJointTorqueSetup.h @@ -1,7 +1,7 @@ #ifndef TEST_JOINT_TORQUE_SETUP_H #define TEST_JOINT_TORQUE_SETUP_H -#include "../../../Demos/CommonMultiBodySetup.h" +#include "Bullet3AppSupport/CommonMultiBodySetup.h" struct TestJointTorqueSetup : public CommonMultiBodySetup { diff --git a/Demos3/bullet2/RagdollDemo/RagdollDemo.h b/Demos3/bullet2/RagdollDemo/RagdollDemo.h index e42379565..60cfa9d57 100644 --- a/Demos3/bullet2/RagdollDemo/RagdollDemo.h +++ b/Demos3/bullet2/RagdollDemo/RagdollDemo.h @@ -2,7 +2,7 @@ #define RAGDOLL_DEMO_H -#include "../../../Demos/CommonRigidBodySetup.h" +#include "Bullet3AppSupport/CommonRigidBodySetup.h" #include "../BasicDemo/BasicDemo.h" struct BulletDemoInterface; diff --git a/Demos3/bullet2/BasicDemo/Bullet2RigidBodyDemo.cpp b/btgui/Bullet3AppSupport/Bullet2RigidBodyDemo.cpp similarity index 100% rename from Demos3/bullet2/BasicDemo/Bullet2RigidBodyDemo.cpp rename to btgui/Bullet3AppSupport/Bullet2RigidBodyDemo.cpp diff --git a/Demos3/bullet2/BasicDemo/Bullet2RigidBodyDemo.h b/btgui/Bullet3AppSupport/Bullet2RigidBodyDemo.h similarity index 91% rename from Demos3/bullet2/BasicDemo/Bullet2RigidBodyDemo.h rename to btgui/Bullet3AppSupport/Bullet2RigidBodyDemo.h index 7cf7a85a4..9362e0f2f 100644 --- a/Demos3/bullet2/BasicDemo/Bullet2RigidBodyDemo.h +++ b/btgui/Bullet3AppSupport/Bullet2RigidBodyDemo.h @@ -3,10 +3,9 @@ #include "LinearMath/btVector3.h" -#include "../../AllBullet2Demos/BulletDemoInterface.h" - +#include "BulletDemoInterface.h" #include "OpenGLWindow/b3gWindowInterface.h" -#include "../../../Demos/CommonPhysicsSetup.h" +#include "CommonPhysicsSetup.h" class Bullet2RigidBodyDemo : public BulletDemoInterface diff --git a/Demos3/AllBullet2Demos/BulletDemoInterface.h b/btgui/Bullet3AppSupport/BulletDemoInterface.h similarity index 100% rename from Demos3/AllBullet2Demos/BulletDemoInterface.h rename to btgui/Bullet3AppSupport/BulletDemoInterface.h diff --git a/btgui/Bullet3AppSupport/CMakeLists.txt b/btgui/Bullet3AppSupport/CMakeLists.txt new file mode 100644 index 000000000..e63c594fa --- /dev/null +++ b/btgui/Bullet3AppSupport/CMakeLists.txt @@ -0,0 +1,30 @@ + +INCLUDE_DIRECTORIES( + ${BULLET_PHYSICS_SOURCE_DIR}/src + ${BULLET_PHYSICS_SOURCE_DIR}/btgui +) + +FILE(GLOB Bullet3AppSupport_HDRS "*.h" ) +FILE(GLOB Bullet3AppSupport_SRCS "*.cpp" ) + +IF (WIN32) + ADD_DEFINITIONS(-DGLEW_STATIC) +ENDIF(WIN32) +IF(NOT WIN32 AND NOT APPLE) + ADD_DEFINITIONS(-DGLEW_STATIC) + ADD_DEFINITIONS("-DGLEW_INIT_OPENGL11_FUNCTIONS=1") + ADD_DEFINITIONS("-DGLEW_DYNAMIC_LOAD_ALL_GLX_FUNCTIONS=1") +ENDIF() + +ADD_LIBRARY(Bullet3AppSupport ${Bullet3AppSupport_SRCS} ${Bullet3AppSupport_HDRS}) +if (UNIX AND NOT APPLE) + target_link_libraries(Bullet3AppSupport X11) +elseif (APPLE) + target_link_libraries(Bullet3AppSupport ${COCOA_LIBRARY}) +endif () + +if (BUILD_SHARED_LIBS) + target_link_libraries(Bullet3AppSupport OpenGLWindow Bullet3Common) +endif() + +target_link_libraries(Bullet3AppSupport ${OPENGL_gl_LIBRARY}) diff --git a/Demos/CommonMultiBodySetup.h b/btgui/Bullet3AppSupport/CommonMultiBodySetup.h similarity index 100% rename from Demos/CommonMultiBodySetup.h rename to btgui/Bullet3AppSupport/CommonMultiBodySetup.h diff --git a/Demos/CommonParameterInterface.h b/btgui/Bullet3AppSupport/CommonParameterInterface.h similarity index 100% rename from Demos/CommonParameterInterface.h rename to btgui/Bullet3AppSupport/CommonParameterInterface.h diff --git a/Demos/CommonPhysicsSetup.h b/btgui/Bullet3AppSupport/CommonPhysicsSetup.h similarity index 99% rename from Demos/CommonPhysicsSetup.h rename to btgui/Bullet3AppSupport/CommonPhysicsSetup.h index 994fb9271..0c818b9dc 100644 --- a/Demos/CommonPhysicsSetup.h +++ b/btgui/Bullet3AppSupport/CommonPhysicsSetup.h @@ -63,10 +63,11 @@ public: virtual void removePickingConstraint() = 0; virtual void syncPhysicsToGraphics(GraphicsPhysicsBridge& gfxBridge) = 0; - +/* virtual btRigidBody* createRigidBody(float mass, const btTransform& startTransform,btCollisionShape* shape, const btVector4& color=btVector4(1,0,0,1))=0; virtual btBoxShape* createBoxShape(const btVector3& halfExtents)=0; + */ }; diff --git a/Demos/CommonRigidBodySetup.h b/btgui/Bullet3AppSupport/CommonRigidBodySetup.h similarity index 100% rename from Demos/CommonRigidBodySetup.h rename to btgui/Bullet3AppSupport/CommonRigidBodySetup.h diff --git a/Demos3/AllBullet2Demos/GraphingTexture.cpp b/btgui/Bullet3AppSupport/GraphingTexture.cpp similarity index 100% rename from Demos3/AllBullet2Demos/GraphingTexture.cpp rename to btgui/Bullet3AppSupport/GraphingTexture.cpp diff --git a/Demos3/AllBullet2Demos/GraphingTexture.h b/btgui/Bullet3AppSupport/GraphingTexture.h similarity index 100% rename from Demos3/AllBullet2Demos/GraphingTexture.h rename to btgui/Bullet3AppSupport/GraphingTexture.h diff --git a/Demos3/AllBullet2Demos/GwenParameterInterface.cpp b/btgui/Bullet3AppSupport/GwenParameterInterface.cpp similarity index 99% rename from Demos3/AllBullet2Demos/GwenParameterInterface.cpp rename to btgui/Bullet3AppSupport/GwenParameterInterface.cpp index 93ce77fff..c1c1133f1 100644 --- a/Demos3/AllBullet2Demos/GwenParameterInterface.cpp +++ b/btgui/Bullet3AppSupport/GwenParameterInterface.cpp @@ -1,5 +1,5 @@ #include "GwenParameterInterface.h" -#include "../GpuDemos/gwenInternalData.h" +#include "gwenInternalData.h" diff --git a/Demos3/AllBullet2Demos/GwenParameterInterface.h b/btgui/Bullet3AppSupport/GwenParameterInterface.h similarity index 92% rename from Demos3/AllBullet2Demos/GwenParameterInterface.h rename to btgui/Bullet3AppSupport/GwenParameterInterface.h index 08c36b38e..a78ec20cb 100644 --- a/Demos3/AllBullet2Demos/GwenParameterInterface.h +++ b/btgui/Bullet3AppSupport/GwenParameterInterface.h @@ -1,7 +1,7 @@ #ifndef GWEN_PARAMETER_INTERFACE_H #define GWEN_PARAMETER_INTERFACE_H -#include "../../Demos/CommonParameterInterface.h" +#include "CommonParameterInterface.h" struct GwenParameterInterface : public CommonParameterInterface { diff --git a/Demos3/AllBullet2Demos/GwenProfileWindow.cpp b/btgui/Bullet3AppSupport/GwenProfileWindow.cpp similarity index 98% rename from Demos3/AllBullet2Demos/GwenProfileWindow.cpp rename to btgui/Bullet3AppSupport/GwenProfileWindow.cpp index 84d78de03..b10db3ef0 100644 --- a/Demos3/AllBullet2Demos/GwenProfileWindow.cpp +++ b/btgui/Bullet3AppSupport/GwenProfileWindow.cpp @@ -1,6 +1,6 @@ #include "GwenProfileWindow.h" -#include "../GpuDemos/gwenUserInterface.h" -#include "../GpuDemos/gwenInternalData.h" +#include "gwenUserInterface.h" +#include "gwenInternalData.h" #include "LinearMath/btQuickprof.h" diff --git a/Demos3/AllBullet2Demos/GwenProfileWindow.h b/btgui/Bullet3AppSupport/GwenProfileWindow.h similarity index 100% rename from Demos3/AllBullet2Demos/GwenProfileWindow.h rename to btgui/Bullet3AppSupport/GwenProfileWindow.h diff --git a/Demos3/AllBullet2Demos/GwenTextureWindow.cpp b/btgui/Bullet3AppSupport/GwenTextureWindow.cpp similarity index 96% rename from Demos3/AllBullet2Demos/GwenTextureWindow.cpp rename to btgui/Bullet3AppSupport/GwenTextureWindow.cpp index 8d927d8fc..477553f25 100644 --- a/Demos3/AllBullet2Demos/GwenTextureWindow.cpp +++ b/btgui/Bullet3AppSupport/GwenTextureWindow.cpp @@ -1,6 +1,6 @@ #include "GwenTextureWindow.h" -#include "../GpuDemos/gwenUserInterface.h" -#include "../GpuDemos/gwenInternalData.h" +#include "gwenUserInterface.h" +#include "gwenInternalData.h" #include "Gwen/Controls/ImagePanel.h" diff --git a/Demos3/AllBullet2Demos/GwenTextureWindow.h b/btgui/Bullet3AppSupport/GwenTextureWindow.h similarity index 100% rename from Demos3/AllBullet2Demos/GwenTextureWindow.h rename to btgui/Bullet3AppSupport/GwenTextureWindow.h diff --git a/Demos3/bullet2/BasicDemo/MyDebugDrawer.h b/btgui/Bullet3AppSupport/MyDebugDrawer.h similarity index 100% rename from Demos3/bullet2/BasicDemo/MyDebugDrawer.h rename to btgui/Bullet3AppSupport/MyDebugDrawer.h diff --git a/btgui/Timing/b3Clock.cpp b/btgui/Bullet3AppSupport/b3Clock.cpp similarity index 100% rename from btgui/Timing/b3Clock.cpp rename to btgui/Bullet3AppSupport/b3Clock.cpp diff --git a/btgui/Timing/b3Clock.h b/btgui/Bullet3AppSupport/b3Clock.h similarity index 100% rename from btgui/Timing/b3Clock.h rename to btgui/Bullet3AppSupport/b3Clock.h diff --git a/btgui/Timing/b3Quickprof.cpp b/btgui/Bullet3AppSupport/b3Quickprof.cpp similarity index 100% rename from btgui/Timing/b3Quickprof.cpp rename to btgui/Bullet3AppSupport/b3Quickprof.cpp diff --git a/btgui/Timing/b3Quickprof.h b/btgui/Bullet3AppSupport/b3Quickprof.h similarity index 100% rename from btgui/Timing/b3Quickprof.h rename to btgui/Bullet3AppSupport/b3Quickprof.h diff --git a/Demos3/GpuDemos/gwenInternalData.h b/btgui/Bullet3AppSupport/gwenInternalData.h similarity index 100% rename from Demos3/GpuDemos/gwenInternalData.h rename to btgui/Bullet3AppSupport/gwenInternalData.h diff --git a/Demos3/GpuDemos/gwenUserInterface.cpp b/btgui/Bullet3AppSupport/gwenUserInterface.cpp similarity index 99% rename from Demos3/GpuDemos/gwenUserInterface.cpp rename to btgui/Bullet3AppSupport/gwenUserInterface.cpp index 55a18168f..ca5d22b3d 100644 --- a/Demos3/GpuDemos/gwenUserInterface.cpp +++ b/btgui/Bullet3AppSupport/gwenUserInterface.cpp @@ -75,7 +75,8 @@ struct MyTestMenuBar : public Gwen::Controls::MenuStrip { // Gwen::Controls::MenuStrip* menu = new Gwen::Controls::MenuStrip( pParent ); { - m_menuItems = new MyMenuItems; + m_menuItems = new MyMenuItems(); + m_menuItems->m_fileOpenCallback = 0; m_fileMenu = AddItem( L"File" ); diff --git a/Demos3/GpuDemos/gwenUserInterface.h b/btgui/Bullet3AppSupport/gwenUserInterface.h similarity index 100% rename from Demos3/GpuDemos/gwenUserInterface.h rename to btgui/Bullet3AppSupport/gwenUserInterface.h diff --git a/btgui/Bullet3AppSupport/premake4.lua b/btgui/Bullet3AppSupport/premake4.lua new file mode 100644 index 000000000..b8752a165 --- /dev/null +++ b/btgui/Bullet3AppSupport/premake4.lua @@ -0,0 +1,26 @@ + + project "Bullet3AppSupport" + + language "C++" + + kind "StaticLib" + + initOpenGL() + initGlew() + + includedirs { + "..", + "../../src", + } + + --links { + --} + + files { + "*.cpp", + "*.h", + } + + if os.is("Linux") then + initX11() + end diff --git a/btgui/CMakeLists.txt b/btgui/CMakeLists.txt index 82b3ec97d..be213d89f 100644 --- a/btgui/CMakeLists.txt +++ b/btgui/CMakeLists.txt @@ -1,3 +1,3 @@ if (OPENGL_FOUND) -SUBDIRS( Gwen OpenGLWindow lua-5.2.3) +SUBDIRS( Bullet3AppSupport Gwen OpenGLWindow lua-5.2.3) endif(OPENGL_FOUND) diff --git a/btgui/GwenOpenGLTest/premake4.lua b/btgui/GwenOpenGLTest/premake4.lua index 46dd6fe4d..076fea3de 100644 --- a/btgui/GwenOpenGLTest/premake4.lua +++ b/btgui/GwenOpenGLTest/premake4.lua @@ -37,8 +37,8 @@ "../OpenGLWindow/fontstash.h", "../OpenGLWindow/opengl_fontstashcallbacks.cpp", "../OpenGLWindow/opengl_fontstashcallbacks.h", - "../../btgui/Timing/b3Clock.cpp", - "../../btgui/Timing/b3Clock.h", + "../Bullet3AppSupport/b3Clock.cpp", + "../Bullet3AppSupport/b3Clock.h", "**.cpp", "**.h", } diff --git a/build3/premake4.lua b/build3/premake4.lua index a9b4ec75d..a4306cb6b 100644 --- a/build3/premake4.lua +++ b/build3/premake4.lua @@ -130,6 +130,7 @@ if findOpenGL3() then -- include "../btgui/MultiThreading" include "../btgui/OpenGLWindow" + include "../btgui/Bullet3AppSupport" -- include "../Demos3/ImplicitCloth" include "../Demos3/SimpleOpenGL3" diff --git a/test/OpenCL/RadixSortBenchmark/main.cpp b/test/OpenCL/RadixSortBenchmark/main.cpp index 7de5856ac..37bf63275 100644 --- a/test/OpenCL/RadixSortBenchmark/main.cpp +++ b/test/OpenCL/RadixSortBenchmark/main.cpp @@ -66,7 +66,7 @@ #include "Bullet3OpenCL/ParallelPrimitives/b3RadixSort32CL.h" #include "Bullet3OpenCL/Initialize/b3OpenCLUtils.h" -#include "../btgui/Timing/b3Clock.h" +#include "../btgui/Bullet3AppSupport/b3Clock.h" cl_context g_cxMainContext; cl_device_id g_device; @@ -714,4 +714,4 @@ int main( int argc, char** argv) keys_only); -} \ No newline at end of file +} diff --git a/test/OpenCL/RadixSortBenchmark/premake4.lua b/test/OpenCL/RadixSortBenchmark/premake4.lua index a7da0b753..7ae29e634 100644 --- a/test/OpenCL/RadixSortBenchmark/premake4.lua +++ b/test/OpenCL/RadixSortBenchmark/premake4.lua @@ -30,10 +30,10 @@ function createProject(vendor) "../../../src/Bullet3Common/b3AlignedObjectArray.h", "../../../src/Bullet3Common/b3Logging.cpp", "../../../src/Bullet3Common/b3Logging.h", - "../../../btgui/Timing/b3Quickprof.cpp", - "../../../btgui/Timing/b3Quickprof.h", - "../../../btgui/Timing/b3Clock.cpp", - "../../../btgui/Timing/b3Clock.h", + "../../../btgui/Bullet3AppSupport/b3Quickprof.cpp", + "../../../btgui/Bullet3AppSupport/b3Quickprof.h", + "../../../btgui/Bullet3AppSupport/b3Clock.cpp", + "../../../btgui/Bullet3AppSupport/b3Clock.h", }