sdlWaitForGpuSwapchain function

bool sdlWaitForGpuSwapchain(
  1. Pointer<SdlGpuDevice> device,
  2. Pointer<SdlWindow> window
)

Blocks the thread until a swapchain texture is available to be acquired.

\param device a GPU context. \param window a window that has been claimed. \returns true on success, false on failure; call SDL_GetError() for more information.

\threadsafety This function should only be called from the thread that created the window.

\since This function is available since SDL 3.2.0.

\sa SDL_AcquireGPUSwapchainTexture \sa SDL_WaitAndAcquireGPUSwapchainTexture \sa SDL_SetGPUAllowedFramesInFlight

extern SDL_DECLSPEC bool SDLCALL SDL_WaitForGPUSwapchain( SDL_GPUDevice *device, SDL_Window *window)

Implementation

bool sdlWaitForGpuSwapchain(
    Pointer<SdlGpuDevice> device, Pointer<SdlWindow> window) {
  final sdlWaitForGpuSwapchainLookupFunction = libSdl3.lookupFunction<
      Uint8 Function(Pointer<SdlGpuDevice> device, Pointer<SdlWindow> window),
      int Function(Pointer<SdlGpuDevice> device,
          Pointer<SdlWindow> window)>('SDL_WaitForGPUSwapchain');
  return sdlWaitForGpuSwapchainLookupFunction(device, window) == 1;
}