struct bind_state { b32 is_held; /* Is this bind held down this frame */ u32 num_presses; /* How many times was this bind's pressed since last frame */ u32 num_repeats; /* How many times was this bind's key repeated since last frame */ u32 num_presses_and_repeats; /* Same as `num_presses` but includes key repeats as well */ u32 num_releases; /* How many times was this bind released since last frame */ }; struct second_stat { u64 last_second_start; u64 last_second_end; u64 last_second; }; struct console_log { struct string msg; i32 level; i32 color_index; struct sys_datetime datetime; i64 time_ns; struct rect bounds; struct console_log *prev; struct console_log *next; }; GLOBAL struct { struct atomic32 shutdown; struct snc_counter shutdown_job_counters; struct sys_window *window; struct gp_swapchain *swapchain; struct sim_ctx *local_sim_ctx; struct arena *arena; struct string connect_address_str; struct sim_client_store *user_client_store; struct sim_client *user_unblended_client; /* Contains snapshots received from local sim */ struct sim_client *user_blended_client; /* Contains single snapshot from result of blending local sim snapshots */ struct sim_snapshot *ss_blended; /* Points to blended snapshot contained in blended client */ /* Usage stats */ i64 last_second_reset_ns; struct second_stat net_bytes_read; struct second_stat net_bytes_sent; /* Gpu resources */ struct gp_render_sig *render_sig; struct bind_state bind_states[USER_BIND_KIND_COUNT]; /* Debug camera */ struct sim_ent_id debug_following; b32 debug_camera; b32 debug_camera_panning; struct v2 debug_camera_pan_start; b32 debug_draw; /* Debug console */ struct snc_mutex console_logs_mutex; struct arena *console_logs_arena; struct console_log *first_console_log; struct console_log *last_console_log; i32 console_log_color_indices[LOG_LEVEL_COUNT]; f32 console_logs_height; b32 debug_console; /* Window -> user */ struct snc_mutex sys_window_events_mutex; struct arena *sys_window_events_arena; /* User -> local sim */ struct snc_mutex user_sim_cmd_mutex; struct sim_control user_sim_cmd_control; struct sim_ent_id user_hovered_ent; u64 last_user_sim_cmd_gen; u64 user_sim_cmd_gen; struct atomic32 user_paused; struct atomic32 user_paused_steps; /* Local sim -> user */ struct snc_mutex local_to_user_client_mutex; struct sim_client_store *local_to_user_client_store; struct sim_client *local_to_user_client; i64 local_to_user_client_publish_dt_ns; i64 local_to_user_client_publish_time_ns; /* Rolling window of local sim -> user publish time deltas */ i64 last_local_to_user_snapshot_published_at_ns; i64 average_local_to_user_snapshot_publish_dt_ns; i64 local_sim_predicted_time_ns; /* Calculated from +