radtofix_r(3alleg4)

✨ radtofix_r β€” the Allegro manual, but make it make sense ✨

okay bestie, real talk, we're in the Allegro game programming library and this page is about one (1) single constant. iconic behavior honestly. it's short, it's sweet, and it's about to convert your radians into binary angle vibes πŸ’…


🌸 NAME 🌸

radtofix_r β€” a constant to convert radians to fixed point angles. Allegro game programming library πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <allegro.h>

extern const fixed radtofix_r;

πŸ’– DESCRIPTION πŸ’–

so like. this constant is a ratio ✨ and what it does is let you take a fixed point number that's in radians and turn it into a fixed point number in binary angle format. that's it. that's the whole thing. it's giving "small but powerful" and we love her for it 🫢

here's the example, verbatim, no notes:

fixed rad_angle, binary_angle;
...
binary_angle = fixmul(rad_angle, radtofix_r);

so you just fixmul your radian value by radtofix_r and boom, binary angle. slay ✨πŸ”₯


🌈 SEE ALSO 🌈


Allegro, version 4.4.3 β€” that's the source and version, mwah, tysm for reading, go convert some angles fr fr πŸ’–βœ¨πŸŽ€πŸ¦‹