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