@ -43,6 +43,37 @@ The gamepad/keyboard navigation branch (which has been in the work since July 20
Gamepad/keyboard navigation is still marked as Beta and has to be enabled explicitely.
Various internal refactors have also been done, as part of the navigation work and as part of the upcoing viewport/docking work.
VIEWPORT BRANCH
(IN PROGRESS, WILL MERGE INTO THE MAIN LISTS WHEN WE MERGE THE BRANCH)
- Viewport: Added support for multi-viewport [...] blah blah
- Viewport: Rendering: the ImDrawData structure now contains 'DisplayPos' and 'DisplaySize' fields. To support multi-viewport, you need to use those values when
creating your orthographic projection matrix. Use 'draw_data->DisplaySize' instead of 'io.DisplaySize', and 'draw_data->DisplayPos' instead of (0,0) as the upper-left point.
You also need to subtract 'draw_data->DisplayPos' from your scissor rectangles, as scissor rectangles are specified in the space of your target viewport.
- Examples: Back-ends have been refactored to separate the platform code (e.g. Win32, Glfw, SDL2) from the renderer code (e.g. DirectX11, OpenGL3, Vulkan).
- The idea is what we can now easily combine and maintain back-ends and reduce code redundancy. Integration of imgui into a new/custom engine may also
be easier as there is less overlap between "windowing / inputs" and "rendering" code, so you may study or grab one half of the code and not the other.
- This change was motivated by the fact that adding support for multi-viewport requires more work from the platform and renderer back-ends, and the
amount of redundancy accross files was becoming too difficult to maintain.
- Some frameworks (such as the Allegro, Marmalade) handle both the "platform" and "rendering" part, and your custom engine may as well.
- Each example still has its own main.cpp which you may refer you to understand how to initialize and glue everything together.
- Examples: Win32: Added DPI-related helpers to access DPI features _without_ requiring the latest Windows SDK at compile time, and _without_ requiring Windows 10 at runtime.
- Examples: Platforms currently supporting multi-viewport: Win32, Glfw, SDL2.
- Examples: All imgui_impl_xxx files now have an individual Changelog at the top of the file, making it easier to follow how back-ends are evolving.
- Examples: Vulkan: Added various optional helpers in imgui_impl_vulkan.h (they are used for multi-viewport support) to make the examples main.cpp easier to read.
- Examples: Allegro: Renamed imgui_impl_a5.xxx files to imgui_impl_allegro5.xxx, ImGui_ImplA5_** symbols to ImGui_ImplAllegro5_xxx.
- Examples: Vulkan+SDL: Added a Vulkan+SDL example. (#1367) [@gmueckl]
- Metrics: Added a "Show window begin order" checkbox to visualize the order windows are submitted.
- Internal: Settings: Added ReadCloseFn handler to be able to patch/alter a loaded object after all the fields are known.
Breaking Changes:
(IN PROGRESS, WILL ADD TO THIS LIST AS WE WORK ON 1.60)
// When dragging something, always refer to the last hovered viewport (so when we are between viewport, our dragged preview will tend to show in the last viewport)
// If mouse just appeared or disappeared (usually denoted by -FLT_MAX component, but in reality we test for -256000.0f) we cancel out movement in MouseDelta
// - We also support the moved window toggling the NoInputs flag after moving has started in order to be able to detect windows below it, which is useful for e.g. docking mechanisms.
// This is so we don't require of the multi-viewport windowing back-end to preserve mouse buttons after a window closure, making it easier to implement them.
ImGuiPlatformDataPlatformData;// This is essentially the public facing version of the Viewports vector (it is updated in UpdatePlatformWindows and exclude the viewports about to be destroyed)
ImGuiViewportP*CurrentViewport;
ImGuiViewportP*MouseViewport;
ImGuiViewportP*MouseLastViewport;
ImGuiViewportP*MouseLastHoveredViewport;
ImGuiViewportP*MousePosViewport;
ImGuiViewportP*MousePosPrevViewport;
ImGuiViewportP*MouseHoveredPrevViewport;
// Navigation data (for gamepad/keyboard)
ImGuiWindow*NavWindow;// Focused window for navigation. Could be called 'FocusWindow'