Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add #define config for "imgui_user.h" path #7039

Closed

Conversation

bryceberger
Copy link
Contributor

My project has a nested include structure, where #include "imgui_user.h" isn't available (think #include "some/path/to/imgui_user.h" instead).

It's obviously possible to get around this by setting -Isome/path/to, but that has to be set both when compiling imgui code and user code, and somewhat defeats the point of the nested include structure.

Open to bikeshedding on the name of the #define. The closest parallel to base the name off of was IMGUI_USER_CONFIG, but I had to keep the default behavior of #define IMGUI_INCLUDE_USER_H -> #include "imgui_user.h"

@ocornut
Copy link
Owner

ocornut commented Nov 21, 2023

I'm tempted to consider imgui_user.h as an old facility that I am not sure we want to expand on.
The aim was to add your own extra includes which would be included automatically, but surely you could create a dedicated header file and it would be a single extra-line per source file?

@bryceberger
Copy link
Contributor Author

Extra includes make sense when adding functionality, yeah. However, the stuff I have in imgui_user.h is just simple extensions to make some functionality work nicely in my code -- it doesn't really make sense to include an extra header just to use ImGui::TextUnformatted() with my chosen string type.

ocornut pushed a commit that referenced this pull request Dec 1, 2023
@ocornut
Copy link
Owner

ocornut commented Dec 1, 2023

Tweaked and merged as 5288687, thank you!
I used IMGUI_USER_H_FILENAME to match the symbols used to use different stb files + added comments in the imconfig.h template.

@ocornut ocornut closed this Dec 1, 2023
@bryceberger bryceberger deleted the imgui_user_h_path_define branch December 7, 2023 16:17
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.

2 participants