sdlCancelGpuCommandBuffer function

bool sdlCancelGpuCommandBuffer(
  1. Pointer<SdlGpuCommandBuffer> commandBuffer
)

Cancels a command buffer.

None of the enqueued commands are executed.

It is an error to call this function after a swapchain texture has been acquired.

This must be called from the thread the command buffer was acquired on.

You must not reference the command buffer after calling this function.

\param command_buffer a command buffer. \returns true on success, false on error; call SDL_GetError() for more information.

\since This function is available since SDL 3.1.6.

\sa SDL_WaitAndAcquireGPUSwapchainTexture \sa SDL_AcquireGPUCommandBuffer \sa SDL_AcquireGPUSwapchainTexture

extern SDL_DECLSPEC bool SDLCALL SDL_CancelGPUCommandBuffer( SDL_GPUCommandBuffer *command_buffer)

Implementation

bool sdlCancelGpuCommandBuffer(Pointer<SdlGpuCommandBuffer> commandBuffer) {
  final sdlCancelGpuCommandBufferLookupFunction = libSdl3.lookupFunction<
          Uint8 Function(Pointer<SdlGpuCommandBuffer> commandBuffer),
          int Function(Pointer<SdlGpuCommandBuffer> commandBuffer)>(
      'SDL_CancelGPUCommandBuffer');
  return sdlCancelGpuCommandBufferLookupFunction(commandBuffer) == 1;
}