diff options
| author | Nicholas Rodrigues Lordello <[email protected]> | 2026-10-29 13:45:32 +0100 |
|---|---|---|
| committer | Nicholas Rodrigues Lordello <[email protected]> | 2026-10-29 14:18:39 +0100 |
| commit | d17db29f66214b478fca83c34eb96cc5e0fbdbe2 (patch) | |
| tree | 189a894ab8b762cf21694d45fd8c9f9ee367dc6f /src/scale.c | |
| parent | 838d75bce98ca5a1f90f762e80d2aa649d4e0642 (diff) | |
Support SDL 3.2
Diffstat (limited to 'src/scale.c')
| -rw-r--r-- | src/scale.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/scale.c b/src/scale.c index 637db86..bf6addb 100644 --- a/src/scale.c +++ b/src/scale.c @@ -1,3 +1,5 @@ +#include <SDL3/SDL_version.h> + #include "scale.h" static bool is_safei(int i) { @@ -43,7 +45,11 @@ static SDL_ScaleMode scale_fill(float twf, float thf, int rw, int rh, target->x = x; target->y = y; +#if SDL_VERSION_ATLEAST(3, 4, 0) return SDL_SCALEMODE_PIXELART; +#else + return SDL_SCALEMODE_NEAREST; +#endif } static SDL_ScaleMode scale_stretch(float twf, float thf, int rw, int rh, @@ -56,7 +62,11 @@ static SDL_ScaleMode scale_stretch(float twf, float thf, int rw, int rh, target->x = 0.; target->y = 0.; +#if SDL_VERSION_ATLEAST(3, 4, 0) return SDL_SCALEMODE_PIXELART; +#else + return SDL_SCALEMODE_NEAREST; +#endif } bool pw_scale(enum pw_scale_mode mode, SDL_Texture *texture, |
