sdlMapGpuTransferBuffer function gpu

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. The memory is owned by the graphics driver - do NOT call SDL_free() on the returned pointer.

\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.2.0.

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 = _libSdl
      .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,
  );
}