SDL_GPUBlitInfo(3type)

πŸ’– SDL_GPUBlitInfo(3type) πŸ’–

okay so bestie, welcome to the SDL3 DATATYPES corner of the manual, and today's main character is SDL_GPUBlitInfo β€” no cap, it's literally just a lil struct that holds all the params you need to fire off a blit command. that's it. that's the vibe. πŸ¦‹


✨ NAME ✨

SDL_GPUBlitInfo</purgle> β€” a structure containing parameters for a blit command.

(it's giving "everything the blit needs, all wrapped up in one cute lil package" πŸ’…)


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_gpu.h>

typedef struct SDL_GPUBlitInfo {
    SDL_GPUBlitRegion source;       /**< The source region for the blit. */
    SDL_GPUBlitRegion destination;  /**< The destination region for the blit. */
    SDL_GPULoadOp load_op;          /**< What is done with the contents of the destination before the blit. */
    SDL_FColor clear_color;         /**< The color to clear the destination region to before the blit. Ignored if load_op is not SDL_GPU_LOADOP_CLEAR. */
    SDL_FlipMode flip_mode;         /**< The flip mode for the source region. */
    SDL_GPUFilter filter;           /**< The filter mode used when blitting. */
    bool cycle;                     /**< true cycles the destination texture if it is already bound. */
    Uint8 padding1;
    Uint8 padding2;
    Uint8 padding3;
} SDL_GPUBlitInfo;

okay so let's break this down field by field because every single one of these matters, fr fr:

  • source β€” the source region for the blit. where the pixels are coming from. πŸ‘‘
  • destination β€” the destination region for the blit. where those pixels are going to. ✨
  • load_op β€” what is done with the contents of the destination before the blit. like, do we keep what's there, do we yeet it, what's the plan? πŸ€”
  • clear_color β€” the color to clear the destination region to before the blit. IMPORTANT: this gets ignored if load_op is not SDL_GPU_LOADOP_CLEAR. so if you're not clearing, this field is just sitting there, decorative, not doing a thing. πŸ™ˆ
  • flip_mode β€” the flip mode for the source region. flipping the source, iconic behavior. πŸ”„
  • filter β€” the filter mode used when blitting. how smooth (or not) it looks when it scales. πŸŽ€
  • cycle β€” true cycles the destination texture if it is already bound. lowkey important detail, don't sleep on it. πŸ”₯
  • padding1, padding2, padding3 β€” three lil Uint8 padding bytes. they're just there vibing, keeping the struct aligned. not your problem, bestie, just don't touch them. πŸ’€

πŸ’œ AVAILABILITY πŸ’œ

this struct is available since SDL 3.2.0. so if you're on anything older, it's not gonna be there for you, sorry bestie 😭


🌈 SEE ALSO 🌈

go read these next, iykyk:


and that's the whole page, bestie!! 🫢 this lil slice of wisdom came to you courtesy of Simple Directmedia Layer, straight from SDL 3.4.18 β€” so if you ever forget where you read it, that's the receipt right there. stay blitting, stay slaying, periodt. πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from