-
-
Notifications
You must be signed in to change notification settings - Fork 10.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
IMGUI_DISABLE_OBSOLETE_FUNCTIONS affects layout of ImGuiIO #1695
Comments
Just got bitten by this. Thanks for the heads-up! |
@zx64 @franciscod May I ask you both how/where did you try to put those define? I'm just trying to understand why/how you got it wrong so I can find way to reduce the likehood it happens to other people. Perhaps need to add a mechanism that requires passing sizeof(ImGuiIO) etc. to the cpp file so the value from different compilation unit can be compared. |
I had this line:
#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS
on my imgui_user_config.h, but wasn't consistently passing the
-DIM_USER_CONFIG="path/imgui_user_config.h"
to all build steps (and I'm not including that header anywhere by hand). So
ImGui had it defined but my code didn't, or viceversa. I refactored my
Makefile a bit and added $(PWD) to the path to make it absolute to be sure
it's pointing to the right place.
|
I have added a macrio All the examples are now calling IMGUI_CHECKVERSION() in their main.cpp code, which hopefully means that new users will adopt it naturally in their own codebase. Also added a comment about it in Closing this. |
Nice idea! Thanks! |
This issue is more a heads up for anyone else that might run into this because of project build settings etc.
Example symptom: reading
io.MouseWheel
etc. in your code stays zero despite it scrolling windows, showing up as non-zero in the demo window etc.The cause is inconsistently defining
IMGUI_DISABLE_OBSOLETE_FUNCTIONS
throughout your project, which means some (but not all) member accesses after theRenderDrawListsFn
function pointer will be the incorrect offset.This can be verified by looking at the disassembly of an affected function:
Entirely my fault of course, hopefully nobody else runs into this! (Equally, hopefully there's enough keywords for someone to find this if it does happen to them)
The text was updated successfully, but these errors were encountered: