refactor: replace game imgui ifdefs with a noop layer - #471
Merged
Conversation
Mirror the engine's GLFWManager/NoopManager pattern on the game side: noopimguilayer.hpp defines an inert game::layer::imgui::ImGuiLayer for builds without ENABLE_IMGUI, selected by a single ifdef on the include in maze.hpp. The member, accessor, pushOverlay and the debug UI toggles in MazeLayer and ExitLayer become unconditional. ENABLE_IMGUI sites drop from 10 to 2. imgui is still never linked into release: the imgui::imgui link and the layer/imgui/*.cpp glob stay behind ENABLE_IMGUI, and the noop header includes only layer/layer.hpp.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Mirrors the engine's
GLFWManager/NoopManagerpattern on the game side.game/src/layer/imgui/noopimguilayer.hppdefines an inertgame::layer::imgui::ImGuiLayerfor builds withoutENABLE_IMGUI, selected by a single#ifdefon the include inmaze.hpp. The member, accessor,pushOverlayand the debug UI toggles inMazeLayerandExitLayerbecome unconditional.ENABLE_IMGUIsites: 10 -> 2 (maze.hpp,application.hpp).imgui is still never linked into release — the
imgui::imguilink and thelayer/imgui/*.cppglob stay behindENABLE_IMGUI, and the noop header includes onlylayer/layer.hpp. Verified withstrings maze.exe | grep -c imgui: release 0, debug 53.Verified:
ci-windows-releaseandci-windows-debugboth build;pre-commit run --all-filespasses.