---
name: "SDL_ClaimWindowForGPUDevice"
section: "3"
platform: "linux"
package: "libsdl3-doc"
version: "3.2.10+ds-1"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/SDL_ClaimWindowForGPUDevice"
---

# SDL\_ClaimWindowForGPUDevice(3)

Claims a window, creating a swapchain structure for it.

## NAME

SDL\_ClaimWindowForGPUDevice - Claims a window, creating a swapchain structure for it.

## HEADER FILE

Defined in SDL3/SDL\_gpu.h

## SYNOPSIS

```
#include "SDL3/SDL.h"
```

**bool SDL\_ClaimWindowForGPUDevice(**     **SDL\_GPUDevice \*device,**     **SDL\_Window \*window);**

## DESCRIPTION

This must be called before

**SDL\_AcquireGPUSwapchainTexture**\
  is called using the window. You should only call this function from the thread that created the window.

The swapchain will be created with

**SDL\_GPU\_SWAPCHAINCOMPOSITION\_SDR**\
  and

**SDL\_GPU\_PRESENTMODE\_VSYNC** . If you want to have different swapchain parameters, you must call

**SDL\_SetGPUSwapchainParameters**\
  after claiming the window.

## FUNCTION PARAMETERS

- *device*

  a GPU context.

- *window*

  an  **SDL\_Window** .

## RETURN VALUE

Returns true on success, or false on failure; call

**SDL\_GetError** () for more information.

## THREAD SAFETY

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

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_WaitAndAcquireGPUSwapchainTexture**(3)](/SDL_WaitAndAcquireGPUSwapchainTexture/3.md), **•**(3), [**SDL\_ReleaseWindowFromGPUDevice**(3)](/SDL_ReleaseWindowFromGPUDevice/3.md), **•**(3), [**SDL\_WindowSupportsGPUPresentMode**(3)](/SDL_WindowSupportsGPUPresentMode/3.md), **•**(3), [**SDL\_WindowSupportsGPUSwapchainComposition**(3)](/SDL_WindowSupportsGPUSwapchainComposition/3.md)
