Commit Graph

6 Commits

Author SHA1 Message Date
Kristian Bolino
ec4aa9992f Fix high-DPI scaling in sdl_renderer
This commit resolves two issues with high-DPI display rendering:

1. The coordinates were not scaled properly, resulting in tiny output
   and misalignment of actual cursor position with apparent position;
   this is fixed by calling SDL_SetRenderScale with appropriate scaling
   factors determined by comparing the window size to the renderer's
   output size
2. The fonts were not oversampled, resulting in excessively blurry text;
    this is fixed by setting oversample_h and oversample_v on the
    font_config according to the scaling factors
2022-03-15 11:43:31 -04:00
Kristian Bolino
cbfc8f89e9
sdl_renderer: fix Metal rendering (#426)
Addresses an issue where the Metal render driver (macOS) could not handle the clipping rectangle {-8192, -8192, 16384, 16384} and would simply draw nothing to the screen. The solution is to ensure the cliprect coordinates are not negative, which also doesn't break the other render drivers.

Co-authored-by: Kristian Bolino <kbolino@kbolino.com>
2022-03-15 15:28:47 +01:00
crazyBaboon
f0dccaeeec
Integrate file browser with glfw opengl2 demo (#400) and restructure demo/ directory accordingly 2022-03-14 20:46:44 +01:00
Rob Loach
6686ab1dd5
Fix incorrect cast on SDL_RenderGeometryRaw()
Fixes #405
2022-02-06 00:43:54 -05:00
lib-omar
8f5ae21035
Favor switch over if-else chain in event handler. 2022-01-29 14:13:34 -05:00
Rob Loach
cd4990834f
sdl_renderer: Update code 2022-01-06 21:55:20 -05:00