gui_init :: () { } gui_draw_screen :: () { using container; x = (GetScreenWidth() / 2.0) - (WIDTH / 2.0); y = GetScreenHeight() - HEIGHT; width = WIDTH; height = HEIGHT; left := rcut_from_left(*container, 0.333333); mid := rcut_from_left(*container, 0.5); right := rcut_from_left(*container, 1.0); SIZE :: 30.0; draw_indicator(left, .TRAD_TREE); draw_indicator(mid, .HYPER_TREE); draw_indicator(right, .CELLS); draw_text(left, "vTree", SIZE, .TRAD_TREE); draw_text(mid, "hTree", SIZE, .HYPER_TREE); draw_text(right, "Cells", SIZE, .CELLS); } gui_statistics :: (st: *Statistics) { FONT_SIZE :: 20; using st; total = nodes + children + empty; stats := tprint("Nodes: %1 | Children: %2 | Empty: %3 | Total: %4", nodes, children, empty, total ); info := to_c_string(stats); DrawText( info, SCREEN_WIDTH - MeasureText(info, FONT_SIZE) - 16, SCREEN_HEIGHT - 24, FONT_SIZE, { 160, 160, 200, 220 } ); } #scope_file container: Rectangle; WIDTH :: 420.0; HEIGHT :: 60.0; draw_text :: (rect: Rectangle, text: string, size: float, m: Mode) { color := ifx mode == m then COLOR_BACKGROUND else WHITE; ctext := to_c_string(text); mt := MeasureTextEx(GetFontDefault(), ctext, size, 1.0); x := rect.x + (rect.width / 2.0) - (mt.x / 2.0) - 3.0; y := rect.y + (rect.height / 2.0) - (mt.y / 2.0); DrawText(ctext, xx x, xx y, xx size, color); } draw_indicator :: (rect: Rectangle, m: Mode) { if mode == m then DrawRectangleRec(rect, WHITE); else DrawRectangleLinesEx(rect, 1.0, WHITE); }