SDL_DRAWGPUINDEXEDPRIMITIVESINDIRECT(3)

πŸ’– SDL_DrawGPUIndexedPrimitivesIndirect β€” bestie edition πŸ’–

okay so this is a page from the SDL3 FUNCTIONS manual (yes, those SDL3 functions, the GPU ones, we love her) and we're gonna talk about SDL_DrawGPUIndexedPrimitivesIndirect. sit down, grab a strawberry, this one's actually kinda iconic.


✨ NAME ✨

SDL_DrawGPUIndexedPrimitivesIndirect β€” draws data using bound graphics state with an index buffer enabled and with draw parameters set from a buffer. πŸ’…

like… it draws. with indices. and the parameters come from a buffer instead of from you yelling numbers at the function directly. main character energy fr fr.


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_gpu.h>

void SDL_DrawGPUIndexedPrimitivesIndirect(
    SDL_GPURenderPass *render_pass,
    SDL_GPUBuffer *buffer,
    Uint32 offset,
    Uint32 draw_count);

not me showing up with the #include <SDL3/SDL_gpu.h> like it's a little invite to the function party πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so the tea: the buffer you pass in must consist of tightly-packed draw parameter sets, and each one of those sets has to match the layout of SDL_GPUIndexedIndirectDrawCommand. that's not optional, bestie, that's the whole vibe. πŸ’–

and lowkey the most important part: you must not call this function before binding a graphics pipeline. like, do not. bind the pipeline first. no cap. πŸ™ˆ

⚠️ seriously, pipeline first, function second. the order is the moment.

πŸ’œ FUNCTION PARAMETERS πŸ’œ

  • render_pass β€” a render pass handle. she's the whole arena, the stage, the venue. πŸŽ€
  • buffer β€” a buffer containing draw parameters. the little box of numbers. ✨
  • offset β€” the offset to start reading from the draw buffer. where you start scrolling, basically. πŸ¦‹
  • draw_count β€” the number of draw parameter sets that should be read from the draw buffer. how many lil sets we're pulling out. πŸ’…

⭐ AVAILABILITY ⭐

this function is available since SDL 3.2.0. so if you're on something older… bestie. update. 😭


and that's the whole page!! every flag, every parameter, every vibe, preserved. you're welcome. 🫢

kisses, from the Simple Directmedia Layer manual β€” SDL 3.4.18 β€” slay, periodt, go bind that pipeline πŸ‘‘πŸ’–

πŸ“¦ where this page comes from