3.7 KiB
3.7 KiB
ImGui Integration & Memory Debugger
Task List
-
Preparation
- Fetch Dear ImGui Source Files (Verified existing submodule)
- Create
External/imgui/Imgui.bff - Update
fbuild.bffto includeImgui.bff - Update
Juliet.bffto linkImGuiand include paths - Update
D3D12DescriptorHeapto support ImGui (SRV for Font)
-
Memory Arena Debugging
- Modify
MemoryArenastruct to store allocation tags (Debug builds only) - Update
ArenaPushsignature to acceptconst char* tag - Update call sites (default parameter should minimize churn)
- Modify
-
ImGui Core & TDD
- Create
Core/ImGui/ImGuiService.h/cpp(Wrapper) - Create
Core/ImGui/ImGuiTests.cpp - Implement
ImGui::SetAllocatorFunctionsusingEngineArena - Test context creation and IO setup
- Create
-
Integration
- Win32: Integrate
WndProcinWin32DisplayEvent.cpp - DX12: Initialize/Shutdown in
D3D12GraphicsDevice(Implemented inImGuiRenderer.cpp) - DX12: Render Frame in
D3D12GraphicsDevice(Fixed Buffer Crash)
- Win32: Integrate
-
Memory Debugger
- Create
Engine/Debug/MemoryDebugger.h/cpp - Implement
DrawMemoryArena(const char* name, MemoryArena* arena)with Allocation Tags - Implement Hex View for Arena Data (Allocations list implemented, Hex view pending/skipped)
- Integrate into Main Loop (Toggle with 'Home' key)
- Create
-
Verification
- Launch and verify ImGui renders
- Verify Memory Debugger shows allocations and tags
Implementation Plan
Goal Description
Integrate Dear ImGui into the Juliet engine.
Implement a specialized Test Driven Development (TDD) approach.
Create a Memory Debugger panel to visualize MemoryArena state with allocation tags.
Proposed Changes
Build System
[NEW] Imgui.bff
- Defines the
ImGuilibrary configuration. - Includes
imgui.cpp,imgui_draw.cpp,imgui_tables.cpp,imgui_widgets.cpp,imgui_demo.cpp. - Includes backends:
imgui_impl_win32.cpp,imgui_impl_dx12.cpp.
[MODIFY] fbuild.bff
- Include
External/imgui/Imgui.bff.
[MODIFY] Juliet.bff
- Add
ImGuitoJulietlibrary dependencies. - Add
External/imguiandExternal/imgui/backendsto include paths.
Core/Memory
[MODIFY] MemoryArena.h [MODIFY] MemoryArena.cpp
- Struct Change: Add
AllocationTrackingvector (likelystd::vectorwrapped or fixed size array) inJULIET_DEBUG. - Function Change:
ArenaPush(..., const char* tag = nullptr). - Logic: Store offset + tag on push.
Core/ImGui
[NEW] ImGuiService.h [NEW] ImGuiService.cpp
- Wrapper for ImGui lifecycle.
- Uses
EngineArenafor internal ImGui allocations.
[NEW] ImGuiTests.cpp
- TDD suite for ImGui service.
Graphics/D3D12
[MODIFY] D3D12GraphicsDevice.cpp
- ImGui backend initialization and rendering.
Engine/Debug
[NEW] MemoryDebugger.h [NEW] MemoryDebugger.cpp
- Draw arena usage bar using tracked tags.
- Draw hex dump.