SDL_FRect(3type)

πŸ’– SDL_FRect β€” the manual page, but make it cute πŸ’–

okay bestie, so you're reading the SDL_FRect(3type) page, which lives in the SDL3 DATATYPES corner of the SDL3 universe. it's giving "rectangle, but make it float" and honestly? obsessed. let's get into it 🫢


✨ NAME ✨

SDL_FRect β€” a rectangle stored using floating point values.

like. it's a rectangle. but the numbers are floats. that's the whole vibe. πŸ’…


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_rect.h>

typedef struct SDL_FRect
{
    float x;
    float y;
    float w;
    float h;
} SDL_FRect;

four little floats, all in a row, living their best life. iconic. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so here's the tea on the coordinate space: the origin β€” like, the (0, 0) main-character spot β€” is up in the top-left. from there, increasing values move down and right. yes bestie, down. not up. it's not that kind of math class. πŸ“‰

the properties x and y represent the coordinates of the top-left corner of the rectangle. that's the anchor point. the moment. the place where your rect begins its journey. ✨

no cap, that's the entire description. short and slay. πŸ’–


🌈 AVAILABILITY 🌈

this struct is available since SDL 3.2.0. so if you're on something older, sorry babe, you gotta upgrade. not me gatekeeping structs but SDL kinda is πŸ™ˆ


πŸ‘‘ SEE ALSO πŸ‘‘

your girl does not come alone. here's the whole friend group, go say hi:

all the float-rect besties. iykyk πŸ’œ


and that's the page, bestie!! this little love letter to rectangles was brought to you by <strong>Simple Directmedia Layer</strong>, version <strong>SDL 3.4.18</strong>, and it's the <code>SDL_FRect(3type)</code> page β€” so you know exactly which one to cite when you're being a nerd in public. mwah. go draw something gorgeous πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from