SDL_GPUBufferBinding(3type)

πŸ’– SDL_GPUBufferBinding πŸ’–

okay bestie, welcome to the SDL3 DATATYPES corner of the man pages, this one is literally called SDL_GPUBufferBinding(3type) and it's short, sweet, and iconic.


✨ NAME ✨

SDL_GPUBufferBinding β€” it's a struct that holds the parameters you pass in a buffer binding call. that's the whole vibe. no cap.


🌸 SYNOPSIS 🌸

#include <SDL3/SDL_gpu.h>

typedef struct SDL_GPUBufferBinding
{
    SDL_GPUBuffer *buffer;  /**< The buffer to bind. Must have been created with SDL_GPU_BUFFERUSAGE_VERTEX for SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX for SDL_BindGPUIndexBuffer. */
    Uint32 offset;          /**< The starting byte of the data to bind in the buffer. */
} SDL_GPUBufferBinding;

πŸ¦‹ DESCRIPTION πŸ¦‹

so like, this is the little bundle of info you hand over when you're binding a buffer. two fields, both serving, both necessary:

  • buffer β€” the actual SDL_GPUBuffer * you wanna bind. 🫢 and listen, this is the important part: it must have been created with SDL_GPU_BUFFERUSAGE_VERTEX if you're using it with SDL_BindGPUVertexBuffers, or SDL_GPU_BUFFERUSAGE_INDEX if you're using it with SDL_BindGPUIndexBuffer. like, the usage flag has to match the call, it's giving matching outfits, you can't just mix and match. πŸ‘‘
  • offset β€” a Uint32, and it's the starting byte of the data to bind inside that buffer. so if you don't wanna bind from the very beginning, this is your moment. ✨

πŸ’… AVAILABILITY πŸ’…

this struct has been around since SDL 3.2.0. so if you're on something older… bestie. upgrade. 😭


πŸŽ€ SEE ALSO πŸŽ€


and that's the whole page, you ate that. this lil baddie comes to you courtesy of Simple Directmedia Layer, version SDL 3.4.18, and it's filed under SDL_GPUBufferBinding(3type) β€” mwah, go bind some buffers, queen. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ

πŸ“¦ where this page comes from