Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored handling of window/renderer size getters
* Removed display::screen_area(), display::w(), and display::h(). * Moved the global screen_area() function into the CVideo class. * Renamed CVideo::getx() and gety() to get_width() and get_height() * Made those two functions return the result of screen_area() instead of the other way around. * Added preliminary support for high-DPI rendering to screen_area() Note on the last point: When I fixed bug #1772 (aa8f6c7 right now but will probably change with rebasing) I noted that SDL_GetWindowSize and SDL_GetRendererOutputSize returned the same results for me (even with Window's automatic scaling for non-high-DPI-enabled apps disabled) but that the SDL documentation stated the former returned screen coordinates and the latter pixels. In that same commit I changed the dimension functions to use SDL_GetWindowSize. I've now reversed that decision and gone back to using SDL_GetRendererOutputSize so I can guarantee output in pixels. If use_pixels is false, the code will return coordinates in 96 DPI, so I need to have pixel measurements for the calculations. Again, though, I do not know if SDL_GetWindowSize returns a different value that pixel size (which it's said to do) on macOS or iOS. I'll need to do some testing. It's possible on those platforms I won't need the 96 DPI measurements, but it's also possible it will be needed on on platforms, since all of our code relies on pixel measurements.
- Loading branch information
Showing
4 changed files
with
9 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters