sdlMapGpuTransferBuffer function

Pointer<NativeType> sdlMapGpuTransferBuffer(
  1. Pointer<SdlGpuDevice> device,
  2. Pointer<SdlGpuTransferBuffer> transferBuffer,
  3. bool cycle
)

Maps a transfer buffer into application address space.

You must unmap the transfer buffer before encoding upload commands.

\param device a GPU context. \param transfer_buffer a transfer buffer. \param cycle if true, cycles the transfer buffer if it is already bound. \returns the address of the mapped transfer buffer memory, or NULL on failure; call SDL_GetError() for more information.

\since This function is available since SDL 3.1.3.

extern SDL_DECLSPEC void *SDLCALL SDL_MapGPUTransferBuffer( SDL_GPUDevice *device, SDL_GPUTransferBuffer *transfer_buffer, bool cycle)

Implementation

Pointer<NativeType> sdlMapGpuTransferBuffer(Pointer<SdlGpuDevice> device,
    Pointer<SdlGpuTransferBuffer> transferBuffer, bool cycle) {
  final sdlMapGpuTransferBufferLookupFunction = libSdl3.lookupFunction<
      Pointer<NativeType> Function(Pointer<SdlGpuDevice> device,
          Pointer<SdlGpuTransferBuffer> transferBuffer, Uint8 cycle),
      Pointer<NativeType> Function(
          Pointer<SdlGpuDevice> device,
          Pointer<SdlGpuTransferBuffer> transferBuffer,
          int cycle)>('SDL_MapGPUTransferBuffer');
  return sdlMapGpuTransferBufferLookupFunction(
      device, transferBuffer, cycle ? 1 : 0);
}