Skip to content

Conversation

@olivier-roussel
Copy link
Contributor

@olivier-roussel olivier-roussel commented Dec 22, 2025

This PR tries to tackle #152 with option 2 : encapsulate imgui code as much as possible and limit installed headers to unvendored ones.
Aim is to make SofaGLFW compatible with conda-forge requirements for making its package.

Concerning imgui, it is not exposed anymore in public headers. But extensions might need it, so they will have to fetch it as done in SofaImGui. A typical example is SofaImGui.Camera extension.

As SimpleIni is in public headers, it must be added as a dependency and can be find or fetched as others. A PR for SimpleIni has been submitted to make it also available on conda-forge ( conda-forge/staged-recipes#31757 ).
As we do not master the review time on conda-forge, I alternatively removed headers where SimpleIni is included have from the public interface. So far, the public interface was likely all the headers. Removed headers from public interface are:

  • ObjectColors.h (due to imgui)
  • windows/Performances.h (due to imgui)
  • windows/Settings.h (due to SimpleIni)
  • windows/ViewPort.h (due to SimpleIni)

Edit on 09/01/2026:

  • Added a fix for the SofaGFLWConfig.cmake file which was not propagating glfw dependency

@olivier-roussel
Copy link
Contributor Author

olivier-roussel commented Jan 9, 2026

I've checked if imgui symbol export:

# setup the same API exports for imgui
target_compile_definitions(${PROJECT_NAME} PUBLIC IMGUI_API=SOFAIMGUI_API)
target_compile_definitions(${PROJECT_NAME} PUBLIC IMGUI_USER_CONFIG=<SofaImGui/config.h>)

was still necessary on Windows, as we discussed in our last dev meeting, and it is. FYI @alxbilger
Honnestly I thought it would not, but without this I could not compile project using SofaImGui as 3rd party such as SofaImGui.Camera extension (but SofaImGui was compiling fine).

@olivier-roussel
Copy link
Contributor Author

@hugtalbot @bakpaul @alxbilger I think this is ready to merge (or for another review round).
Many thanks !

@hugtalbot hugtalbot merged commit 0a40f37 into sofa-framework:master Jan 15, 2026
8 checks passed
bakpaul pushed a commit that referenced this pull request Jan 16, 2026
* remove imgui.h from ImgGuiGUIEngine header

* change RigidMass to template explicit instanciation to hide impl which is using imgui.h

* remove imgui internal headers from distributed public headers

* hide impl of ScalarWidget

* remove useless headers

* fix missing headers simpleini.h

* use SimpleIni as a dependency

* add SimpleIni dep in SofaImGUi cmake config

* do not install implot and IconFontCppHeaders headers

* typo

* hide SimpleIni to impl and do not expose private headers ViewPort.h and Settings.h

* do not expose Performances.h header as it includes imgui

* fix SimpleIni target as private

* fix imgui headers are not part of SofaImGui anymore, must be treated as dependency

* fix SofaGLFW cmake config in with missing gflw

---------

Co-authored-by: Hugo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants