Skip to content

feat(editor): Dear ImGui Embedded UI Implementation (RF6.1, RF6.2)#65

Merged
LyeZinho merged 1 commit intomainfrom
42-embedded-ui-dear-imgui
May 8, 2026
Merged

feat(editor): Dear ImGui Embedded UI Implementation (RF6.1, RF6.2)#65
LyeZinho merged 1 commit intomainfrom
42-embedded-ui-dear-imgui

Conversation

@LyeZinho
Copy link
Copy Markdown
Member

@LyeZinho LyeZinho commented May 8, 2026

Summary

  • Implemented Dear ImGui integration for Caffeine Studio IDE
  • Added ProfilerWindow with real-time frame time tracking and scope profiling
  • Added ConsoleWindow with log filtering and auto-scroll
  • Added StatsOverlay with FPS, frame metrics, and asset cache stats
  • All editor modules are header-only and compile without SDL3/ImGui
  • ImGui rendering guarded by CF_HAS_IMGUI, data structures always available

Changes

New Files

  • src/editor/EditorTypes.hpp — FrameStats struct for frame metrics
  • src/editor/ImGuiIntegration.hpp — ImGui integration with SDL3 + RHI
  • src/editor/ProfilerWindow.hpp — Frame profiler with 120-frame history
  • src/editor/ConsoleWindow.hpp — Log console with filtering
  • src/editor/StatsOverlay.hpp — Real-time stats overlay
  • tests/test_editor.cpp — 24 test cases for all editor components

Modified Files

  • CMakeLists.txt — Added ImGui via FetchContent (v1.91.9)
  • src/Caffeine.hpp — Included editor headers
  • tests/CMakeLists.txt — Added test_editor.cpp
  • docs/fase6/embedded-ui.md — Updated status to implemented

Implementation Details

ImGuiIntegration

  • Initializes ImGui context with SDL3 and SDL_GPU backends
  • Manages frame lifecycle (beginFrame/endFrame)
  • Handles input capture detection (wantsKeyboard/wantsMouse)
  • Processes SDL events and prevents input leakage to game

ProfilerWindow

  • Tracks 120 frames of timing data with circular buffer
  • Pause/resume functionality
  • Integrates with Debug::Profiler for scope statistics
  • Renders frame graph and scope table (when CF_HAS_IMGUI)

ConsoleWindow

  • Stores log entries with level, category, and message
  • Filter by log level (Trace/Info/Warn/Error/Fatal)
  • Auto-scroll support
  • Color-coded messages by severity

StatsOverlay

  • Displays FPS, frame time, frame count
  • Shows asset cache statistics (textures, audio, pending jobs)
  • Transparent overlay window

Testing

  • 24 test cases covering all data structures and API
  • Tests verify data management without requiring ImGui
  • All editor windows tested for open/close, pause/resume, filtering

Acceptance Criteria

  • ✅ Dear ImGui integrado com SDL3 sem conflitos de input
  • ✅ ProfilerWindow mostra dados do Profiler real-time
  • ✅ ConsoleWindow filtra por nível e categoria
  • ❌ Hot-reload: textura atualizada sem restart do jogo (future work)
  • ✅ ImGui não interfere com input do jogo quando não em foco

Notes

  • All code follows Caffeine style guidelines (header-only, closing namespace comments)
  • Builds successfully with and without SDL3/ImGui
  • No .cpp files created for editor module

@LyeZinho LyeZinho linked an issue May 8, 2026 that may be closed by this pull request
5 tasks
@LyeZinho LyeZinho self-assigned this May 8, 2026
@LyeZinho LyeZinho added documentation Improvements or additions to documentation enhancement New feature or request planned-implementation Implementations planned according with roadmap labels May 8, 2026
@LyeZinho LyeZinho added this to the phase 6 milestone May 8, 2026
@LyeZinho LyeZinho merged commit 6fb645c into main May 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request planned-implementation Implementations planned according with roadmap

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Embedded UI — Dear ImGui

1 participant