fix incorrect os_window_first_paint rules

This commit is contained in:
Ryan Fleury
2024-08-20 17:07:59 -07:00
parent c77d61fb4c
commit 70fa90bb87
2 changed files with 13 additions and 3 deletions
+1
View File
@@ -984,6 +984,7 @@ df_window_open(Vec2F32 size, OS_Handle preferred_monitor, DF_CfgSrc cfg_src)
window = push_array(df_gfx_state->arena, DF_Window, 1);
}
window->gen += 1;
window->frames_alive = 0;
window->cfg_src = cfg_src;
window->arena = arena_alloc();
{
+12 -3
View File
@@ -372,11 +372,20 @@ update_and_render(OS_Handle repaint_window_handle, void *user_data)
//////////////////////////////
//- rjf: show windows after first frame
//
for(DF_Window *w = df_gfx_state->first_window; w != 0; w = w->next)
if(os_handle_match(repaint_window_handle, os_handle_zero()))
{
if(w->frames_alive == 1)
DF_HandleList windows_to_show = {0};
for(DF_Window *w = df_gfx_state->first_window; w != 0; w = w->next)
{
os_window_first_paint(w->os);
if(w->frames_alive == 1)
{
df_handle_list_push(scratch.arena, &windows_to_show, df_handle_from_window(w));
}
}
for(DF_HandleNode *n = windows_to_show.first; n != 0; n = n->next)
{
DF_Window *window = df_window_from_handle(n->handle);
os_window_first_paint(window->os);
}
}