Skip to content

Commit

Permalink
prevent blurry pixel-art/fonts during window resize on non-highdpi de…
Browse files Browse the repository at this point in the history
…vices
  • Loading branch information
coderofsalvation committed Mar 26, 2024
1 parent 9dd6896 commit 4ea3dd0
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/ppui/sdl/DisplayDeviceFB_SDL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,13 @@ PPDisplayDeviceFB::PPDisplayDeviceFB(pp_int32 width,
SDL_RenderSetLogicalSize(theRenderer, realWidth, realHeight);
#endif

#ifdef HIDPI_SUPPORT
// Use linear filtering for the scaling (make this optional eventually)
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "linear");
#else
// prefer sharp pixel-art/fonts over blurryness when resizing window
SDL_SetHint(SDL_HINT_RENDER_SCALE_QUALITY, "nearest");
#endif

// Create surface for rendering graphics
theSurface = SDL_CreateRGBSurface(0, realWidth, realHeight, bpp == -1 ? 32 : bpp, 0, 0, 0, 0);
Expand Down

0 comments on commit 4ea3dd0

Please sign in to comment.