---
name: "SDL_CreateGPUDevice"
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_CreateGPUDevice"
---

# SDL\_CreateGPUDevice(3)

Creates a GPU context.

## NAME

SDL\_CreateGPUDevice - Creates a GPU context.

## HEADER FILE

Defined in SDL3/SDL\_gpu.h

## SYNOPSIS

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

**SDL\_GPUDevice \* SDL\_CreateGPUDevice(**     **SDL\_GPUShaderFormat format\_flags,**     **bool debug\_mode,**     **const char \*name);**

## FUNCTION PARAMETERS

- *format\_flags*

  a bitflag indicating which shader formats the app is able to provide.

- *debug\_mode*

  enable debug mode properties and validations.

- *name*

  the preferred GPU driver, or NULL to let SDL pick the optimal driver.

## RETURN VALUE

( **SDL\_GPUDevice**\
  \*) Returns a GPU context on success or NULL on failure; call  **SDL\_GetError** () for more information.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_GetGPUShaderFormats**(3)](/SDL_GetGPUShaderFormats/3.md), **•**(3), [**SDL\_GetGPUDeviceDriver**(3)](/SDL_GetGPUDeviceDriver/3.md), **•**(3), [**SDL\_DestroyGPUDevice**(3)](/SDL_DestroyGPUDevice/3.md), **•**(3), [**SDL\_GPUSupportsShaderFormats**(3)](/SDL_GPUSupportsShaderFormats/3.md)
