Repository navigation
cvcGL: add the missing ImGuiOverlay::attachCamera stub, unbreaking cvcgl-examples - #312
Merged
Merged
Conversation
…cgl-examples
ImGuiOverlay's whole point is that "without CVC_ENABLE_IMGUI the whole class
compiles to inert stubs, so consumers never need an #ifdef" (its own file header).
Of the 15 methods the header declares, 14 had a stub. attachCamera did not.
The three nav demos take the class at its word and call it unguarded, so
nav_city_swarm, nav_fog_ghost and nav_finale all failed to link with
undefined reference to
cvc::gl::ImGuiOverlay::attachCamera(cvc::gl::CameraController&)
in the one configuration anybody builds without imgui: the cvcgl-examples publish
lane, where nothing installs imgui and src/cvcGL/CMakeLists.txt silently settles
on CVC_ENABLE_IMGUI OFF. lsystem_forest, lsystem_coast and bunny_shadow link
there because they wrap their overlay blocks in #ifdef — which is the noise this
class exists to remove.
Not a regression: the publish step that builds these demos landed in #213 about
three hours AFTER the last publish run, so the v3.3.0 tag was the first time it
ever executed, and it failed on first contact. The unguarded calls arrived
separately, in cb5dee0 and #215, and CI had never built them imgui-less.
Fixing the stub rather than the three call sites keeps the contract the header
advertises, so the next consumer — volrover3, pycvc_gl, a new demo — cannot trip
the same wire. With no imgui there is no input to hand off, so the camera never
needs telling about it and an empty body is the right behaviour.
Verified by compiling the TU exactly as that lane does (no CVC_ENABLE_IMGUI):
the symbol goes from 0 definitions on master to 1 here, matching the mangled
name in the link error. Audited the rest of the block at the same time — all 15
declared methods now have stubs.
Follow-up worth doing separately: the published demos currently ship with no UI
at all, since imgui is simply absent from the cvcgl-examples closure. imgui
1.92.9+cvc.1 is on the catalog for linux, but adding it needs care — cvcGL links
imgui by ABSOLUTE find_library path and exports that target, so letting the imgui
prefix reach the earlier cvcgl step would bake a builder path into the published
SDK (the trap the X11 comment in that CMakeLists documents).
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.
ImGuiOverlay's whole point is that "withoutCVC_ENABLE_IMGUIthe whole class compiles to inert stubs, so consumers never need an#ifdef" — its own file header. Of the 15 methods the header declares, 14 had a stub.attachCameradid not.The three nav demos take the class at its word and call it unguarded, so
nav_city_swarm,nav_fog_ghostandnav_finaleall failed to link:in the one configuration anybody builds without imgui: the cvcgl-examples publish lane, where nothing installs imgui and
src/cvcGL/CMakeLists.txtsilently settles onCVC_ENABLE_IMGUI OFF.lsystem_forest,lsystem_coastandbunny_shadowlink there only because they wrap their overlay blocks in#ifdef— which is exactly the noise this class exists to remove.Not a regression — it has never worked
The publish step that builds these demos landed in #213 about three hours after the previous publish run, so the
v3.3.0tag was the first time it ever executed, and it failed on first contact. There's no green baseline to regress from. The unguarded calls arrived separately (cb5dee0, #215) and CI had never built them imgui-less. Nothing in the material work touchedImGuiOverlayor the demos' overlay setup.Why fix the stub, not the three call sites
Guarding the callers would work and is strictly worse: it re-introduces the per-consumer
#ifdefthe class was designed to eliminate, and leaves the contract broken for the next consumer (volrover3, pycvc_gl, a new demo). With no imgui there is no input to hand off, so the camera never needs telling about it — an empty body is the correct behaviour, not a placeholder.Verified
Compiled the TU exactly as that lane does (no
CVC_ENABLE_IMGUI):attachCameradefinitionsorigin/masterT cvc::gl::ImGuiOverlay::attachCamera(cvc::gl::CameraController&)matching the mangled name in the link error. The diff touches only the
#elsebranch, so the imgui-enabled path is unchanged. I also audited the rest of the block: all 15 declared methods now have stubs.Follow-up (deliberately not here)
The published demos currently ship with no UI at all, since imgui is simply absent from the cvcgl-examples closure.
imgui 1.92.9+cvc.1is on the catalog for linux, but adding it needs care: cvcGL links imgui by absolutefind_librarypath and exports that target, so letting the imgui prefix reach the earliercvcglstep would bake a builder path into the published SDK — the exact relocatability trap the X11 comment in thatCMakeLists.txtdocuments. Worth its own PR.