al_lock_index_buffer(3alleg5)

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

πŸ’– al_lock_index_buffer πŸ’–

hey bestie!! so this is a page straight out of the Allegro 5 API manual, and today's main character is al_lock_index_buffer. she's giving gatekeeper energy but in a good way β€” she opens the door to your index buffer's data. πŸ”‘


✨ NAME ✨

al_lock_index_buffer β€” the Allegro 5 API function that lets you get in there and touch your index buffer's data πŸ’…


🌸 SYNOPSIS 🌸

#include <allegro5/allegro_primitives.h>

void* al_lock_index_buffer(ALLEGRO_INDEX_BUFFER* buffer, int offset,
    int length, int flags)

yes queen, that's the whole signature, copy it exactly, no cap. ✨


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so. locks a index buffer so you can access its data. that's the whole vibe. it's like putting a lil "occupied 🚫" sign on it so nobody else messes with it while you're in there doing your thing.

and the way that she'll return NULL β€” literally the void, the nothing, the ghosting πŸ’€ β€” happens in exactly three situations:

  • when the parameters are invalid πŸ™ˆ
  • when reading is requested from a write only buffer (bestie you can't read what was never meant to be read, that's not your lane) 😭
  • when the buffer is already locked (it's taken!! back off!!) πŸ”’

πŸŽ€ Parameters πŸŽ€

  • buffer β€” the index buffer you wanna lock πŸ’œ
  • offset β€” element index of the start of the locked range πŸ“
  • length β€” how many indices to lock πŸ”’
  • flags β€” one of these three icons, pick wisely:
    • ALLEGRO_LOCK_READONLY
    • ALLEGRO_LOCK_WRITEONLY
    • ALLEGRO_LOCK_READWRITE

choose your fighter, but like, literally, one of these three. ⭐


⭐ SINCE ⭐

5.1.8 β€” been iconic since day one (day one being 5.1.8). πŸ‘‘


🌈 SEE ALSO 🌈

go read those too, they're the supporting cast and they ate. 🫢


and that's the whole page!! mwah πŸ’‹ this was the Allegro reference manual, covering al_lock_index_buffer(3alleg5) β€” sending you off with love, stay locked (the good kind), and don't forget to unlock when you're done bestie!! πŸ§šβœ¨πŸŽ€πŸ“πŸ’–

πŸ“¦ where this page comes from