sdlWindowSupportsGpuSwapchainComposition function

bool sdlWindowSupportsGpuSwapchainComposition(
  1. Pointer<SdlGpuDevice> device,
  2. Pointer<SdlWindow> window,
  3. int swapchainComposition
)

Determines whether a swapchain composition is supported by the window.

The window must be claimed before calling this function.

\param device a GPU context. \param window an SDL_Window. \param swapchain_composition the swapchain composition to check. \returns true if supported, false if unsupported.

\since This function is available since SDL 3.1.3.

\sa SDL_ClaimWindowForGPUDevice

extern SDL_DECLSPEC bool SDLCALL SDL_WindowSupportsGPUSwapchainComposition( SDL_GPUDevice *device, SDL_Window *window, SDL_GPUSwapchainComposition swapchain_composition)

Implementation

bool sdlWindowSupportsGpuSwapchainComposition(Pointer<SdlGpuDevice> device,
    Pointer<SdlWindow> window, int swapchainComposition) {
  final sdlWindowSupportsGpuSwapchainCompositionLookupFunction =
      libSdl3.lookupFunction<
              Uint8 Function(Pointer<SdlGpuDevice> device,
                  Pointer<SdlWindow> window, Int32 swapchainComposition),
              int Function(Pointer<SdlGpuDevice> device,
                  Pointer<SdlWindow> window, int swapchainComposition)>(
          'SDL_WindowSupportsGPUSwapchainComposition');
  return sdlWindowSupportsGpuSwapchainCompositionLookupFunction(
          device, window, swapchainComposition) ==
      1;
}