|
21 | 21 |
|
22 | 22 | // CHANGELOG |
23 | 23 | // (minor and older changes stripped away, please see git history for details) |
| 24 | +// 2026-08-06: Fixed querying framebuffer scale when using Metal. (#5592) |
24 | 25 | // 2026-07-15: Inputs: restore SDL_StartTextInput()/SDL_StopTextInput() in IME handler for on-screen keyboard support on Android/mobile. (#7636, #9474) |
25 | 26 | // 2026-04-16: Made ImGui_ImplSDL2_GetContentScaleForWindow(), ImGui_ImplSDL2_GetContentScaleForDisplay() helpers return a minimum of 1.0f, as some Linux setup seems to report <1.0f value and this breaks scaling border size. (#9369) |
26 | 27 | // 2026-02-13: Inputs: systems other than X11 are back to starting mouse capture on mouse down (reverts 2025-02-26 change). Only X11 requires waiting for a drag by default (not ideal, but a better default for X11 users). Added ImGui_ImplSDL2_SetMouseCaptureMode() for X11 debugger users. (#3650, #6410, #9235) |
|
135 | 136 | #endif |
136 | 137 | #define SDL_HAS_PER_MONITOR_DPI SDL_VERSION_ATLEAST(2,0,4) |
137 | 138 | #define SDL_HAS_VULKAN SDL_VERSION_ATLEAST(2,0,6) |
| 139 | +#if defined(__APPLE__) |
| 140 | +#define SDL_HAS_METAL SDL_VERSION_ATLEAST(2,0,14) |
| 141 | +#else |
| 142 | +#define SDL_HAS_METAL 0 |
| 143 | +#endif |
138 | 144 | #define SDL_HAS_OPEN_URL SDL_VERSION_ATLEAST(2,0,14) |
139 | 145 | #if SDL_HAS_VULKAN |
140 | 146 | #include <SDL_vulkan.h> |
141 | 147 | #endif |
| 148 | +#if SDL_HAS_METAL |
| 149 | +#include <SDL_metal.h> |
| 150 | +#endif |
142 | 151 |
|
143 | 152 | // SDL Data |
144 | 153 | struct ImGui_ImplSDL2_Data |
@@ -899,6 +908,10 @@ static void ImGui_ImplSDL2_GetWindowSizeAndFramebufferScale(SDL_Window* window, |
899 | 908 | #if SDL_HAS_VULKAN |
900 | 909 | else if (SDL_GetWindowFlags(window) & SDL_WINDOW_VULKAN) |
901 | 910 | SDL_Vulkan_GetDrawableSize(window, &display_w, &display_h); |
| 911 | +#endif |
| 912 | +#if SDL_HAS_METAL |
| 913 | + else if (SDL_GetWindowFlags(window) & SDL_WINDOW_METAL) |
| 914 | + SDL_Metal_GetDrawableSize(window, &display_w, &display_h); |
902 | 915 | #endif |
903 | 916 | else |
904 | 917 | SDL_GL_GetDrawableSize(window, &display_w, &display_h); |
|
0 commit comments