Scroll to navigation

SDL_GetDisplayContentScale(3) SDL3 FUNCTIONS SDL_GetDisplayContentScale(3)

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.

FUNCTION PARAMETERS

the instance ID of the display to query

RETURN VALUE

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

SDL_GetError () for more details.

AVAILABILITY

This function is available since SDL 3.0.0.

SEE ALSO

SDL_GetDisplays(3)

SDL 3.1.2 Simple Directmedia Layer