pythonwindowspyglet

How to ignore UI scaling in Pyglet window?


On my laptop, the interface scale is 125%. The maximum resolution of the monitor is 1920x1080, and I work with it.

While creating the Pyglet application window, with a resolution of 1280x720, I noticed that the window is clearly larger than what I expected. Having changed the resolution to the maximum one available to me - 1920x1080, using the second monitor, I realized that it is clearly larger than the main monitor.

For a long time and painfully, I figured out the cause of the problem, but found it out. When I set the interface scaling to 100%, instead of 125% that was comfortable for me, everything fell into place. The windows began to work as intended.

But this is not the way to solve the problem. Therefore, I have come to you with a question. How do I ignore the zoomed-in laptop interface in my application? Also, an alternative solution could be to change the scale of the interface while the application is running. How can I implement one of the solutions?


Solution

  • I should have guessed that the same problem could be with Pygame. Solution:

    import ctypes
    ctypes.windll.user32.SetProcessDPIAware()
    

    https://gamedev.stackexchange.com/questions/105750/pygame-fullsreen-display-issue