| 544 | } |
| 545 | |
| 546 | void 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 | |
| 569 | void Gui::onWindowResizeEvent(int width, int height) { |
| 570 | mScreen->resize_callback_event(width, height); |
nothing calls this directly
no outgoing calls
no test coverage detected