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

ImGuiKey_ deprecated? #183

Closed
passivedragon opened this issue Oct 27, 2022 · 5 comments
Closed

ImGuiKey_ deprecated? #183

passivedragon opened this issue Oct 27, 2022 · 5 comments

Comments

@passivedragon
Copy link

I'm only just getting into IMGui and wanted to check out this project.
I've gotten a small project together with just IMGui that works fine, but adding imgui-node-editor into the mix completely fails with a series of similar-ish errors, one of which is ‘ImGuiKey_’ was not declared in this scope.

After a quick look through the source, it seems that ImGuiKey_ may have been an enum type alias for int type ImGuiKey, which now is just enum ImGuiKey : int;. These errors get thrown each time DECLARE_KEY_TESTER is expanded.

@thedmd
Copy link
Owner

thedmd commented Nov 2, 2022

Please tell me what version of ImGui you're using?

@passivedragon
Copy link
Author

passivedragon commented Nov 3, 2022

I pulled the latest from master directly at the time, which ended up being ocornut/imgui@a241dc7
I do recall looking over the source when I had this issue, and I believe this change with ImGuiKey_ has been in there since... around 1.83 or so? (I'm probably wrong there)

Also seems like my latest comment didn't make it to github. I ended up fixing it on my end by taking a few small changes. I only realized after some time that this project isn't drop-in suitable in the way I was doing things. Would be nice if the references to imgui were easier to point to different places when linking/building, for those including imgui on the side, along imgui-node-editor

@thedmd
Copy link
Owner

thedmd commented Nov 3, 2022

Support for extra keys was my extension to ImGui, some time later it landed in library itself.
That make code using ImGuiKey_ is not longer needed. I will pinpoint ImGui version number and ifdef it out.
Node Editor work with old ImGui as well latest version. Latter need fixes sometimes, like in this case. Sorry I didn't catch that before you stumbled on the issue.

ImGui does have IMGUI_VERSION_NUM from some time. It is bumped when something non-trivial change.

this project isn't drop-in suitable in the way I was doing things

Idea of integrating it into your code base is that you include sources from root directory only and they should work.
What made it unsuitable for your use case?

Can you tell me if define IMGUI_DISABLE_OBSOLETE_KEYIO?

@thedmd
Copy link
Owner

thedmd commented Nov 3, 2022

Support for latest ImGui was pushed to develop branch.

@thedmd thedmd closed this as completed Nov 3, 2022
@passivedragon
Copy link
Author

this project isn't drop-in suitable in the way I was doing things

Idea of integrating it into your code base is that you include sources from root directory only and they should work. What made it unsuitable for your use case?

Can you tell me if define IMGUI_DISABLE_OBSOLETE_KEYIO?

That was misunderstanding on my part, when I first added this to my project I grabbed some of the example files, but didn't like the external/imgui part, so when I then stumbled over includes pointing at external/ it took me a bit to properly sort things out in my project structure.
I could see the includes just poniting at imgui/imgui.h and just supplying an -Iexternal/ when building for the examples, but that's not really a big issue, I just didn't check thoroughly enough at first.

Thanks a ton for the quick response and fix! I'll be using the develop branch then.

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

No branches or pull requests

2 participants