mirror of
https://github.com/Drezil/imgui.git
synced 2025-07-12 15:59:54 +02:00
Merge branch 'master' into docking + remove two _PopUnusedDrawCmd() from docking branch, following 718daa1
# Conflicts: # backends/imgui_impl_glfw.cpp # backends/imgui_impl_sdl.cpp # backends/imgui_impl_win32.cpp # imgui.cpp # imgui_internal.h
This commit is contained in:
@ -105,16 +105,14 @@ Other changes:
|
||||
Breaking Changes:
|
||||
|
||||
- Removed support for pre-C++11 compilers. We'll stop supporting VS2010. (#4537)
|
||||
- Removed support for legacy arithmetic operators (+,+-,*,/) when inputing text into a slider/drag. (#4917, #3184)
|
||||
This doesn't break any api/code but a feature that was accessible by end-users (which seemingly no one used).
|
||||
(Instead you may implement custom expression evaluators to provide a better version of this).
|
||||
- Reworked IO mouse input API: (#4858) [@thedmd, @ocornut]
|
||||
- Reworked IO mouse input API: (#4921, #4858) [@thedmd, @ocornut]
|
||||
- Added io.AddMousePosEvent(), AddMouseButtonEvent(), AddMouseWheelEvent() functions,
|
||||
obsoleting writing directly to io.MousePos, io.MouseDown[], io.MouseWheel, etc.
|
||||
- This enable input queue trickling to support low framerates. (#2787, #1992, #3383, #2525, #1320)
|
||||
- Reworked IO keyboard input API: (#2625, #3724) [@thedmd, @ocornut]
|
||||
- Reworked IO keyboard input API: (#4921, #2625, #3724) [@thedmd, @ocornut]
|
||||
- Added io.AddKeyEvent() function, obsoleting writing directly to io.KeyMap[], io.KeysDown[] arrays.
|
||||
- Added io.AddKeyModsEvent() function, obsoleting writing directly to io.KeyCtrl, io.KeyShift etc.
|
||||
- For keyboard modifiers, you can call io.AddKeyEvent() with ImGuiKey_ModXXX values,
|
||||
obsoleting writing directly to io.KeyCtrl, io.KeyShift etc.
|
||||
- Added io.SetKeyEventNativeData() function (optional) to pass native and old legacy indices.
|
||||
- Added full range of key enums in ImGuiKey (e.g. ImGuiKey_F1).
|
||||
- Added GetKeyName() helper function.
|
||||
@ -138,16 +136,21 @@ Breaking Changes:
|
||||
- Basically the trick we took advantage of is that we previously only supported native keycode from 0 to 511,
|
||||
so ImGuiKey values can still express a legacy native keycode, and new named keys are all >= 512.
|
||||
- This will enable a few things in the future:
|
||||
- Access to portable keys allows for backed-agnostic keyboard input code. Until now it was difficult to
|
||||
share code using keyboard accross project because of this gap. (#2625, #3724)
|
||||
- Access to portable keys allows for backend-agnostic keyboard input code. Until now it was difficult
|
||||
to share code using keyboard accross project because of this gap. (#2625, #3724)
|
||||
- Access to full key ranges will allow us to develop a proper keyboard shortcut system. (#456)
|
||||
- io.AddKeyEvent() will later be turned into a trickling IO queue (for all inputs) to handle very low framerate better. (#2525, #2787, #3383)
|
||||
- io.SetKeyEventNativeData() include native keycode/scancode which will later be exposed. (#3141, #2959)
|
||||
- Reworked IO nav/gamepad input API and unifying inputs sources: (#4858, #787)
|
||||
- Reworked IO nav/gamepad input API and unifying inputs sources: (#4921, #4858, #787)
|
||||
- Added full range of ImGuiKey_GamepadXXXX enums (e.g. ImGuiKey_GamepadDpadUp, ImGuiKey_GamepadR2) to use with
|
||||
io.AddKeyEvent(), io.AddKeyAnalogEvent().
|
||||
- Added io.AddKeyAnalogEvent() function, obsoleting writing directly to io.NavInputs[] arrays.
|
||||
- Renamed ImGuiKey_KeyPadEnter to ImGuiKey_KeypadEnter to align with new symbols. Kept redirection enum. (#2625)
|
||||
- Moved ImGuiKeyModsFlags definition from imgui.h to imgui_internal.h. Was never advertised and used in a place
|
||||
marked "private" in comments. Will still be used internally.
|
||||
- Removed support for legacy arithmetic operators (+,+-,*,/) when inputing text into a slider/drag. (#4917, #3184)
|
||||
This doesn't break any api/code but a feature that was accessible by end-users (which seemingly no one used).
|
||||
(Instead you may implement custom expression evaluators to provide a better version of this).
|
||||
- Backends: GLFW: backend now uses glfwSetCursorPosCallback().
|
||||
- If calling ImGui_ImplGlfw_InitXXX with install_callbacks=true: nothing to do. is already done for you.
|
||||
- If calling ImGui_ImplGlfw_InitXXX with install_callbacks=false: you WILL NEED to register the GLFW callback
|
||||
@ -171,15 +174,19 @@ Other Changes:
|
||||
- IO: Added event based input queue API, which now trickles events to support low framerates. [@thedmd, @ocornut]
|
||||
Previously the most common issue case (button presses in low framerates) was handled by backend. This is now
|
||||
handled by core automatically for all kind of inputs. (#4858, #2787, #1992, #3383, #2525, #1320)
|
||||
- New IO functions for keyboard/gamepad: AddKeyEvent(), AddKeyAnalogEvent(), AddKeyModsEvent().
|
||||
- New IO functions for keyboard/gamepad: AddKeyEvent(), AddKeyAnalogEvent().
|
||||
- New IO functions for mouse: AddMousePosEvent(), AddMouseButtonEvent(), AddMouseWheelEvent().
|
||||
- Fixed CTRL+Tab into an empty window causing artefacts on the highlight rectangle due to bad reordering on ImDrawCmd.
|
||||
- Fixed a situation where CTRL+Tab or Modal can occasionally lead to the creation of ImDrawCmd with zero triangles,
|
||||
which would makes the draw operation of some backends assert (e.g. Metal with debugging). (#4857)
|
||||
- Popups: Fixed a regression crash when a new window is created after a modal on the same frame. (#4920) [@rokups]
|
||||
- Popups: Fixed an issue when reopening a same popup multiple times would offset them by 1 pixel on the right. (#4936)
|
||||
- Tables, ImDrawListSplitter: Fixed erroneously stripping trailing ImDrawList::AddCallback() when submitted in
|
||||
last column or last channel and when there are no other drawing operation. (#4843, #4844) [@hoffstadt]
|
||||
- Tables: Fixed positioning of Sort icon on right-most column with some settings (not resizable + no borders). (#4918).
|
||||
- Nav: Fixed gamepad navigation in wrapping popups not wrapping all the way. (#4365)
|
||||
- Sliders, Drags: Fixed text input of values with a leading sign, common when using a format enforcing sign. (#4917)
|
||||
- Demo: draw a section of keyboard in "Inputs > Keyboard, Gamepad & Navigation state" to visualize keys. [@thedmd]
|
||||
- Platform IME: changed io.ImeSetInputScreenPosFn() to io.SetPlatformImeDataFn() API,
|
||||
now taking a ImGuiPlatformImeData structure which we can more easily extend in the future.
|
||||
- Platform IME: moved io.ImeWindowHandle to GetMainViewport()->PlatformHandleRaw.
|
||||
@ -191,32 +198,34 @@ Other Changes:
|
||||
other backend, and facilitate the use of GLFW with lettered-shortcuts API. (#456, #2625)
|
||||
- Backends: GLFW: Submit keys using io.AddKeyEvent(). Submit keymods using io.AddKeyModsEvent() at the same time. (#2625)
|
||||
- Backends: GLFW: Submit mouse data using io.AddMousePosEvent(), AddMouseButtonEvent(), AddMouseWheelEvent() functions. (#4858)
|
||||
- Backends: GLFW: Update mouse position using glfwSetCursorPosCallback() + fallback when focused but not hovered/captured.
|
||||
- Backends: GLFW: Retrieve mouse position using glfwSetCursorPosCallback() + fallback when focused but not hovered/captured.
|
||||
- Backends: GLFW: Submit gamepad data using io.AddKeyEvent/AddKeyAnalogEvent() functions, stopped writing to io.NavInputs[]. (#4858)
|
||||
- Backends: Win32: Submit keys using io.AddKeyEvent(). Submit keymods using io.AddKeyModsEvent() at the same time. (#2625)
|
||||
- Backends: Win32: Update mouse position using WM_MOUSEMOVE/WM_MOUSELEAVE + fallback when focused but not hovered/captured.
|
||||
- Backends: Win32: Retrieve mouse position using WM_MOUSEMOVE/WM_MOUSELEAVE + fallback when focused but not hovered/captured.
|
||||
- Backends: Win32: Submit mouse data using io.AddMousePosEvent(), AddMouseButtonEvent(), AddMouseWheelEvent() functions. (#4858)
|
||||
- Backends: Win32: Maintain a MouseButtonsDown mask instead of using ImGui::IsAnyMouseDown() which will be obsoleted.
|
||||
- Backends: Win32: Submit gamepad data using io.AddKeyEvent/AddKeyAnalogEvent() functions, stopped writing to io.NavInputs[]. (#4858)
|
||||
- Backends: SDL: Pass localized keys (matching keyboard layout). Fix e.g. CTRL+A, CTRL+Z, CTRL+Y shortcuts.
|
||||
- Backends: SDL: Submit keys using io.AddKeyEvent(). Submit keymods using io.AddKeyModsEvent() at the same time. (#2625)
|
||||
- Backends: SDL: Update mouse position using SDL_MOUSEMOTION/SDL_WINDOWEVENT_LEAVE + fallback when focused but not hovered/captured.
|
||||
- Backends: SDL: Submit key data using io.AddKeyEvent(). Submit keymods using io.AddKeyModsEvent() at the same time. (#2625)
|
||||
- Backends: SDL: Retrieve mouse position using SDL_MOUSEMOTION/SDL_WINDOWEVENT_LEAVE + fallback when focused but not hovered/captured.
|
||||
- Backends: SDL: Submit mouse data using io.AddMousePosEvent(), AddMouseButtonEvent(), AddMouseWheelEvent() functions. (#4858)
|
||||
- Backends: SDL: Maintain a MouseButtonsDown mask instead of using ImGui::IsAnyMouseDown() which will be obsoleted.
|
||||
- Backends: SDL: Submit gamepad data using io.AddKeyEvent/AddKeyAnalogEvent() functions, stopped writing to io.NavInputs[]. (#4858)
|
||||
- Backends: Allegro5: Submit keys using io.AddKeyEvent(). Submit keymods using io.AddKeyModsEvent() at the same time. (#2625)
|
||||
- Backends: Allegro5: Submit mouse data using io.AddMousePosEvent(), AddMouseButtonEvent(), AddMouseWheelEvent() functions. (#4858)
|
||||
- Backends: OSX: Submit keys using io.AddKeyEvent(). Submit keymods using io.AddKeyModsEvent() at the same time. (#2625)
|
||||
- Backends: OSX: Submit mouse data using io.AddMousePosEvent(), AddMouseButtonEvent(), AddMouseWheelEvent() functions. (#4858)
|
||||
- Backends: OSX: Submit gamepad data using io.AddKeyEvent/AddKeyAnalogEvent() functions, stopped writing to io.NavInputs[]. (#4858)
|
||||
- Backends: Android, GLUT, OSX: Submit keys using io.AddKeyEvent(). Submit keymods using io.AddKeyModsEvent() at the same time. (#2625)
|
||||
- Backends: Android, GLUT, OSX: Submit mouse data using io.AddMousePosEvent(), AddMouseButtonEvent(), AddMouseWheelEvent() functions. (#4858)
|
||||
- Backends: OSX: Added basic Platform IME support. (#3108, #2598) [@liuliu]
|
||||
- Backends: OSX: Fix Game Controller nav mapping to use shoulder for both focusing and tweak speed. (#4759)
|
||||
- Backends: Android, GLUT: Submit keys using io.AddKeyEvent(). Submit keymods using io.AddKeyModsEvent() at the same time. (#2625)
|
||||
- Backends: Android, GLUT: Submit mouse data using io.AddMousePosEvent(), AddMouseButtonEvent(), AddMouseWheelEvent() functions. (#4858)
|
||||
- Backends: OpenGL3: Fixed a buffer overflow in imgui_impl_opengl3_loader.h init (added in 1.86). (#4468, #4830) [@dymk]
|
||||
It would generally not have noticeable side-effect at runtime but would be detected by runtime checkers.
|
||||
- Backends: Metal: Added Apple Metal C++ API support. (#4824, #4746) [@luigifcruz]
|
||||
Enable with '#define IMGUI_IMPL_METAL_CPP' in your imconfig.h file.
|
||||
- Backends: Metal: Ignore ImDrawCmd where ElemCount == 0, which are normally not emitted by the library but
|
||||
can theorically be created by user code manipulating a ImDrawList. (#4857)
|
||||
- Backends: OSX: Added basic Platform IME support. (#3108, #2598) [@liuliu]
|
||||
- Backends: OSX: Fix Game Controller nav mapping to use shoulder for both focusing and tweak speed. (#4759)
|
||||
- Backends: Vulkan: Added support for ImTextureID as VkDescriptorSet, add ImGui_ImplVulkan_AddTexture(). (#914) [@martty]
|
||||
- Backends: WebGPU: Fixed incorrect size parameters in wgpuRenderPassEncoderSetIndexBuffer() and
|
||||
wgpuRenderPassEncoderSetVertexBuffer() calls. (#4891) [@FeepsDev]
|
||||
|
@ -139,7 +139,7 @@ void MyLowLevelMouseButtonHandler(int button, bool down)
|
||||
- The gamepad/keyboard navigation is fairly functional and keeps being improved. The initial focus was to support game controllers, but keyboard is becoming increasingly and decently usable. Gamepad support is particularly useful to use Dear ImGui on a game console (e.g. PS4, Switch, XB1) without a mouse connected!
|
||||
- Keyboard: set `io.ConfigFlags |= ImGuiConfigFlags_NavEnableKeyboard` to enable.
|
||||
- Gamepad: set `io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad` to enable (with a supporting backend).
|
||||
- See [Control Sheets for Gamepads](http://www.dearimgui.org/controls_sheets) (reference PNG/PSD for for PS4, XB1, Switch gamepads).
|
||||
- See [Control Sheets for Gamepads](http://www.dearimgui.org/controls_sheets) (reference PNG/PSD for PS4, XB1, Switch gamepads).
|
||||
- See `USING GAMEPAD/KEYBOARD NAVIGATION CONTROLS` section of [imgui.cpp](https://github.com/ocornut/imgui/blob/master/imgui.cpp) for more details.
|
||||
|
||||
##### [Return to Index](#index)
|
||||
@ -463,7 +463,7 @@ draw_list->AddCircleFilled(ImVec2(p.x + 50, p.y + 50), 30.0f, IM_COL32(255, 0, 0
|
||||
// Draw a 3 pixel thick yellow line
|
||||
draw_list->AddLine(ImVec2(p.x, p.y), ImVec2(p.x + 100.0f, p.y + 100.0f), IM_COL32(255, 255, 0, 255), 3.0f);
|
||||
|
||||
// Advance the ImGui cursor to claim space in the window (otherwise the window will appears small and needs to be resized)
|
||||
// Advance the ImGui cursor to claim space in the window (otherwise the window will appear small and needs to be resized)
|
||||
ImGui::Dummy(ImVec2(200, 200));
|
||||
|
||||
ImGui::End();
|
||||
|
@ -292,8 +292,8 @@ for (int rect_n = 0; rect_n < IM_ARRAYSIZE(rect_ids); rect_n++)
|
||||
## Using Font Data Embedded In Source Code
|
||||
|
||||
- Compile and use [binary_to_compressed_c.cpp](https://github.com/ocornut/imgui/blob/master/misc/fonts/binary_to_compressed_c.cpp) to create a compressed C style array that you can embed in source code.
|
||||
- See the documentation in [binary_to_compressed_c.cpp](https://github.com/ocornut/imgui/blob/master/misc/fonts/binary_to_compressed_c.cpp) for instruction on how to use the tool.
|
||||
- You may find a precompiled version binary_to_compressed_c.exe for Windows instead of demo binaries package (see [README](https://github.com/ocornut/imgui/blob/master/docs/README.md)).
|
||||
- See the documentation in [binary_to_compressed_c.cpp](https://github.com/ocornut/imgui/blob/master/misc/fonts/binary_to_compressed_c.cpp) for instructions on how to use the tool.
|
||||
- You may find a precompiled version binary_to_compressed_c.exe for Windows inside the demo binaries package (see [README](https://github.com/ocornut/imgui/blob/master/docs/README.md)).
|
||||
- The tool can optionally output Base85 encoding to reduce the size of _source code_ but the read-only arrays in the actual binary will be about 20% bigger.
|
||||
|
||||
Then load the font with:
|
||||
|
Reference in New Issue
Block a user