ALLEGRO_VERTEX(3alleg5)

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

πŸ’– NAME πŸ’–

ALLEGRO_VERTEX β€” ok so this is the Allegro 5 API page for the generic vertex struct, bestie, and it's lowkey the whole blueprint for how one single point in your primitives gets described. πŸŽ€


✨ SYNOPSIS ✨

#include <allegro5/allegro_primitives.h>

typedef struct ALLEGRO_VERTEX ALLEGRO_VERTEX;

🌸 DESCRIPTION 🌸

So like, this defines the generic vertex type β€” the vibe is: a 3D position, a color, and texture coordinates for a single texture. That's the whole glow-up package. πŸ¦‹

Heads up though: at this time, the software driver for this addon cannot render 3D primitives. Not a drill, just a fact. 😭

If you're only doing 2D primitives, just set z to 0 and you're slaying. πŸ’…

Also, super important: you must initialize all members of this struct when you're using it. Like, all of them. No half-effort. One single exception to that rule β€” the u and v variables, which can be left uninitialized when you are not using textures. Iconic loophole, honestly. ✨

Fields, aka the cast of characters: πŸ‘‘

  • x, y, z β€” Position of the vertex (float)
  • u, v β€” Texture coordinates measured in pixels (float)
  • color β€” ALLEGRO_COLOR(3alleg5) structure, storing the color of the vertex

🌈 SEE ALSO 🌈


k bye bestie, go initialize your structs πŸ’œ β€” this has been your girl from the Allegro reference manual, ALLEGRO_VERTEX(3alleg5), aka manual 3alleg5. fr fr, no cap. 🫢🌸

πŸ“¦ where this page comes from