Browse Source

Note that the renderer will by default scale from window coordinates to pixels

Sam Lantinga 2 years ago
parent
commit
d563f38a0d
1 changed files with 7 additions and 0 deletions
  1. 7 0
      docs/README-migration.md

+ 7 - 0
docs/README-migration.md

@@ -596,6 +596,13 @@ which index is the "opengl" or whatnot driver, you can just pass that string dir
 here, now. Passing NULL is the same as passing -1 here in SDL2, to signify you want SDL
 here, now. Passing NULL is the same as passing -1 here in SDL2, to signify you want SDL
 to decide for you.
 to decide for you.
 
 
+When a renderer is created, it will automatically set the logical size to the size of
+the window in screen coordinates. For high DPI displays, this will set up scaling from
+window coordinates to pixels. You can disable this scaling with:
+```c
+    SDL_SetRenderLogicalPresentation(renderer, 0, 0, SDL_LOGICAL_PRESENTATION_DISABLED, SDL_SCALEMODE_NEAREST);
+```
+
 Mouse and touch events are no longer filtered to change their coordinates, instead you
 Mouse and touch events are no longer filtered to change their coordinates, instead you
 can call SDL_ConvertEventToRenderCoordinates() to explicitly map event coordinates into
 can call SDL_ConvertEventToRenderCoordinates() to explicitly map event coordinates into
 the rendering viewport.
 the rendering viewport.