|
@@ -21,6 +21,7 @@
|
|
|
|
|
|
// CHANGELOG
|
|
// CHANGELOG
|
|
// (minor and older changes stripped away, please see git history for details)
|
|
// (minor and older changes stripped away, please see git history for details)
|
|
|
|
+// 2024-09-09: use SDL_Vulkan_GetDrawableSize() when available. (#7967, #3190)
|
|
// 2024-08-22: moved some OS/backend related function pointers from ImGuiIO to ImGuiPlatformIO:
|
|
// 2024-08-22: moved some OS/backend related function pointers from ImGuiIO to ImGuiPlatformIO:
|
|
// - io.GetClipboardTextFn -> platform_io.Platform_GetClipboardTextFn
|
|
// - io.GetClipboardTextFn -> platform_io.Platform_GetClipboardTextFn
|
|
// - io.SetClipboardTextFn -> platform_io.Platform_SetClipboardTextFn
|
|
// - io.SetClipboardTextFn -> platform_io.Platform_SetClipboardTextFn
|
|
@@ -112,6 +113,9 @@
|
|
#define SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE 0
|
|
#define SDL_HAS_CAPTURE_AND_GLOBAL_MOUSE 0
|
|
#endif
|
|
#endif
|
|
#define SDL_HAS_VULKAN SDL_VERSION_ATLEAST(2,0,6)
|
|
#define SDL_HAS_VULKAN SDL_VERSION_ATLEAST(2,0,6)
|
|
|
|
+#if SDL_HAS_VULKAN
|
|
|
|
+extern "C" { extern DECLSPEC void SDLCALL SDL_Vulkan_GetDrawableSize(SDL_Window* window, int* w, int* h); }
|
|
|
|
+#endif
|
|
|
|
|
|
// SDL Data
|
|
// SDL Data
|
|
struct ImGui_ImplSDL2_Data
|
|
struct ImGui_ImplSDL2_Data
|
|
@@ -760,6 +764,10 @@ void ImGui_ImplSDL2_NewFrame()
|
|
w = h = 0;
|
|
w = h = 0;
|
|
if (bd->Renderer != nullptr)
|
|
if (bd->Renderer != nullptr)
|
|
SDL_GetRendererOutputSize(bd->Renderer, &display_w, &display_h);
|
|
SDL_GetRendererOutputSize(bd->Renderer, &display_w, &display_h);
|
|
|
|
+#if SDL_HAS_VULKAN
|
|
|
|
+ else if (SDL_GetWindowFlags(bd->Window) & SDL_WINDOW_VULKAN)
|
|
|
|
+ SDL_Vulkan_GetDrawableSize(bd->Window, &display_w, &display_h);
|
|
|
|
+#endif
|
|
else
|
|
else
|
|
SDL_GL_GetDrawableSize(bd->Window, &display_w, &display_h);
|
|
SDL_GL_GetDrawableSize(bd->Window, &display_w, &display_h);
|
|
io.DisplaySize = ImVec2((float)w, (float)h);
|
|
io.DisplaySize = ImVec2((float)w, (float)h);
|