Improve implementation of drawing the noodles

This commit is contained in:
2024-01-21 22:37:09 +00:00
parent f72497e1b7
commit 924ed544aa
3 changed files with 71 additions and 41 deletions

View File

@@ -76,6 +76,11 @@ i32 run_main_loop(void) {
i32 toolbox_button_x = (toolbox->width - BUTTON_WIDTH) / 2;
line ln = (line){
(point){20, 40},
(point){60, 200},
};
while (comp.running) {
while (SDL_PollEvent(&(comp.event))) {
handle_ui_events(&(comp.windows[comp.active_window - 1]), &(comp.ctx),
@@ -152,6 +157,8 @@ i32 run_main_loop(void) {
comp.nodes[i].colours);
}
ln = ui_noodle(main_window, &(comp.ctx), ln, op_node_colours);
for (u64 i = 0; i < MAX_WINDOWS; ++i) {
swap_buffers(&(comp.windows[i]));
}