From f45fb04dff757e95916fb1ab8ef4399390c62481 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Wed, 17 Jan 2024 23:41:25 +0000 Subject: [PATCH] Remove testing code --- src/compositor.c | 28 ---------------------------- 1 file changed, 28 deletions(-) diff --git a/src/compositor.c b/src/compositor.c index 5dc258f..05c85f4 100644 --- a/src/compositor.c +++ b/src/compositor.c @@ -8,7 +8,6 @@ #include #include #include -#include #include #define MAX_WINDOWS 2 @@ -28,7 +27,6 @@ struct compositor { u64 last_clicked_mouse_y; i64 node_hovered; u64 count; - rect_t *rects; node_t *nodes; bool move_node; ui_ctx_t ctx; @@ -46,7 +44,6 @@ i32 run_main_loop(void) { init_ui_ctx(&(comp.ctx)); - comp.rects = (rect_t *)malloc(sizeof(rect_t) * MAX_NODES); comp.nodes = (node_t *)malloc(sizeof(node_t) * MAX_NODES); window_t *main_window = &(comp.windows[0]); @@ -69,13 +66,6 @@ i32 run_main_loop(void) { colour_t bg_colour = {.abgr = 0xffffffff}; - comp.rects[0] = (rect_t){ - .topleft.x = 150, - .topleft.y = 50, - .w = NODE_WIDTH, - .h = NODE_HEIGHT, - }; - while (comp.running) { while (SDL_PollEvent(&(comp.event))) { handle_ui_events(&(comp.windows[comp.active_window - 1]), &(comp.ctx), @@ -122,24 +112,6 @@ i32 run_main_loop(void) { clear_window(&(comp.windows[i]), bg_colour); } - if (button(main_window, &(comp.ctx), - (rect_t){.topleft.x = 10, - .topleft.y = 10, - .w = BUTTON_WIDTH, - .h = BUTTON_HEIGHT})) { - printf("Button 1 pressed\n"); - } - - if (button(main_window, &(comp.ctx), - (rect_t){.topleft.x = 50, - .topleft.y = 50, - .w = BUTTON_WIDTH, - .h = BUTTON_HEIGHT})) { - printf("Button 2 pressed\n"); - } - - comp.rects[0] = node(main_window, &(comp.ctx), comp.rects[0]); - for (u64 i = 0; i < MAX_WINDOWS; ++i) { swap_buffers(&(comp.windows[i])); }