mirror of
https://github.com/ocornut/imgui.git
synced 2026-07-26 10:42:15 +00:00
Backends: SDL_Renderer3: fixed changing scale mode not actually working on all platforms. (#7616, #9470, #9378)
This commit is contained in:
@@ -171,6 +171,7 @@ void ImGui_ImplSDLRenderer3_RenderDrawData(ImDrawData* draw_data, SDL_Renderer*
|
||||
// Will project scissor/clipping rectangles into framebuffer space
|
||||
ImVec2 clip_off = draw_data->DisplayPos; // (0,0) unless using multi-viewports
|
||||
ImVec2 clip_scale = render_scale;
|
||||
SDL_ScaleMode last_scale_mode = bd->CurrentScaleMode;
|
||||
|
||||
// Render command lists
|
||||
for (const ImDrawList* draw_list : draw_data->CmdLists)
|
||||
@@ -208,6 +209,9 @@ void ImGui_ImplSDLRenderer3_RenderDrawData(ImDrawData* draw_data, SDL_Renderer*
|
||||
const float* uv = (const float*)(const void*)((const char*)(vtx_buffer + pcmd->VtxOffset) + offsetof(ImDrawVert, uv));
|
||||
const SDL_Color* color = (const SDL_Color*)(const void*)((const char*)(vtx_buffer + pcmd->VtxOffset) + offsetof(ImDrawVert, col)); // SDL 2.0.19+
|
||||
|
||||
if (last_scale_mode != bd->CurrentScaleMode)
|
||||
SDL_FlushRenderer(renderer);
|
||||
|
||||
// Bind texture, Draw
|
||||
SDL_Texture* tex = (SDL_Texture*)pcmd->GetTexID();
|
||||
SDL_SetTextureScaleMode(tex, bd->CurrentScaleMode);
|
||||
|
||||
Reference in New Issue
Block a user