al_get_video_scaled_width(3alleg5)

πŸ“¦
version 5.2.11.3 Β· 4 versions
, in debian trixie, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ al_get_video_scaled_width ✨

okay bestie, so this is a page from the Allegro reference manual, and the whole entire vibe of it is one single function in the Allegro 5 API: al_get_video_scaled_width. it's giving "small but mighty" fr fr πŸ’–


🌸 NAME 🌸

al_get_video_scaled_width β€” Allegro 5 API πŸŽ€

like. that's the name. that's the whole thing. she's an Allegro 5 API function and she said "that's my whole identity" πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro5/allegro_video.h>

float al_get_video_scaled_width(ALLEGRO_VIDEO *video)

no cap, that's literally the whole signature. include the header, call the function, take the float. slay ✨


πŸ’œ DESCRIPTION πŸ’œ

okay so what does she actually do? she returns the width with which the video frame should be drawn. that's it. that's the job. πŸ‘‘

and here's the lil plot twist that makes her matter: videos often do not use square pixels, so this will may return a value larger than the width of the frame bitmap. 😭 so like, if you were just gonna grab the bitmap width and call it a day… bestie no. the pixels aren't square, the math isn't mathing the way you assumed, and this function is the one that tells you the truth.

🫢 so basically: draw the frame at this width, not the bitmap's width. the function knows things. trust her.

⭐ SINCE ⭐

5.1.12

she's been here since 5.1.12 and she's been correct the entire time. iconic behaviour honestly 🌈


πŸ”₯ SEE ALSO πŸ”₯


and that's the whole page!! every flag, every float, every pixel-truth accounted for, no details left behind, periodt πŸ’…

πŸ’– this was brought to you by the Allegro reference manual, page al_get_video_scaled_width(3alleg5) β€” go forth and draw your videos at the correct width, my love, you're gonna ate πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from