- Misc: Added IMGUI_CHECKVERSION() macro to compare version string and data structure sizes in order to catch issues with mismatching compilation unit settings. (#1695, #1769)
- Misc: Fix to allow compiling in unity builds where stb_rectpack/stb_truetype may be already included in the same compilation unit.
- Demo: Fixed Overlay: Added a context menu item to enable freely moving the window.
- Demo: Added demo for DragScalar(), InputScalar(), SliderScalar(). (#643)
- Examples: Calling IMGUI_CHECKVERSION() in the main.cpp of every example application.
- Examples: Allegro 5: Added support for 32-bit indices setup via defining ImDrawIdx, to avoid an unnecessary conversion (Allegro 5 doesn't support 16-bit indices).
- Examples: Allegro 5: Renamed bindings from imgui_impl_a5.cpp to imgui_impl_allegro5.cpp.
// The DragScalar, InputScalar, SliderScalar functions allow manipulating most common data types: signed/unsigned int/long long and float/double
// To avoid polluting the public API with all possible combinations, we use the ImGuiDataType enum to pass the type, and argument-by-values are turned into argument-by-address.
// This is the reason the test code below creates local variables to hold "zero" "one" etc. for each types.
// In practice, if you frequently use a given type that is not covered by the normal API entry points, you may want to wrap it yourself inside a 1 line function
// which can take typed values argument instead of void*, and then pass their address to the generic function. For example:
// bool SliderU64(const char *label, u64* value, u64 min = 0, u64 max = ~(u64)0, const char* format = "%d") { return SliderScalar(label, ImGuiDataType_U64, value, &min, &max, format); }
// Below are helper variables we can take the address of to work-around this:
// Note that the SliderScalar function has a maximum usable range of half the natural type maximum, hence the /2 below.
ImGui::Checkbox("Clamp integers to 0..50",&drag_clamp);ImGui::SameLine();ShowHelpMarker("As with every widgets in dear imgui, we never modify values unless there is a user interaction.\nYou can override the clamping limits by using CTRL+Click to input a value.");
ImGui::DragScalar("drag float ^2",ImGuiDataType_Float,&f32_v,0.005f,&f32_zero,&f32_one,"%f",2.0f);ImGui::SameLine();ShowHelpMarker("You can use the 'power' parameter to increase tweaking precision on one side of the range.");