Skip to content

Commit

Permalink
Examples: SDL+SDL_Renderer: Added call to SDL_RenderSetScale() to dis…
Browse files Browse the repository at this point in the history
…play is correct on a Retina display (albeit lower-res as our other unmodified examples). (#6121, #6065, #5931).
  • Loading branch information
ocornut committed Jan 31, 2023
1 parent 867bdbe commit 5a3f82e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docs/CHANGELOG.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ All changes:
- Examples: Win32: Fixed examples using RegisterClassW() since 1.89 to also call
DefWindowProcW() instead of DefWindowProc() so that title text are correctly converted
when application is compiled without /DUNICODE. (#5725, #5961, #5975) [@markreidvfx]
- Examples: SDL+SDL_Renderer: Added call to SDL_RenderSetScale() to display is correct on a
Retina display (albeit lower-res as our other unmodified examples). (#6121, #6065, #5931).


-----------------------------------------------------------------------
Expand Down
1 change: 1 addition & 0 deletions examples/example_sdl_sdlrenderer/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ int main(int, char**)

// Rendering
ImGui::Render();
SDL_RenderSetScale(renderer, io.DisplayFramebufferScale.x, io.DisplayFramebufferScale.y);
SDL_SetRenderDrawColor(renderer, (Uint8)(clear_color.x * 255), (Uint8)(clear_color.y * 255), (Uint8)(clear_color.z * 255), (Uint8)(clear_color.w * 255));
SDL_RenderClear(renderer);
ImGui_ImplSDLRenderer_RenderDrawData(ImGui::GetDrawData());
Expand Down

0 comments on commit 5a3f82e

Please sign in to comment.