Pygame DPI Aware -- No Stretch!

Опубликовано: 01 Июль 2025
на канале: veganaiZe
526
like

Stop pygame window from scaling / enlarging beyond requested dimensions on high DPI displays in Windows Vista, 7, 8, 8.1, 10, 11.

Regardless of the display resolution, if a user has chosen to make text and other items on the desktop larger, then your game window will appear stretched and blurry. This quick overview will show you how to prevent stretching so your game screen will be the correct size.

High DPI Desktop Application Development on Windows:
https://docs.microsoft.com/en-us/wind...

SetProcessDPIAware function (winuser.h):
https://docs.microsoft.com/en-us/wind...