al_draw_indexed_buffer(3alleg5)
al_draw_indexed_buffer π β¨
okay bestie, welcome to the Allegro 5 API β this one's from the allegro_primitives corner of the world, and it's lowkey iconic once you get it. let's go π«Ά
β¨ SYNOPSIS β¨
#include <allegro5/allegro_primitives.h>
int al_draw_indexed_buffer(ALLEGRO_VERTEX_BUFFER* vertex_buffer,
ALLEGRO_BITMAP* texture, ALLEGRO_INDEX_BUFFER* index_buffer,
int start, int end, int type)
πΈ DESCRIPTION πΈ
So what this does is it draws a subset of the vertex buffer you hand it β not the whole thing, just a lil slice. And the way it knows which vertices to actually use? An index buffer, bestie. That's the whole trick. π
Both buffers must not be locked. Not negotiable, fr fr.
And here's the tea: if you wanna draw onto memory bitmaps or use memory bitmap textures, then both buffers have to support reading. Which means they gotta be created with ALLEGRO_PRIM_BUFFER_READWRITE. No exceptions, periodt. π
π Parameters π
vertex_bufferβ the vertex buffer you're drawing. your main character. β¨textureβ the texture to use. passNULLif you only want color-shaded primitives (i.e. no texture at all, just vibes). πindex_bufferβ the index buffer to use. this is the one picking the vertices. πstartβ the start index of the subset of the index buffer you're drawing. where the slay begins. π¦endβ one past the last index of the subset of the index buffer to draw. yes, one past β classic C-style half-open thing, don't come for me. πtypeβ a member of theALLEGRO_PRIM_TYPE(3alleg5)enumeration, specifying what kind of primitive to draw. β
β οΈ heads up babes:ALLEGRO_PRIM_LINE_LOOPandALLEGRO_PRIM_POINT_LISTare not supported. not happening. pick something else. π
Returns: Number of primitives drawn π₯
π SINCE π
5.1.8
π§ SEE ALSO π§
and that's the whole page, bestie β straight from the Allegro reference manual, covering al_draw_indexed_buffer(3alleg5). go draw something gorgeous with it. mwah ππΈπ
π¦ 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