Skip to content

Commit a806d2f

Browse files
puugzocornut
authored andcommitted
Backends: SDLGPU: Fixed typo in function name Imgui_ImplSDLGPU3_PrepareDrawData() -> ImGui_ImplSDLGPU3_PrepareDrawData(). (#8509, 8163, #7998, #7988)
1 parent ca3ba28 commit a806d2f

File tree

4 files changed

+12
-9
lines changed

4 files changed

+12
-9
lines changed

backends/imgui_impl_sdlgpu3.cpp

+5-4
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@
1717
// - Introduction, links and more at the top of imgui.cpp
1818

1919
// Important note to the reader who wish to integrate imgui_impl_sdlgpu3.cpp/.h in their own engine/app.
20-
// - Unlike other backends, the user must call the function Imgui_ImplSDLGPU3_PrepareDrawData() BEFORE issuing a SDL_GPURenderPass containing ImGui_ImplSDLGPU3_RenderDrawData.
20+
// - Unlike other backends, the user must call the function ImGui_ImplSDLGPU3_PrepareDrawData() BEFORE issuing a SDL_GPURenderPass containing ImGui_ImplSDLGPU3_RenderDrawData.
2121
// Calling the function is MANDATORY, otherwise the ImGui will not upload neither the vertex nor the index buffer for the GPU. See imgui_impl_sdlgpu3.cpp for more info.
2222

2323
// CHANGELOG
24+
// 2025-03-21: Fixed typo in function name Imgui_ImplSDLGPU3_PrepareDrawData() -> ImGui_ImplSDLGPU3_PrepareDrawData().
2425
// 2025-01-16: Renamed ImGui_ImplSDLGPU3_InitInfo::GpuDevice to Device.
2526
// 2025-01-09: SDL_GPU: Added the SDL_GPU3 backend.
2627

@@ -134,7 +135,7 @@ static void CreateOrResizeBuffer(SDL_GPUBuffer** buffer, uint32_t* old_size, uin
134135
// SDL_GPU doesn't allow copy passes to occur while a render or compute pass is bound!
135136
// The only way to allow a user to supply their own RenderPass (to render to a texture instead of the window for example),
136137
// is to split the upload part of ImGui_ImplSDLGPU3_RenderDrawData() to another function that needs to be called by the user before rendering.
137-
void Imgui_ImplSDLGPU3_PrepareDrawData(ImDrawData* draw_data, SDL_GPUCommandBuffer* command_buffer)
138+
void ImGui_ImplSDLGPU3_PrepareDrawData(ImDrawData* draw_data, SDL_GPUCommandBuffer* command_buffer)
138139
{
139140
// Avoid rendering when minimized, scale coordinates for retina displays (screen coordinates != framebuffer coordinates)
140141
int fb_width = (int)(draw_data->DisplaySize.x * draw_data->FramebufferScale.x);
@@ -366,7 +367,7 @@ void ImGui_ImplSDLGPU3_DestroyFontsTexture()
366367
io.Fonts->SetTexID(0);
367368
}
368369

369-
static void Imgui_ImplSDLGPU3_CreateShaders()
370+
static void ImGui_ImplSDLGPU3_CreateShaders()
370371
{
371372
// Create the shader modules
372373
ImGui_ImplSDLGPU3_Data* bd = ImGui_ImplSDLGPU3_GetBackendData();
@@ -431,7 +432,7 @@ static void ImGui_ImplSDLGPU3_CreateGraphicsPipeline()
431432
{
432433
ImGui_ImplSDLGPU3_Data* bd = ImGui_ImplSDLGPU3_GetBackendData();
433434
ImGui_ImplSDLGPU3_InitInfo* v = &bd->InitInfo;
434-
Imgui_ImplSDLGPU3_CreateShaders();
435+
ImGui_ImplSDLGPU3_CreateShaders();
435436

436437
SDL_GPUVertexBufferDescription vertex_buffer_desc[1];
437438
vertex_buffer_desc[0].slot = 0;

backends/imgui_impl_sdlgpu3.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
// - Introduction, links and more at the top of imgui.cpp
1818

1919
// Important note to the reader who wish to integrate imgui_impl_sdlgpu3.cpp/.h in their own engine/app.
20-
// - Unlike other backends, the user must call the function Imgui_ImplSDLGPU_PrepareDrawData BEFORE issuing a SDL_GPURenderPass containing ImGui_ImplSDLGPU_RenderDrawData.
20+
// - Unlike other backends, the user must call the function ImGui_ImplSDLGPU_PrepareDrawData BEFORE issuing a SDL_GPURenderPass containing ImGui_ImplSDLGPU_RenderDrawData.
2121
// Calling the function is MANDATORY, otherwise the ImGui will not upload neither the vertex nor the index buffer for the GPU. See imgui_impl_sdlgpu3.cpp for more info.
2222

2323
#pragma once
@@ -38,7 +38,7 @@ struct ImGui_ImplSDLGPU3_InitInfo
3838
IMGUI_IMPL_API bool ImGui_ImplSDLGPU3_Init(ImGui_ImplSDLGPU3_InitInfo* info);
3939
IMGUI_IMPL_API void ImGui_ImplSDLGPU3_Shutdown();
4040
IMGUI_IMPL_API void ImGui_ImplSDLGPU3_NewFrame();
41-
IMGUI_IMPL_API void Imgui_ImplSDLGPU3_PrepareDrawData(ImDrawData* draw_data, SDL_GPUCommandBuffer* command_buffer);
41+
IMGUI_IMPL_API void ImGui_ImplSDLGPU3_PrepareDrawData(ImDrawData* draw_data, SDL_GPUCommandBuffer* command_buffer);
4242
IMGUI_IMPL_API void ImGui_ImplSDLGPU3_RenderDrawData(ImDrawData* draw_data, SDL_GPUCommandBuffer* command_buffer, SDL_GPURenderPass* render_pass, SDL_GPUGraphicsPipeline* pipeline = nullptr);
4343

4444
IMGUI_IMPL_API void ImGui_ImplSDLGPU3_CreateDeviceObjects();

docs/CHANGELOG.txt

+2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Other changes:
4949
EndPopup() call. (#1651, #8499)
5050
- Style, InputText: added ImGuiCol_InputTextCursor to configure color of
5151
the InputText cursor/caret. (#7031)
52+
- Backends: SDL3: Fixed casing typo in function name: (#8509, #8163, #7998, #7988) [@puugz]
53+
- Imgui_ImplSDLGPU3_PrepareDrawData() -> ImGui_ImplSDLGPU3_PrepareDrawData()
5254
- Backends: SDL2, SDL3, OSX: Fill gamepad inputs and set ImGuiBackendFlags_HasGamepad
5355
regardless of ImGuiConfigFlags_NavEnableGamepad being set. (#8508)
5456

examples/example_sdl3_sdlgpu3/main.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
// - Introduction, links and more at the top of imgui.cpp
88

99
// Important note to the reader who wish to integrate imgui_impl_sdlgpu3.cpp/.h in their own engine/app.
10-
// - Unlike other backends, the user must call the function Imgui_ImplSDLGPU_PrepareDrawData() BEFORE issuing a SDL_GPURenderPass containing ImGui_ImplSDLGPU_RenderDrawData.
10+
// - Unlike other backends, the user must call the function ImGui_ImplSDLGPU_PrepareDrawData() BEFORE issuing a SDL_GPURenderPass containing ImGui_ImplSDLGPU_RenderDrawData.
1111
// Calling the function is MANDATORY, otherwise the ImGui will not upload neither the vertex nor the index buffer for the GPU. See imgui_impl_sdlgpu3.cpp for more info.
1212

1313
#include "imgui.h"
@@ -178,8 +178,8 @@ int main(int, char**)
178178

179179
if (swapchain_texture != nullptr && !is_minimized)
180180
{
181-
// This is mandatory: call Imgui_ImplSDLGPU3_PrepareDrawData() to upload the vertex/index buffer!
182-
Imgui_ImplSDLGPU3_PrepareDrawData(draw_data, command_buffer);
181+
// This is mandatory: call ImGui_ImplSDLGPU3_PrepareDrawData() to upload the vertex/index buffer!
182+
ImGui_ImplSDLGPU3_PrepareDrawData(draw_data, command_buffer);
183183

184184
// Setup and start a render pass
185185
SDL_GPUColorTargetInfo target_info = {};

0 commit comments

Comments
 (0)