This is new wiki software and old wiki content. It's a work in progress!
Here's the explanation.
Be gentle, report bugs, leave feedback on pages, or just edit them yourself! Thanks!

SDL Wiki


THIS PAGE IS A WORK IN PROGRESS ... Please make edits to this page to improve it!


Get the dots/pixels-per-inch for a display.


int SDL_GetDisplayDPI(int displayIndex, float * ddpi, float * hdpi, float * vdpi);

Function Parameters


the index of the display from which DPI information should be queried


a pointer filled in with the diagonal DPI of the display; may be NULL


a pointer filled in with the horizontal DPI of the display; may be NULL


a pointer filled in with the vertical DPI of the display; may be NULL

Return Value

Returns 0 on success or a negative error code on failure; call SDL_GetError() for more information.


Diagonal, horizontal and vertical DPI can all be optionally returned if the appropriate parameter is non-NULL.

A failure of this function usually means that either no DPI information is available or the displayIndex is out of range.


This function is available since SDL 2.0.4.


CategoryAPI, CategoryVideo, CategoryDraft

[ 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.