What is the different between SDL_GetWindowDisplayScale and SDL_GetWindowPixelDensity?
02:29 07 Jan 2026

I have read their documents, but don't quite understand it, i.e. at which circumstance these two values may be different?

Actually, in my Debian desktop running X window and mate desktop, SDL_GetWindowPixelDensity gives 1.0, but SDL_GetWindowDisplayScale gives 0.979166687 which really out of my expectation. How does this different occur?

According to the document, the SDL_GetWindowDisplayScale gives you a combination of the window pixel density and the display content scale, so how does the referred display content scale being set?

More practically, in a specific window, which value should I use to convert between logical coordinates (for widgets) and physical pixel position?

highdpi sdl-3