---
name: "SDL_GetDisplayContentScale"
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_GetDisplayContentScale"
---

# SDL\_GetDisplayContentScale(3)

Get the content scale of a display.

## NAME

SDL\_GetDisplayContentScale - Get the content scale of a display.

## HEADER FILE

Defined in SDL3/SDL\_video.h

## SYNOPSIS

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

**float SDL\_GetDisplayContentScale(SDL\_DisplayID displayID);**

## DESCRIPTION

The content scale is the expected scale for content based on the DPI settings of the display. For example, a 4K display might have a 2.0 (200%) display scale, which means that the user expects UI elements to be twice as big on this display, to aid in readability.

After window creation,

**SDL\_GetWindowDisplayScale** () should be used to query the content scale factor for individual windows instead of querying the display for a window and calling this function, as the per-window content scale factor may differ from the base value of the display it is on, particularly on high-DPI and/or multi-monitor desktop configurations.

## FUNCTION PARAMETERS

- *displayID*

  the instance ID of the display to query.

## RETURN VALUE

Returns the content scale of the display, or 0.0f on failure; call

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

## THREAD SAFETY

This function should only be called on the main thread.

## AVAILABILITY

This function is available since SDL 3.2.0.

## SEE ALSO

**•**(3), [**SDL\_GetWindowDisplayScale**(3)](/SDL_GetWindowDisplayScale/3.md), **•**(3), [**SDL\_GetDisplays**(3)](/SDL_GetDisplays/3.md)
