al_draw_indexed_buffer(3)
β¨ NAME β¨
al_draw_indexed_buffer β Allegro 5 API. This is the al_draw_indexed_buffer(3) page from the Library Functions Manual, bestie, and it's all about drawing an indexed slice of a vertex buffer without losing your mind π
.
π 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 π¦
Okay so al_draw_indexed_buffer draws a subset of the passed vertex buffer. It uses an index buffer to specify which vertices to use. Both buffers must not be locked. No cap, that part is serious. Additionally, to draw onto memory bitmaps or with memory bitmap textures, both buffers must support reading β meaning they must be created with ALLEGRO_PRIM_BUFFER_READWRITE. Literally required, bestie π«Ά.
Parameters are giving main-character energy:
vertex_bufferβ the vertex buffer to draw.textureβ the texture to use; passNULLto use only color-shaded primitives.index_bufferβ the index buffer to use.startβ start index of the subset of the index buffer to draw.endβ one past the last index of the subset of the index buffer to draw.typeβ a member of theALLEGRO_PRIM_TYPE(3)enumeration, specifying what kind of primitive to draw. Note thatALLEGRO_PRIM_LINE_LOOPandALLEGRO_PRIM_POINT_LISTare not supported β don't even try it π.
Returns: Number of primitives drawn π₯.
π¨ Quick vibe check: both buffers must not be locked. Locked buffers are a no-go for this function, periodt.
π SINCE π
5.1.8 β she's been around since 5.1.8, iconic π.
π SEE ALSO π
Sign-off: this page lives in the Allegro reference manual β no version or date stamped in the footer, just pure Allegro reference manual energy π«Άβ¨.
π¦ where this page comes from
- arch rolling: allegro 5.2.11.3-2 Β· Zlib AND BSD-3-Clause AND OFL-1.1 AND LicenseRef-Custom
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms