MCPcopy Create free account
hub / github.com/DanielChappuis/reactphysics3d / createProfilingPanel

Method createProfilingPanel

testbed/src/Gui.cpp:546–567  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

544}
545
546void Gui::createProfilingPanel() {
547
548 Widget* profilingPanel = new Window(mScreen, "Profiling");
549 profilingPanel->set_position(Vector2i(15, 505));
550 profilingPanel->set_layout(new BoxLayout(Orientation::Vertical, Alignment::Fill, 10, 5));
551 //profilingPanel->setId("SettingsPanel");
552 profilingPanel->set_fixed_width(220);
553
554 // Framerate (FPS)
555 mFPSLabel = new Label(profilingPanel, std::string("FPS : ") + floatToString(mCachedFPS, 0),"sans-bold");
556
557 // Update time
558 mFrameTimeLabel = new Label(profilingPanel, std::string("Frame time : ") + floatToString(mCachedUpdateTime * 1000.0, 1) + std::string(" ms"),"sans-bold");
559
560 // Total physics time
561 mTotalPhysicsTimeLabel = new Label(profilingPanel, std::string("Total physics time : ") + floatToString(mCachedTotalPhysicsUpdateTime * 1000.0, 1) + std::string(" ms"),"sans-bold");
562
563 // Physics step time
564 mPhysicsStepTimeLabel = new Label(profilingPanel, std::string("Physics step time : ") + floatToString(mCachedPhysicsStepTime * 1000.0, 1) + std::string(" ms"),"sans-bold");
565
566 profilingPanel->set_visible(true);
567}
568
569void Gui::onWindowResizeEvent(int width, int height) {
570 mScreen->resize_callback_event(width, height);

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected