refactor debugging windows

This commit is contained in:
Matthew Berry 2021-07-21 20:19:36 -07:00
parent bf1154945b
commit c9c5155333

View file

@ -22,13 +22,21 @@ class GBAController < Controller
# Debug
def render_debug_items : Nil
ImGui.menu_item("Debug", "", pointerof(@debug_window))
ImGui.menu_item("Video", "", pointerof(@debug_window))
end
def render_windows : Nil
if @debug_window
ImGui.begin("Debug", pointerof(@debug_window))
ImGui.text("Palettes")
ImGui.begin("Video", pointerof(@debug_window))
if ImGui.begin_tab_bar "VideoTabBar"
render_palettes_tab_item if ImGui.begin_tab_item "Palettes"
ImGui.end_tab_bar
end
ImGui.end
end
end
private def render_palettes_tab_item : Nil
ImGui.push_style_var(ImGui::ImGuiStyleVar::ItemSpacing, ImGui::ImVec2.new(0, 0))
pram = @emu.ppu.pram.to_unsafe.as(UInt16*)
flags = ImGui::ImGuiColorEditFlags::NoAlpha | ImGui::ImGuiColorEditFlags::NoPicker |
@ -49,7 +57,6 @@ class GBAController < Controller
ImGui.same_line(spacing: 4_f32) if idx == 0
end
ImGui.pop_style_var
ImGui.end
end
ImGui.end_tab_item
end
end