TLDR Web Dev · MISCELLANEOUS

YOUR MAC GAME IS PROBABLY RENDERING BLURRY

colincornaby.me8 min read

Summary from the TLDR Web Dev newsletter

Many Mac games on notched displays render blurry due to using the wrong resolution, drawing to the entire screen instead of the area below the notch. The `CGDisplayCopyAllDisplayModes` function returns resolutions for both the full display and the usable area under the menu bar, but games often default to the former, causing a compressed image. A solution is to filter the resolution list using `safeAreaInsets` to find resolutions fitting within the usable area.