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:
SDL_RectEmptyFloat(3)SDL_RectsEqualFloat(3)SDL_RectsEqualEpsilon(3)SDL_HasRectIntersectionFloat(3)SDL_GetRectIntersectionFloat(3)SDL_GetRectAndLineIntersectionFloat(3)SDL_GetRectUnionFloat(3)SDL_GetRectEnclosingPointsFloat(3)SDL_PointInRectFloat(3)
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
- 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