Example Browser: add option (keypress 'p') to dump json timing profile trace, that you can open using Chrome about://tracing

Make btQuickprof thread safe
Add option in btQuickprof to override custom timing profile (btSetCustomEnterProfileZoneFunc, btSetCustomLeaveProfileZoneFunc)
remove b3Printf in a user/physics thread (those added added, while drawing the GUI running in the main thread)
This commit is contained in:
Erwin Coumans
2016-12-23 15:20:04 -08:00
parent da7ae53941
commit 4c06fd27b3
12 changed files with 515 additions and 225 deletions

View File

@@ -44,7 +44,7 @@ public:
CProfileIterator* profIter;
class MyMenuItems* m_menuItems;
MyProfileWindow ( Gwen::Controls::Base* pParent)
: Gwen::Controls::WindowControl( pParent ),
@@ -192,7 +192,8 @@ public:
// Gwen::Controls::TreeNode* curParent = m_node;
double accumulated_time = dumpRecursive(profileIterator,m_node);
const char* name = profileIterator->Get_Current_Parent_Name();
@@ -278,7 +279,7 @@ MyProfileWindow* setupProfileWindow(GwenInternalData* data)
//profWindow->SetHidden(true);
profWindow->m_menuItems = menuItems;
//profWindow->profIter = CProfileManager::Get_Iterator();
profWindow->profIter = CProfileManager::Get_Iterator();
data->m_viewMenu->GetMenu()->AddItem( L"Profiler", menuItems,(Gwen::Event::Handler::Function)&MyMenuItems::MenuItemSelect);
menuItems->m_profWindow = profWindow;
@@ -296,6 +297,11 @@ void processProfileData( MyProfileWindow* profWindow, bool idle)
}
}
bool isProfileWindowVisible(MyProfileWindow* window)
{
return !window->Hidden();
}
void profileWindowSetVisible(MyProfileWindow* window, bool visible)
{
window->SetHidden(!visible);