This commit is contained in:
Erwin Coumans
2017-02-17 10:48:03 -08:00
43 changed files with 4021 additions and 71 deletions

View File

@@ -266,6 +266,7 @@ void ExampleBrowserThreadFunc(void* userPtr,void* lsMemory)
{
B3_PROFILE("clock.usleep");
clock.usleep(gMinUpdateTimeMicroSecs/10.);
exampleBrowser->updateGraphics();
} else
{
B3_PROFILE("exampleBrowser->update");

View File

@@ -257,7 +257,6 @@ void MyKeyboardCallback(int key, int state)
} else
{
b3ChromeUtilsStopTimingsAndWriteJsonFile();
}
#endif //BT_NO_PROFILE
@@ -309,8 +308,11 @@ static void MyMouseMoveCallback( float x, float y)
bool handled = false;
if (sCurrentDemo)
handled = sCurrentDemo->mouseMoveCallback(x,y);
if (!handled && gui2)
handled = gui2->mouseMoveCallback(x,y);
if (renderGui)
{
if (!handled && gui2)
handled = gui2->mouseMoveCallback(x,y);
}
if (!handled)
{
if (prevMouseMoveCallback)
@@ -327,9 +329,11 @@ static void MyMouseButtonCallback(int button, int state, float x, float y)
if (sCurrentDemo)
handled = sCurrentDemo->mouseButtonCallback(button,state,x,y);
if (!handled && gui2)
handled = gui2->mouseButtonCallback(button,state,x,y);
if (renderGui)
{
if (!handled && gui2)
handled = gui2->mouseButtonCallback(button,state,x,y);
}
if (!handled)
{
if (prevMouseButtonCallback )
@@ -1125,6 +1129,18 @@ bool OpenGLExampleBrowser::requestedExit()
return s_window->requestedExit();
}
void OpenGLExampleBrowser::updateGraphics()
{
if (sCurrentDemo)
{
if (!pauseSimulation || singleStepSimulation)
{
B3_PROFILE("sCurrentDemo->updateGraphics");
sCurrentDemo->updateGraphics();
}
}
}
void OpenGLExampleBrowser::update(float deltaTime)
{
b3ChromeUtilsEnableProfiling();

View File

@@ -19,6 +19,8 @@ public:
virtual void update(float deltaTime);
virtual void updateGraphics();
virtual bool requestedExit();
virtual void setSharedMemoryInterface(class SharedMemoryInterface* sharedMem);