| 1417 | } |
| 1418 | |
| 1419 | void tick_frame_callback(float dt) { |
| 1420 | std::function<void(float)> cb; |
| 1421 | { |
| 1422 | std::lock_guard lock(g_frame_mutex); |
| 1423 | cb = g_frame_callback; |
| 1424 | } |
| 1425 | if (cb) { |
| 1426 | const GilAcquire gil; |
| 1427 | try { |
| 1428 | cb(dt); |
| 1429 | } catch (const std::exception& e) { |
| 1430 | LOG_ERROR("Frame callback error: {}", e.what()); |
| 1431 | } |
| 1432 | } |
| 1433 | } |
| 1434 | |
| 1435 | CapabilityResult invoke_capability(const std::string& name, const std::string& args_json) { |
| 1436 | ensure_initialized(); |