txti layer -> open files in write-shared mode, to prevent locking file from e.g. an editor which is writing; also only enable change detection when ui is actively updating

This commit is contained in:
Ryan Fleury
2024-01-18 10:04:00 -08:00
parent d2d72bd7ab
commit 3567e6c53d
8 changed files with 54 additions and 27 deletions
+9
View File
@@ -55,6 +55,12 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
//- rjf: target Hz -> delta time
F32 dt = 1.f/target_hz;
//- rjf: last frame before sleep -> disable txti change detection
if(df_gfx_state->num_frames_requested == 0)
{
txti_set_external_change_detection_enabled(0);
}
//- rjf: get events from the OS
OS_EventList events = {0};
if(os_handle_match(repaint_window_handle, os_handle_zero()))
@@ -62,6 +68,9 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
events = os_get_events(scratch.arena, df_gfx_state->num_frames_requested == 0);
}
//- rjf: enable txti change detection
txti_set_external_change_detection_enabled(1);
//- rjf: begin measuring actual per-frame work
U64 begin_time_us = os_now_microseconds();