ALLEGRO_PRIM_STORAGE(3alleg5)
β¨ ALLEGRO_PRIM_STORAGE β¨
okay bestie, welcome to the Allegro 5 API</> manual page for ALLEGRO_PRIM_STORAGE π this is a glow-up guide to how vertex attribute storage works, and honestly? it's giving very niche but very important π
πΈ SYNOPSIS πΈ
#include <allegro5/allegro_primitives.h>
typedef enum ALLEGRO_PRIM_STORAGE
π¦ DESCRIPTION π¦
So basically this enum lists all the types of storage</> that an attribute of a custom vertex can live in πΎ. Heads up though β a lot of these can only be used for ALLEGRO_PRIM_USER_ATTR attributes, and you can only get at them through shaders π§. And usually, no matter which storage you pick, the attribute gets converted to single precision floating point when the shader runs. lowkey unavoidable.
But here's the tea β: even with that conversion happening, it can still be worth using denser storage formats β like ALLEGRO_PRIM_NORMALIZED_UBYTE_4 instead of ALLEGRO_PRIM_FLOAT_4 β when bandwidth</> (aka the amount of memory sent to the GPU) is the problem, but precision isn't π«Ά. slay.
ALLEGRO_PRIM_FLOAT_1β a single float π
Since: 5.1.6
ALLEGRO_PRIM_FLOAT_2β a doublet of floatsALLEGRO_PRIM_FLOAT_3β a triplet of floatsALLEGRO_PRIM_FLOAT_4β a quad of floats π
Since: 5.1.6
ALLEGRO_PRIM_SHORT_2β a doublet of shortsALLEGRO_PRIM_SHORT_4β a quad of shorts π
Since: 5.1.6
ALLEGRO_PRIM_UBYTE_4β a quad of unsigned bytes π
Since: 5.1.6
ALLEGRO_PRIM_NORMALIZED_SHORT_2β a doublet of shorts. before being sent to the shader, each component gets divided by32767β¨. each component of the resultant float doublet ranges between-1.0and1.0
Since: 5.1.6
ALLEGRO_PRIM_NORMALIZED_SHORT_4β a quad of shorts. before being sent to the shader, each component gets divided by32767β¨. each component of the resultant float quad ranges between-1.0and1.0
Since: 5.1.6
ALLEGRO_PRIM_NORMALIZED_UBYTE_4β a quad of unsigned bytes. before being sent to the shader, each component gets divided by255β¨. each component of the resultant float quad ranges between0.0and1.0
Since: 5.1.6
ALLEGRO_PRIM_NORMALIZED_USHORT_2β a doublet of unsigned shorts. before being sent to the shader, each component gets divided by65535β¨. each component of the resultant float doublet ranges between0.0and1.0
Since: 5.1.6
ALLEGRO_PRIM_NORMALIZED_USHORT_4β a quad of unsigned shorts. before being sent to the shader, each component gets divided by65535β¨. each component of the resultant float quad ranges between0.0and1.0
Since: 5.1.6
ALLEGRO_PRIM_HALF_FLOAT_2β a doublet of half-precision floats. β οΈ note that this storage format is not supported on all platforms.al_create_vertex_decl(3alleg5)will returnNULLif you use it on those platforms π
Since: 5.1.6
ALLEGRO_PRIM_HALF_FLOAT_4β a quad of half-precision floats. β οΈ note that this storage format is not supported on all platforms.al_create_vertex_decl(3alleg5)will returnNULLif you use it on those platforms π
Since: 5.1.6
π«Ά reminder bestie: thoseHALF_FLOATones are the risky queens β if your platform doesn't fw them,al_create_vertex_decl(3alleg5)hits you with aNULL. no cap.
π SEE ALSO π
and that's the whole page, bestie π</> this came straight out of the Allegro reference manual β ALLEGRO_PRIM_STORAGE(3alleg5) β go forth and declare your vertices with main character energy πβπ
π¦ where this page comes from
- debian trixie: allegro5-doc 2:5.2.10.1+dfsg-1 Β· Zlib
- ubuntu questing: allegro5-doc 2:5.2.10.1+dfsg-1build1
- ubuntu resolute: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- ubuntu stonking: allegro5-doc 2:5.2.11.3+dfsg-1 Β· Zlib
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms