SDL Wiki
(This is the legacy documentation for stable SDL2, the current stable version; SDL3 is the current development version.)

SDL_HINT_WINDOWS_DPI_AWARENESS

Controls whether SDL will declare the process to be DPI aware.

Header File

Defined in SDL_hints.h

Syntax

#define SDL_HINT_WINDOWS_DPI_AWARENESS "SDL_WINDOWS_DPI_AWARENESS"

Remarks

This hint must be set before initializing the video subsystem.

The main purpose of declaring DPI awareness is to disable OS bitmap scaling of SDL windows on monitors with a DPI scale factor.

This hint is equivalent to requesting DPI awareness via external means (e.g. calling SetProcessDpiAwarenessContext) and does not cause SDL to use a virtualized coordinate system, so it will generally give you 1 SDL coordinate = 1 pixel even on high-DPI displays.

For more information, see: https://docs.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows

This variable can be set to the following values:

If the requested DPI awareness is not available on the currently running OS, SDL will try to request the best available match.


CategoryAPI, CategoryAPIMacro


[ edit | delete | history | feedback | raw ]

[ front page | index | search | recent changes | git repo | offline html ]

All wiki content is licensed under Creative Commons Attribution 4.0 International (CC BY 4.0).
Wiki powered by ghwikipp.