Added/updated components to be isolated rectangles.

This commit is contained in:
2026-06-17 07:48:07 +02:00
parent cccc4fb06c
commit 6605d86916
6 changed files with 489 additions and 49 deletions
+34
View File
@@ -0,0 +1,34 @@
package simulator
import rl "vendor:raylib"
gui_bottom_tabs :: proc(rect: rl.Rectangle, sim: ^Simulator) {
rl.DrawRectangleLinesEx(rect, 1, rl.GRAY)
// Setup tab bar
tabs := [?]cstring{ "Memory", "Disassembly", "Log" }
tab_bar_rect := rl.Rectangle{
rect.x,
rect.y,
rect.width,
BUTTON_HEIGHT + PADDING_Y
}
// inside draw loop:
rl.GuiTabBar(tab_bar_rect, &tabs[0], i32(len(tabs)), &sim.active_tab)
bounds := rl.Rectangle {
x = rect.x + PADDING_X,
y = rect.y + PADDING_Y + tab_bar_rect.height,
width = rect.width - (PADDING_X * 2),
height = rect.height - (PADDING_Y * 2) - tab_bar_rect.height,
}
switch sim.active_tab {
case 0: // draw registers panel
gui_tab_memory(bounds, sim)
case 1: // draw memory panel
case 2: // draw display panel
}
}