sdlSetGpuBufferName function

void sdlSetGpuBufferName(
  1. Pointer<SdlGpuDevice> device,
  2. Pointer<SdlGpuBuffer> buffer,
  3. String? text
)

Sets an arbitrary string constant to label a buffer.

Useful for debugging.

\param device a GPU Context. \param buffer a buffer to attach the name to. \param text a UTF-8 string constant to mark as the name of the buffer.

\since This function is available since SDL 3.1.3.

extern SDL_DECLSPEC void SDLCALL SDL_SetGPUBufferName( SDL_GPUDevice *device, SDL_GPUBuffer *buffer, const char *text)

Implementation

void sdlSetGpuBufferName(
    Pointer<SdlGpuDevice> device, Pointer<SdlGpuBuffer> buffer, String? text) {
  final sdlSetGpuBufferNameLookupFunction = libSdl3.lookupFunction<
      Void Function(Pointer<SdlGpuDevice> device, Pointer<SdlGpuBuffer> buffer,
          Pointer<Utf8> text),
      void Function(Pointer<SdlGpuDevice> device, Pointer<SdlGpuBuffer> buffer,
          Pointer<Utf8> text)>('SDL_SetGPUBufferName');
  final textPointer = text != null ? text.toNativeUtf8() : nullptr;
  final result = sdlSetGpuBufferNameLookupFunction(device, buffer, textPointer);
  calloc.free(textPointer);
  return result;
}