// (minor and older changes stripped away, please see git history for details)
// 2023-XX-XX: Platform: Added support for multiple windows via the ImGuiPlatformIO interface.
// 2024-01-03: Vulkan: Added MinAllocationSize field in ImGui_ImplVulkan_InitInfo to workaround zealous "best practice" validation layer. (#7189, #4238)
// 2024-01-03: Vulkan: Stoped creating command pools with VK_COMMAND_POOL_CREATE_RESET_COMMAND_BUFFER_BIT as we don't reset them.
// 2023-11-29: Vulkan: Fixed mismatching allocator passed to vkCreateCommandPool() vs vkDestroyCommandPool(). (#7075)
// 2023-11-10: *BREAKING CHANGE*: Removed parameter from ImGui_ImplVulkan_CreateFontsTexture(): backend now creates its own command-buffer to upload fonts.
// *BREAKING CHANGE*: Removed ImGui_ImplVulkan_DestroyFontUploadObjects() which is now unecessary as we create and destroy those objects in the backend.
@ -81,79 +83,18 @@
#ifndef IMGUI_DISABLE
#include"imgui_impl_vulkan.h"
#include<stdio.h>
#ifndef IM_MAX
#define IM_MAX(A, B) (((A) >= (B)) ? (A) : (B))
#endif
// Visual Studio warnings
#ifdef _MSC_VER
#pragma warning (disable: 4127) // condition expression is constant
#endif
// Reusable buffers used for rendering 1 current in-flight frame, for ImGui_ImplVulkan_RenderDrawData()
// [Please zero-clear before use!]
structImGui_ImplVulkanH_FrameRenderBuffers
{
VkDeviceMemoryVertexBufferMemory;
VkDeviceMemoryIndexBufferMemory;
VkDeviceSizeVertexBufferSize;
VkDeviceSizeIndexBufferSize;
VkBufferVertexBuffer;
VkBufferIndexBuffer;
};
// Each viewport will hold 1 ImGui_ImplVulkanH_WindowRenderBuffers
VkDeviceSizeMinAllocationSize;// Minimum allocation size. Set to 1024*1024 to satisfy zealous best practices validation layer and waste a little memory.
// please post in https://github.com/ocornut/imgui/discussions if you cannot find a solution in resources above.
// Everything else should be asked in 'Issues'! We are building a database of cross-linked knowledge there.
// Copyright (c) 2014-2023 Omar Cornut
// Copyright (c) 2014-2024 Omar Cornut
// Developed by Omar Cornut and every direct or indirect contributors to the GitHub.
// See LICENSE.txt for copyright and licensing details (standard MIT License).
// This library is free but needs your support to sustain development and maintenance.
@ -3682,8 +3682,11 @@ void ImGui::Initialize()
// This function is merely here to free heap allocations.
voidImGui::Shutdown()
{
// The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame)
ImGuiContext&g=*GImGui;
IM_ASSERT_USER_ERROR(g.IO.BackendPlatformUserData==NULL,"Forgot to shutdown Platform backend?");
IM_ASSERT_USER_ERROR(g.IO.BackendRendererUserData==NULL,"Forgot to shutdown Renderer backend?");
// The fonts atlas can be used prior to calling NewFrame(), so we clear it even if g.Initialized is FALSE (which would happen if we never called NewFrame)
if(g.IO.Fonts&&g.FontAtlasOwnedByContext)
{
g.IO.Fonts->Locked=false;
@ -6358,15 +6361,17 @@ static int ImGui::UpdateWindowManualResize(ImGuiWindow* window, const ImVec2& si
flags|=ImGuiInputTextFlags_AutoSelectAll|(ImGuiInputTextFlags)ImGuiInputTextFlags_NoMarkEdited;// We call MarkItemEdited() ourselves by comparing the actual data rather than the string.