cpu_model(3alleg4)
π cpu_model β the Intel CPU submodel, bestie π
okay so this is a page from the Allegro game programming library manual, section 3alleg4, and it's all about one lil global variable that tells you exactly which flavor of CPU you're running on. no cap. π§β¨
β¨ SYNOPSIS β¨
#include <allegro.h>
extern int cpu_model;
πΈ DESCRIPTION πΈ
so cpu_model holds the CPU submodel, where applicable. that's it, that's the vibe. π
Allegro defines at least these CPU family types (and if you want the full tea, go peek at include/allegro/system.h for a more complete list π):
CPU_FAMILY_I586:CPU_MODEL_PENTIUM,CPU_MODEL_K5,CPU_MODEL_K6
CPU_FAMILY_I686:CPU_MODEL_PENTIUMPRO,CPU_MODEL_PENTIUMII,CPU_MODEL_PENTIUMIIIKATMAI,CPU_MODEL_PENTIUMIIICOPPERMINE,CPU_MODEL_ATHLON,CPU_MODEL_DURON
CPU_FAMILY_EXTENDED:CPU_MODEL_PENTIUMIV,CPU_MODEL_XEON,CPU_MODEL_ATHLON64,CPU_MODEL_OPTERON
CPU_FAMILY_POWERPC:CPU_MODEL_POWERPC_x, for x=601-604, 620, 750, 7400, 7450
π«Ά real talk though: you can only read this variable after you've calledcheck_cpu()β which, good news, gets called automatically byallegro_init(). so if you skippedallegro_init()you're gonna have a bad time, bestie. π
also make sure you check cpu_family and cpu_vendor first, so you actually know which models make sense to check. it's giving "read the room before you read the variable" fr fr. π
π SEE ALSO π
check_cpu(3alleg4)cpu_vendor(3alleg4)cpu_family(3alleg4)cpu_capabilities(3alleg4)allegro_init(3alleg4)
and that's the whole page, periodt. π this little baddie shipped with Allegro, version 4.4.3 β iconic behavior honestly, we stan a stable release. πππ¦
π¦ where this page comes from
- debian bookworm: allegro4-doc 2:4.4.3.1-3 Β· Allegro-gift-ware
- debian trixie: allegro4-doc 2:4.4.3.1-5 Β· Allegro-gift-ware
- ubuntu jammy: allegro4-doc 2:4.4.3.1-2 Β· Allegro-gift-ware
- ubuntu noble: allegro4-doc 2:4.4.3.1-4.1build3 Β· Allegro-gift-ware
- ubuntu questing: allegro4-doc 2:4.4.3.1-6
- ubuntu resolute: allegro4-doc 2:4.4.3.1-7 Β· Allegro-gift-ware
- ubuntu stonking: allegro4-doc 2:4.4.3.1-9 Β· Allegro-gift-ware
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms