Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 6, 2025

The ImGui integration in Rocky's codebase had unguarded references that caused compilation errors when ImGui support was disabled. Several header files included <imgui.h> and used ImGui types without proper conditional compilation guards.

Problem

When building the SDK with ROCKY_SUPPORTS_IMGUI=OFF, compilation would fail due to:

  • Unguarded #include <imgui.h> statements in header files
  • ImGui types and function calls not wrapped in conditional compilation blocks
  • Missing guards in source files that are always compiled (not conditionally compiled by CMake)

Solution

Added #ifdef ROCKY_HAS_IMGUI guards around all ImGui-dependent code:

Header files - Wrapped entire file contents in guards:

  • src/rocky/vsg/imgui/ImGuiIntegration.h
  • src/rocky/vsg/imgui/RenderImGui.h
  • src/rocky/vsg/imgui/SendEventsToImGui.h

Source files - Added guards around ImGui includes and functions:

  • src/rocky/vsg/ecs/WidgetSystem.cpp - wrapped ImGui include and initialize() function
  • src/rocky/vsg/imgui/SendEventsToImGui.cpp - wrapped entire file content for consistency

Files Already Protected

The following files already had proper guards and required no changes:

  • src/rocky/rocky_imgui.h
  • src/rocky/vsg/imgui/ImGuiImage.h
  • src/rocky/vsg/DisplayManager.cpp

Result

The SDK now builds correctly whether ImGui support is enabled or disabled. Demo applications continue to work properly through the existing guards in rocky_imgui.h.

Fixes #141.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Make sure the SDK builds correctly whether ImGui support is enabled or not Add ROCKY_HAS_IMGUI guards to prevent compilation errors when ImGui is disabled Sep 6, 2025
Copilot AI requested a review from gwaldron September 6, 2025 18:44
Copilot finished work on behalf of gwaldron September 6, 2025 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Make sure the SDK builds correctly whether ImGui support is enabled or not

2 participants