Skip to content

cf_app_get_dpi_scale

Category: app
GitHub: cute_app.h


Returns the scaling factor for the device's intended DPI setting.

float cf_app_get_dpi_scale();

Remarks

On some devices (e.g. Apple Retina or iOS) pixels are clustered in 4x4 packs and abstracted as a single pixel called a "point". The intent is for applications to work in points, and scale their UI elements by a factor of 2x to aid in readability. These devices have very small pixels. Most of the time you should ignore dpi and let the OS handle this. CF enables DPI settings by default, but, you can see if this function returns 2.0f to let you know if pixels are clustered for you under the hood.

cf_app_set_size
cf_app_get_position
cf_app_set_position
cf_app_get_width
cf_app_get_height
cf_app_dpi_scale_was_changed