MCPcopy Create free account
hub / github.com/Redot-Engine/redot-engine / bind

Method bind

core/debugger/engine_profiler.cpp:61–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

59}
60
61Error 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
79Error EngineProfiler::unbind() {
80 ERR_FAIL_COND_V(!is_bound(), ERR_UNCONFIGURED);

Callers 1

RemoteDebuggerMethod · 0.45

Calls 3

toggleMethod · 0.45
addMethod · 0.45
tickMethod · 0.45

Tested by

no test coverage detected