Skip to content

Commit

Permalink
gui_window: Reuse framebuffer device to hold window state
Browse files Browse the repository at this point in the history
  • Loading branch information
LekKit committed Dec 22, 2024
1 parent 74d5162 commit 441f715
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions src/devices/gui_window.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,14 +258,14 @@ bool gui_window_init_auto(rvvm_machine_t* machine, uint32_t width, uint32_t heig
return false;
}

// Placeholder for window data, region size is 0
rvvm_mmio_dev_t win_placeholder = {
.data = win,
.type = &gui_window_dev_type,
};
rvvm_attach_mmio(machine, &win_placeholder);

framebuffer_init_auto(machine, &win->fb);
rvvm_mmio_dev_t* fb = framebuffer_init_auto(machine, &win->fb);
if (!fb) {
gui_window_free(win);
return false;
}

fb->data = win;
fb->type = &gui_window_dev_type;

return true;
}
Expand Down

0 comments on commit 441f715

Please sign in to comment.