al_draw_indexed_buffer(3)

πŸ“¦
version 5.2.11.3 Β· 3 versions
, in arch rolling

✨ 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; pass NULL to 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 the ALLEGRO_PRIM_TYPE(3) enumeration, specifying what kind of primitive to draw. Note that ALLEGRO_PRIM_LINE_LOOP and ALLEGRO_PRIM_POINT_LIST are 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