| 59 | } |
| 60 | |
| 61 | Error EngineProfiler::bind(const String &p_name) { |
| 62 | ERR_FAIL_COND_V(is_bound(), ERR_ALREADY_IN_USE); |
| 63 | EngineDebugger::Profiler prof( |
| 64 | this, |
| 65 | [](void *p_user, bool p_enable, const Array &p_opts) { |
| 66 | static_cast<EngineProfiler *>(p_user)->toggle(p_enable, p_opts); |
| 67 | }, |
| 68 | [](void *p_user, const Array &p_data) { |
| 69 | static_cast<EngineProfiler *>(p_user)->add(p_data); |
| 70 | }, |
| 71 | [](void *p_user, double p_frame_time, double p_process_time, double p_physics_time, double p_physics_frame_time) { |
| 72 | static_cast<EngineProfiler *>(p_user)->tick(p_frame_time, p_process_time, p_physics_time, p_physics_frame_time); |
| 73 | }); |
| 74 | registration = p_name; |
| 75 | EngineDebugger::register_profiler(p_name, prof); |
| 76 | return OK; |
| 77 | } |
| 78 | |
| 79 | Error EngineProfiler::unbind() { |
| 80 | ERR_FAIL_COND_V(!is_bound(), ERR_UNCONFIGURED); |
no test coverage detected