Pascal Thomet
18dca11dd0
Backends: GLFW, SDL2: ImplXXX_GetContentScaleXXX() helpers return 1.0f on emscripten / apple / android ( #8742 , #8733 )
...
We can divide platforms into two cases based on how they report screen geometry:
- Case 1: Platforms which report screen size in "physical pixels": Windows (for "Dpi aware" apps), Linux (with Wayland)
- Case 2: Platforms which report screen size in "density-independent pixels": macOS, iOS, Android, emscripten
As a consequence, there are two important things we need to know:
- FramebufferScale: The scaling factor FrameBufferSize / ScreenSize
- In case 1, the framebuffer size is equal to the screen size and DisplayFramebufferScale=1.
- In case 2, the framebuffer size is equal to the screen size multiplied by a factor, for example DisplayFramebufferScale=2.
- ContentScale The scaling factor for the content that we will display
- In case 1, the content scale will often need to be > 1 (e.g., 2), because we will need to display bigger elements so that they show with a correct physical size on the screen.
- In case 2, the content scale is equal to 1
This commit fixes ContentScale for platforms in case 2.
2025-07-08 15:53:42 +02:00
ocornut
495d6f1e39
Undef 'Status' in main header file. ( #8751 , #8765 )
2025-07-07 14:56:50 +02:00
ocornut
d99ab9f903
Backends: SDL2: undef Status for X11. ( #8751 )
2025-06-28 17:15:18 +02:00
ocornut
e97e55adbc
Backends: Fixed various warnings discovered when using MinGW GCC 15/Clang on latest backends.
...
dx12: 'ImGui_ImplDX12_Data* bd' shadowed local in spite of being in lambda.
2025-06-20 15:18:00 +02:00
ocornut
9a50c09172
Bsckends: SDL2, GLFW: fixed ImGui_ImplXXXX_GetContentScaleXXX functions never using SDL 2.0.4 & GLFW 3.3 path in master.
...
Amend 9da3e6696a
, 8269924c
(was broken for master)
2025-06-20 14:38:33 +02:00
ocornut
b98e92839c
Backends: SDL2, SDL3, GLFW: Backport small part of c90ea13
from docking.
2025-06-11 16:24:04 +02:00
ocornut
9da3e6696a
Backends: SDL2: added ImGui_ImplSDL2_GetDpiScaleForDisplay(), ImGui_ImplSDL2_GetContentScaleForWindow() helpers.
2025-06-11 16:12:41 +02:00
ocornut
9361c35176
Backends: SDL2, SDL3: maximum room for sanitizer to not be zealous.
2025-05-15 15:36:42 +02:00
ocornut
08689c51a9
Backends: GLFW, SDL2, SDL3: include GLFW/SDL version number in io.BackendPlatformName.
...
# Conflicts:
# backends/imgui_impl_sdl2.cpp
# backends/imgui_impl_sdl3.cpp
2025-05-13 15:50:51 +02:00
Zane van Iperen
74e453cf15
Backends: SDL2, SDL3: don't attempt to call SDL_CaptureMouse() on drivers where we don't call SDL_GetGlobalMouseState(). ( #8561 )
2025-04-09 14:58:32 +02:00
ocornut
979c7d76ab
Backends: SDL2, SDL3, OSX: Fill gamepad inputs and set ImGuiBackendFlags_HasGamepad regardless of ImGuiConfigFlags_NavEnableGamepad being set. ( #8508 )
2025-03-21 15:42:47 +01:00
ocornut
51e4cba909
Backends: Fixed zealous warnings.
2025-03-11 12:05:23 +01:00
ocornut
a9e53829d2
Backends: Win32, SDL2, SDL3, GLFW: prioritize scancodes instead of translated keycodes when dealing with OEM keys + Added ImGuiKey_Oem102. ( #7136 , #7201 , #7206 , #7306 , #7670 , #7672 , #8468 )
2025-03-10 18:01:29 +01:00
ocornut
aa83d5d455
Backends: SDL2, SDL3: Only start SDL_CaptureMouse() when mouse is being dragged. ( #6410 , #3650 )
...
To mitigate issues with e.g. Linux debuggers not claiming capture back.
2025-02-26 15:34:31 +01:00
TheMode
dac40d0487
Backends: SDL2, SDL3: don't call SDL_GetGlobalMouseState() when mouse position is in relative mode. ( #8425 , #8407 )
2025-02-24 12:26:48 +01:00
ocornut
eec097fe35
Added ImGuiMouseCursor_Progress mouse cursor 8a35386+ support in SDL2,SDL3,Win32,Allegro5 backends.
...
Amend 8a35386
2025-02-18 18:52:08 +01:00
ocornut
8a35386ba7
Added ImGuiMouseCursor_Wait mouse cursor (busy/wait/hourglass shape) + support in SDL2,SDL3,Win32,Allegro5 backends.
2025-02-18 18:40:47 +01:00
ocornut
b78cc37891
Backends: SDL2: Fixed build for versions older than 2.0.14. ( #7660 )
2025-02-12 19:27:43 +01:00
ocornut
a431e1277e
Backends: SDL2, SDL3: Using SDL_OpenURL() in platform_io.Platform_OpenInShellFn handler. ( #7660 )
2025-02-10 12:09:44 +01:00
ocornut
4c2e7bb035
Backends: SDL2,SDL3: removed assert preventing using ImGui_ImplSDL2_SetGamepadMode()/ImGui_ImplSDL3_SetGamepadMode() with ImGui_ImplSDL2_GamepadMode_Manual/ImGui_ImplSDL3_GamepadMode_Manual and an empty array. ( #8329 )
2025-01-20 15:24:46 +01:00
ocornut
6fb7d44255
Backends: SDL2/SDL3: Comments. ( #7672 , #7670 )
2025-01-13 17:40:38 +01:00
ocornut
43fbd7ce84
Backends: standardized top of file comments.
2024-12-05 12:43:04 +01:00
ocornut
566558b17c
Replacing NULL with nullptr in examples/backends when they creeped back. ( #6313 , #7071 , #4537 )
2024-12-05 12:25:02 +01:00
ocornut
6f287dd16d
(Breaking) Removed pre-1.87 obsolete io.KeyMap[], io.KeysDown[], io.NavInputs[]. Remove IMGUI_DISABLE_OBSOLETE_KEYIO. ( #4921 )
2024-11-06 17:54:59 +01:00
ocornut
a908d73c16
Backends: avoid missing -Wmissing-declaration warning. ( #8087 , #7997 )
2024-10-24 17:24:47 +02:00
Eugene Sandulenko
a855bd8df3
Backends: SDL2: Replace SDL_Vulkan_GetDrawableSize() forward declaration with the actual include. ( #8095 , #7967 , #3190 )
2024-10-24 14:52:25 +02:00
ocornut
06092a9756
Backends: SDL2, SDL3: SDL_EVENT_MOUSE_WHEEL event doesn't require dividing by 100.0f on Emscripten. ( #4019 , #6096 , #1463 )
...
Ref https://github.com/libsdl-org/SDL/issues/10454#issuecomment-2434187317
2024-10-24 14:47:23 +02:00
ocornut
d885fe4dd0
(Breaking) moved ImGuiConfigFlags_NavEnableSetMousePos -> io.ConfigNavMoveSetMousePos, ImGuiConfigFlags_NavNoCaptureKeyboard -> ConfigNavCaptureKeyboard. ( #2517 , #2009 )
2024-10-14 15:29:24 +02:00
ocornut
cfae5ac71b
Backends: make ImGui_ImplSDL2_KeyEventToImGuiKey(), ImGui_ImplSDL3_KeyEventToImGuiKey(), ImGui_ImplGlfw_KeyToImGuiKey(), ImGui_ImplWin32_KeyEventToImGuiKey(), ImGui_ImplAllegro5_KeyCodeToImGuiKey(), ImGui_ImplOSX_KeyCodeToImGuiKey(), non-static. ( #7997 )
...
Backends: Win32: Refactor ImGui_ImplWin32_KeyEventToImGuiKey() logic.
Ref #7672
2024-09-19 14:10:00 +02:00
scribam
4236bc088f
Backends: SDL2: use SDL_Vulkan_GetDrawableSize with Vulkan instead of SDL_GL_GetDrawableSize. ( #7967 , #3190 )
2024-09-09 17:33:28 +02:00
ocornut
214977e5fd
IO: (BREAKING) moved io.GetClipboardTextFn, io.SetClipboardTextFn to platform_io.Platform_GetClipboardTextFn, platform_io.Platform_SetClipboardTextFn.
2024-08-22 20:12:23 +02:00
ocornut
9ff60ae31d
IO: (BREAKING) moved GetIO().PlatformSetImeDataFn to GetPlatformIO(.Platform_SetImeDataFn. ( #7660 )
2024-08-22 20:11:55 +02:00
ocornut
ba2f4a2cd5
IO: (BREAKING) moved GetIO().PlatformOpenInShellFn to GetPlatformIO(.Platform_OpenInShellFn. ( #7660 )
2024-08-22 20:11:36 +02:00
ocornut
2d99052d1d
Backends: SDL2, SDL3: storing SDL_WindowID inside ImGuiViewport::PlatformHandle instead of SDL_Window*. ( #7853 )
...
This will be used to support filtering of events with multi-viewports.
2024-08-19 14:43:43 +02:00
ocornut
1b61d55079
Backends: SDL2, SDL3: ignore events of other SDL windows, amends + wrapping into a function as it'll be convenient for multi-viewport check. ( #7853 )
...
+ Misc typo fix.
2024-08-19 14:43:40 +02:00
Anonymous Maarten
591a18a9c4
Backends: SDL2, SDL3: ignore events of other SDL windows. ( #7853 )
2024-08-19 13:54:39 +02:00
ocornut
0ebf49b4c1
IO: amend PlatformOpenInShellFn specs to return a bool. ( #7660 )
...
Amend 8f36798
2024-07-02 19:03:40 +02:00
ocornut
380b3559c6
Backends: GLFW,SDL2: Added ioPlatformOpenInShellFn handler for web/Emscripten versions. ( #7660 )
2024-07-02 18:06:19 +02:00
ocornut
fb799bba7f
(Breaking) IO, IME: renamed platform IME hook io.SetPlatformImeDataFn() -> io.PlatformSetImeDataFn() and added explicit context.
2024-07-02 15:48:32 +02:00
ocornut
ae708e3bcd
Backends: SDL3: add default case to fix warnings. ( #7763 )
2024-07-02 12:12:25 +02:00
ocornut
12f92518bc
Backends: SDL3: Update for API changes: SDLK_x renames and SDLK_KP_x removals ( #7761 , #7762 )
...
Also updated function signature in SDL2 backend to match and because it is expected we will use that data (as per #7672 )
2024-07-02 11:36:13 +02:00
ocornut
32f9dfc126
Viewports: Backported 'void* ImGuiViewport::PlatformHandle' from docking branch for use by backends.
2024-06-26 14:32:48 +02:00
ocornut
5e23680454
Backends: all backends + demo now call IMGUI_CHECKVERSION() to verify ABI compatibility between caller code and compiled version of dear imgui. ( #7568 )
2024-05-13 15:07:13 +02:00
ocornut
d15574ce2a
Backends: Win32: Removed silent return when calling ImGui_ImplWin32_WndProcHandler() with no active context! ( #6275 )
...
Better standardized similar checks in other backends.
2024-05-07 16:53:03 +02:00
ocornut
262e30e300
Backends: SDL2: rework new API as ImGui_ImplSDL2_SetGamepadMode(). ( #3884 , #6559 , #6890 , #7180 )
...
Code is simpler this way.
2024-02-14 11:30:43 +01:00
ocornut
d15e4100b8
Backends: SDL2: Amend new API, all support for multiple gamepads. ( #3884 , #6559 , #6890 )
2024-02-13 18:55:14 +01:00
ocornut
f966da1f8f
Backends: SDL2: Gamepad handlng: amend bf1c96d
. ( #3884 , #6559 , #6890 )
2024-02-13 16:31:33 +01:00
ocornut
bf1c96d4fa
Backends: SDL2: Handle gamepad disconnection + fixed increasing refcount. Added ImGui_ImplSDL2_SelectGamepadAuto()/ImGui_ImplSDL2_SelectGamepadExplicit(). ( #3884 , #6559 , #6890 )
2024-02-13 16:24:44 +01:00
ocornut
fd8d6dc5d1
Backends: SDL2,SDL3: tidying up.
2024-02-13 15:49:49 +01:00
ocornut
001f102f38
IO, Backends: added ImGuiKey_AppBack, ImGuiKey_AppForward. ( #6891 , #4921 )
2023-10-05 21:26:07 +02:00