---
name: "SDL_CreateGPUSampler"
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_CreateGPUSampler"
---

# SDL\_CreateGPUSampler(3)

Creates a sampler object to be used when binding textures in a graphics workflow.

## NAME

SDL\_CreateGPUSampler - Creates a sampler object to be used when binding textures in a graphics workflow.

## HEADER FILE

Defined in SDL3/SDL\_gpu.h

## SYNOPSIS

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

**SDL\_GPUSampler \* SDL\_CreateGPUSampler(**     **SDL\_GPUDevice \*device,**     **const SDL\_GPUSamplerCreateInfo \*createinfo);**

## DESCRIPTION

There are optional properties that can be provided through **props** . These are the supported properties:

•  **SDL\_PROP\_GPU\_SAMPLER\_CREATE\_NAME\_STRING** :\
   a name that can be displayed in debugging tools.

## FUNCTION PARAMETERS

- *device*

  a GPU Context.

- *createinfo*

  a struct describing the state of the sampler to create.

## RETURN VALUE

( **SDL\_GPUSampler**\
  \*) Returns a sampler object 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\_BindGPUVertexSamplers**(3)](/SDL_BindGPUVertexSamplers/3.md), **•**(3), [**SDL\_BindGPUFragmentSamplers**(3)](/SDL_BindGPUFragmentSamplers/3.md), **•**(3), [**SDL\_ReleaseGPUSampler**(3)](/SDL_ReleaseGPUSampler/3.md)
