eliminate mid-frame calls into full update step via os_window_first_paint; pull up outside regular frontend frame boundaries; fixes incorrect per-frame dbgi scope usage

This commit is contained in:
Ryan Fleury
2024-08-06 07:07:44 -07:00
parent 3e6b8a3c66
commit ebaf83172f
2 changed files with 26 additions and 16 deletions
+6 -12
View File
@@ -8358,18 +8358,12 @@ df_window_update_and_render(Arena *arena, DF_Window *ws, DF_CmdList *cmds)
scratch_end(scratch);
}
//////////////////////////////
//- rjf: show window after first frame
//
{
if(ws->frames_alive == 0)
{
os_window_first_paint(ws->os);
}
ws->frames_alive += 1;
}
//////////////////////////////
//- rjf: increment per-window frame counter
//
ws->frames_alive += 1;
ProfEnd();
}
+20 -4
View File
@@ -279,8 +279,10 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
//////////////////////////////
//- rjf: begin frame
//
df_core_begin_frame(scratch.arena, &cmds, dt);
df_gfx_begin_frame(scratch.arena, &cmds);
{
df_core_begin_frame(scratch.arena, &cmds, dt);
df_gfx_begin_frame(scratch.arena, &cmds);
}
//////////////////////////////
//- rjf: queue drop for drag/drop
@@ -348,8 +350,10 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
//////////////////////////////
//- rjf: end frontend frame, send signals, etc.
//
df_gfx_end_frame();
df_core_end_frame();
{
df_gfx_end_frame();
df_core_end_frame();
}
//////////////////////////////
//- rjf: submit rendering to all windows
@@ -365,6 +369,18 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
r_end_frame();
}
//////////////////////////////
//- rjf: show windows after first frame
//
for(DF_Window *w = df_gfx_state->first_window; w != 0; w = w->next)
{
if(w->frames_alive == 1)
{
os_window_first_paint(w->os);
}
}
//////////////////////////////
//- rjf: determine frame time, record into history
//