Skip to content
modkitv0.2

Cross-platform HiDPI and content-scale demonstration

← All examples13_hidpi

SDL platforms expose two related scales: - Pixel density maps native window coordinates to backbuffer pixels. - Display scale describes how large portable UI content should appear. mk_get_window_ui_scale() combines them into the multiplier used to convert portable UI/design units to native window coordinates. This matters on Windows, Android, and X11, where window coordinates are physical pixels.

Cross-platform HiDPI and content-scale demonstration

Runs the WebAssembly build on this page. Click the canvas to give it keyboard focus.

Number
13
Tags
2dvector
Source
examples/13_hidpi/main.c

Build and run

./scripts/build-linux.sh release --target=13_hidpi --run