فهرست منبع

Backends: SDLGPU3: Fixed creating atlas texture earlier than other backends.

# Conflicts:
#	backends/imgui_impl_sdlgpu3.cpp
ocornut 2 ماه پیش
والد
کامیت
c5e2bb7cd1
2فایلهای تغییر یافته به همراه4 افزوده شده و 2 حذف شده
  1. 2 2
      backends/imgui_impl_sdlgpu3.cpp
  2. 2 0
      docs/CHANGELOG.txt

+ 2 - 2
backends/imgui_impl_sdlgpu3.cpp

@@ -589,8 +589,6 @@ bool ImGui_ImplSDLGPU3_Init(ImGui_ImplSDLGPU3_InitInfo* info)
 
     bd->InitInfo = *info;
 
-    ImGui_ImplSDLGPU3_CreateDeviceObjects();
-
     return true;
 }
 
@@ -612,6 +610,8 @@ void ImGui_ImplSDLGPU3_NewFrame()
     ImGui_ImplSDLGPU3_Data* bd = ImGui_ImplSDLGPU3_GetBackendData();
     IM_ASSERT(bd != nullptr && "Context or backend not initialized! Did you call ImGui_ImplSDLGPU3_Init()?");
 
+    if (!bd->FontSampler)
+        ImGui_ImplSDLGPU3_CreateDeviceObjects();
     if (!bd->FontTexture)
         ImGui_ImplSDLGPU3_CreateFontsTexture();
 }

+ 2 - 0
docs/CHANGELOG.txt

@@ -111,6 +111,8 @@ Other changes:
   memory ownership change. (#8530, #7801) [@Green-Sky]
 - Backends: SDL3: honor ImGuiPlatformImeData->WantTextInput as an alternative
   way to call SDL_StartTextInput(), without IME being necessarily visible. (#8584)
+- Backends: SDLGPU3: Fixed creating atlas texture earlier than other backends, preventing
+  to load fonts between the Init and NewFrames calls.
 - Backends: SDLGPU3: Made ImGui_ImplSDLGPU3_PrepareDrawData() reuse GPU Transfer Buffers which
   were unusually slow to recreate every frame. Much faster now. (#8534) [@ocornut, @TheMode]
 - Backends: SDLGPU3: added support for ImDrawCallback_ResetRenderState. (#8599)