mirror of
https://github.com/ocornut/imgui.git
synced 2026-11-27 00:53:33 +00:00
IMGUI_DISABLE_OBSOLETE_FUNCTIONS affects layout of ImGuiIO #1695
Labels
No labels
accidentally closed
android
backends
bug
building
clipper
coloredit
color spaces
cplusplus
data types
demo
disabled
doc
docking
dpi
drag drop
drawing/drawlist
dropped
dx12
enhancement
focus
font/text
gallery
help wanted
idle/power saving
ime
in progress
inputs
inputtext
internals
label/id and id stack
language bindings
layout
linux/bsd
menus
multi-contexts
multi-threading
multi-viewports
nav
news/info
opengl
optimization
osx/ios
overlap
plot/graph
popups
question
scrolling
selection
settings
sliders/drags
style
tables/columns
tabs
test wanted
tools
tooltips
tree
tricks & tips
useful widgets
vulkan
web
window pos/depth
window sizing
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
ocornut/imgui#1695
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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.MouseWheeletc. 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_FUNCTIONSthroughout your project, which means some (but not all) member accesses after theRenderDrawListsFnfunction 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)
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?
The documentation states in multiple place that they need to be in imconfig.h for that reason. I now have added some extra commentary last month as you can see in the commit above.
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
IMGUI_CHECKVERSION()which checks the size of data structures which are mostly likely to be affected by mismatching compilation settings or mismatching configuration option.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
imconfig.hso hopefully more people will see it.Closing this.
Nice idea! Thanks!