sdlSetGpuTextureName function

void sdlSetGpuTextureName(
  1. Pointer<SdlGpuDevice> device,
  2. Pointer<SdlGpuTexture> texture,
  3. String? text
)

Sets an arbitrary string constant to label a texture.

Useful for debugging.

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

\since This function is available since SDL 3.1.3.

extern SDL_DECLSPEC void SDLCALL SDL_SetGPUTextureName( SDL_GPUDevice *device, SDL_GPUTexture *texture, const char *text)

Implementation

void sdlSetGpuTextureName(Pointer<SdlGpuDevice> device,
    Pointer<SdlGpuTexture> texture, String? text) {
  final sdlSetGpuTextureNameLookupFunction = libSdl3.lookupFunction<
      Void Function(Pointer<SdlGpuDevice> device,
          Pointer<SdlGpuTexture> texture, Pointer<Utf8> text),
      void Function(
          Pointer<SdlGpuDevice> device,
          Pointer<SdlGpuTexture> texture,
          Pointer<Utf8> text)>('SDL_SetGPUTextureName');
  final textPointer = text != null ? text.toNativeUtf8() : nullptr;
  final result =
      sdlSetGpuTextureNameLookupFunction(device, texture, textPointer);
  calloc.free(textPointer);
  return result;
}