minor cleanup of btgui/demo3 stuff, much more demo cleanup is needed
moved some files in btgui/Bullet3AppSupport
This commit is contained in:
@@ -16,7 +16,7 @@ class btBoxShape;
|
||||
#include "LinearMath/btAlignedObjectArray.h"
|
||||
|
||||
|
||||
#include "../CommonRigidBodySetup.h"
|
||||
#include "Bullet3AppSupport/CommonRigidBodySetup.h"
|
||||
|
||||
struct BasicDemoPhysicsSetup : public CommonRigidBodySetup
|
||||
{
|
||||
|
||||
@@ -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}
|
||||
)
|
||||
|
||||
|
||||
@@ -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)
|
||||
ENDIF(INTERNAL_ADD_POSTFIX_EXECUTABLE_NAMES)
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#define CCD_PHYSICS_SETUP_H
|
||||
|
||||
|
||||
#include "../CommonRigidBodySetup.h"
|
||||
#include "Bullet3AppSupport/CommonRigidBodySetup.h"
|
||||
|
||||
struct CcdPhysicsSetup : public CommonRigidBodySetup
|
||||
{
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#ifndef SERIALIZE_SETUP_H
|
||||
#define SERIALIZE_SETUP_H
|
||||
#include "../../Demos/CommonRigidBodySetup.h"
|
||||
#include "Bullet3AppSupport/CommonRigidBodySetup.h"
|
||||
|
||||
class SerializeSetup : public CommonRigidBodySetup
|
||||
{
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
|
||||
#include "../../btgui/OpenGLWindow/SimpleOpenGL3App.h"
|
||||
#include "OpenGLWindow/SimpleOpenGL3App.h"
|
||||
#include "Bullet3Common/b3Vector3.h"
|
||||
#include "assert.h"
|
||||
#include <stdio.h>
|
||||
#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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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" }
|
||||
|
||||
@@ -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<struct Gwen::Event::Handler*> 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;i<m_data->m_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;i<numItems;i++)
|
||||
combobox->AddItem(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;
|
||||
}
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
)
|
||||
|
||||
|
||||
@@ -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 <string.h>
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <string.h>
|
||||
#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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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"
|
||||
|
||||
@@ -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",
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define IMPORT_OBJ_SETUP_H
|
||||
|
||||
|
||||
#include "../../Demos/CommonRigidBodySetup.h"
|
||||
#include "Bullet3AppSupport/CommonRigidBodySetup.h"
|
||||
|
||||
class ImportObjDemo : public CommonRigidBodySetup
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define IMPORT_STL_SETUP_H
|
||||
|
||||
|
||||
#include "../../Demos/CommonRigidBodySetup.h"
|
||||
#include "Bullet3AppSupport/CommonRigidBodySetup.h"
|
||||
|
||||
class ImportSTLDemo : public CommonRigidBodySetup
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define IMPORT_URDF_SETUP_H
|
||||
|
||||
|
||||
#include "../../Demos/CommonMultiBodySetup.h"
|
||||
#include "Bullet3AppSupport/CommonMultiBodySetup.h"
|
||||
|
||||
class ImportUrdfDemo : public CommonMultiBodySetup
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define BASIC_DEMO_H
|
||||
|
||||
#include "LinearMath/btVector3.h"
|
||||
#include "Bullet2RigidBodyDemo.h"
|
||||
#include "Bullet3AppSupport/Bullet2RigidBodyDemo.h"
|
||||
|
||||
#include "../../../Demos/BasicDemo/BasicDemoPhysicsSetup.h"
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define CHAIN_DEMO_H
|
||||
|
||||
#include "LinearMath/btVector3.h"
|
||||
#include "../BasicDemo/Bullet2RigidBodyDemo.h"
|
||||
#include "Bullet3AppSupport/Bullet2RigidBodyDemo.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
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
#include "LinearMath/btVector3.h"
|
||||
|
||||
#include "../../AllBullet2Demos/BulletDemoInterface.h"
|
||||
#include "Bullet3AppSupport/BulletDemoInterface.h"
|
||||
|
||||
#include "LinearMath/btAlignedObjectArray.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
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
#define RAGDOLL_DEMO_H
|
||||
|
||||
|
||||
#include "../../../Demos/CommonRigidBodySetup.h"
|
||||
#include "Bullet3AppSupport/CommonRigidBodySetup.h"
|
||||
#include "../BasicDemo/BasicDemo.h"
|
||||
|
||||
struct BulletDemoInterface;
|
||||
|
||||
@@ -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
|
||||
30
btgui/Bullet3AppSupport/CMakeLists.txt
Normal file
30
btgui/Bullet3AppSupport/CMakeLists.txt
Normal file
@@ -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})
|
||||
@@ -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;
|
||||
*/
|
||||
};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "GwenParameterInterface.h"
|
||||
#include "../GpuDemos/gwenInternalData.h"
|
||||
#include "gwenInternalData.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
|
||||
{
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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"
|
||||
|
||||
|
||||
@@ -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" );
|
||||
|
||||
26
btgui/Bullet3AppSupport/premake4.lua
Normal file
26
btgui/Bullet3AppSupport/premake4.lua
Normal file
@@ -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
|
||||
@@ -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)
|
||||
|
||||
@@ -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",
|
||||
}
|
||||
|
||||
@@ -130,6 +130,7 @@ if findOpenGL3() then
|
||||
-- include "../btgui/MultiThreading"
|
||||
|
||||
include "../btgui/OpenGLWindow"
|
||||
include "../btgui/Bullet3AppSupport"
|
||||
|
||||
-- include "../Demos3/ImplicitCloth"
|
||||
include "../Demos3/SimpleOpenGL3"
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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",
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user