SDL_Rect(3type)

πŸ’– SDL_Rect β€” from the SDL3 DATATYPES era of the 3type manual πŸ’–

okay bestie, sit down, grab a strawberry πŸ“, because today we're talking about SDL_Rect and honestly? she's iconic, she's everywhere, she's the little rectangle that runs the whole visual world. no cap.


✨ NAME ✨

SDL_Rect β€” it's a rectangle πŸ’… and like… the origin is at the upper left, and everything is in integers (whole numbers only, no decimals, we don't do fractions in this house πŸŽ€).


🌸 SYNOPSIS 🌸

here's the whole vibe, verbatim, no edits, I would never:

#include <SDL3/SDL_rect.h>

typedef struct SDL_Rect
{
    int x, y;
    int w, h;
} SDL_Rect;

look at her. four lil ints. x and y are where she is, w and h are how big she is. that's it. that's the whole struct. main character energy with zero drama 🫢


πŸ¦‹ AVAILABILITY πŸ¦‹

she's been serving looks since SDL 3.2.0 ✨ so if you're on anything older, sorry babe, she's not there yet 😭


🌈 SEE ALSO 🌈

the whole friend group, go say hi, they're all lovely:


and that's the tea 🍡 this lil page came to you from Simple Directmedia Layer, riding the SDL 3.4.18 wave, and it's filed under SDL_Rect(3type) in the SDL3 DATATYPES section, periodt πŸ’–βœ¨ go forth and draw rectangles bestie πŸŽ€πŸ¦‹

πŸ“¦ where this page comes from