Skip to content

cvcGL: add the missing ImGuiOverlay::attachCamera stub, unbreaking cvcgl-examples - #312

Merged
transfix merged 1 commit into
masterfrom
fix/imgui-attachcamera-stub
Sep 2, 2026
Merged

transfix merged 1 commit into
masterfrom
fix/imgui-attachcamera-stub

Conversation

@transfix

@transfix transfix commented Sep 2, 2026

Copy link
Copy Markdown
Owner

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:

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 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.0 tag 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 touched ImGuiOverlay or 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 #ifdef the 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):

attachCamera definitions
origin/master 0
this branch 1 — T cvc::gl::ImGuiOverlay::attachCamera(cvc::gl::CameraController&)

matching the mangled name in the link error. The diff touches only the #else branch, 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.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 exact relocatability trap the X11 comment in that CMakeLists.txt documents. Worth its own PR.

…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).
@transfix
transfix merged commit c6f4b0a into master Sep 2, 2026
12 of 13 checks passed
@transfix
transfix deleted the fix/imgui-attachcamera-stub branch October 29, 2026 20:53
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.

1 participant