SDL_ScaleMode(3type)
π SDL_ScaleMode π
okay bestie, pull up a chair, because we're talking about SDL_ScaleMode β literally the enum that decides how your pixels get stretched, from the SDL3 DATATYPES crew β¨
πΈ NAME πΈ
SDL_ScaleMode β the scaling mode. that's it, that's the whole vibe π
β¨ SYNOPSIS β¨
first things first, you gotta invite it in:
#include <SDL3/SDL_surface.h>
and here's the whole enum, no crumbs left behind:
typedef enum SDL_ScaleMode
{
SDL_SCALEMODE_INVALID = -1,
SDL_SCALEMODE_NEAREST, /**< nearest pixel sampling */
SDL_SCALEMODE_LINEAR, /**< linear filtering */
SDL_SCALEMODE_PIXELART /**< nearest pixel sampling with improved scaling for pixel art, available since SDL 3.4.0 */
} SDL_ScaleMode;
let's break down the members, because each one is giving a whole different energy π¦
SDL_SCALEMODE_INVALIDβ set to-1. it's the "this is not a real mode" mode, the placeholder, the empty seat at the lunch table π«₯SDL_SCALEMODE_NEARESTβ nearest pixel sampling. chunky, crisp, unbothered, exactly as the source pixels intended πSDL_SCALEMODE_LINEARβ linear filtering. smooth and soft, blurs the edges together like a lil filter on your selfie πΈSDL_SCALEMODE_PIXELARTβ nearest pixel sampling with improved scaling for pixel art, and she's available since SDL 3.4.0. the glow-up for your 16-bit era faves fr fr π₯
π AVAILABILITY π
this enum has been around since SDL 3.2.0 β she's not new new, but she's thriving β¨
ngl bestie, SDL_SCALEMODE_PIXELART is the newer one of the bunch (SDL 3.4.0, remember?), so if you're building against an older SDL and it's acting like that value doesn't existβ¦ that's why π
and that's the whole page, no notes π
this lil datatype lives in the Simple Directmedia Layer house, page for SDL 3.4.18, dated SDL_ScaleMode(3type) β mwah, periodt π
π¦ where this page comes from
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 43: SDL3-devel 3.4.18-1.fc43 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- fedora 44: SDL3-devel 3.4.18-1.fc44 Β· Zlib AND MIT AND Apache-2.0 AND (Apache-2.0 OR MIT)
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms