---
name: "SDL_GetPixelFormatDetails"
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_GetPixelFormatDetails"
---

# SDL\_GetPixelFormatDetails(3)

Create an SDL\_PixelFormatDetails structure corresponding to a pixel format.

## NAME

SDL\_GetPixelFormatDetails - Create an  **SDL\_PixelFormatDetails**\
  structure corresponding to a pixel format.

## HEADER FILE

Defined in SDL3/SDL\_pixels.h

## SYNOPSIS

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

**const SDL\_PixelFormatDetails \* SDL\_GetPixelFormatDetails(SDL\_PixelFormat format);**

## DESCRIPTION

Returned structure may come from a shared global cache (i.e. not newly allocated), and hence should not be modified, especially the palette. Weird errors such as **Blit**combination**not**supported may occur.

## FUNCTION PARAMETERS

- *format*

  one of the  **SDL\_PixelFormat**\
    values.

## RETURN VALUE

(const  **SDL\_PixelFormatDetails**\
  \*) Returns a pointer to a  **SDL\_PixelFormatDetails**\
  structure or NULL on failure; call  **SDL\_GetError** () for more information.

## THREAD SAFETY

It is safe to call this function from any thread.

## AVAILABILITY

This function is available since SDL 3.2.0.
