cpu_family(3alleg4)

✨ cpu_family ✨

okay bestie, buckle up, this is a page from the Allegro manual (that's the Allegro game programming library, the one and only πŸ‘‘) and it's about a little global called cpu_family β€” the variable that knows what kind of CPU you're running on. it's giving ✨hardware detective✨.


🌸 SYNOPSIS 🌸

#include <allegro.h>

extern int cpu_family;

like, that's it. one extern int. she's simple, she's iconic, she's global πŸ’…


πŸ’– DESCRIPTION πŸ’–

so cpu_family contains the Intel type, where applicable β€” meaning: if your processor is an Intel-ish one, this is where Allegro tells you which flavor. Allegro defines these CPU family types:

  • CPU_FAMILY_UNKNOWN β€” we literally have no idea what processor this is πŸ™ˆ the type of processor is unknown
  • CPU_FAMILY_I386 β€” the processor is an Intel-compatible 386
  • CPU_FAMILY_I486 β€” the processor is an Intel-compatible 486
  • CPU_FAMILY_I586 β€” the processor is a Pentium or equivalent
  • CPU_FAMILY_I686 β€” the processor is a Pentium Pro, II, III or equivalent
  • CPU_FAMILY_ITANIUM β€” the processor is an Itanium processor
  • CPU_FAMILY_POWERPC β€” the processor is a PowerPC processor πŸ¦‹
  • CPU_FAMILY_EXTENDED β€” the processor type needs to be read from the cpu_model (so like, this one's a plot twist, go check cpu_model for the real answer)
🫢 important lil note bestie: you can only read this variable after you've called check_cpu() β€” and good news, allegro_init() calls it for you automatically, so you don't even have to think about it. she's got you covered, no cap.

πŸ‘€ SEE ALSO πŸ‘€


and that's the whole page, bestie πŸ’œ this was Allegro version 4.4.3, dated way back, and the page itself is cpu_family(3alleg4) β€” k bye, go read check_cpu(3alleg4) next, mwah πŸŽ€βœ¨