Advanced: Document how arcade handles hidpi (mouse and framebuffer)
Documentation request:
What documentation needs to change?
We will eventually need a new page explaining different strategies for handling high dpi screens.
Where is it located?
Does not exist yet
What is wrong with it? How can it be improved?
#1147 appears rooted in a lack of such documentation. Einarf's comment on the issue may be a good start for building this out.
High dpi is actually completely transparent for the user. It's not something they even have to think about.
Including for pixel games? My memory of macOS was that things frequently got weird, but i don't have a working retina mac to verify at the moment
Pyglet reports mouse positions in window coordinates for simplicity, so it's not going to be a problem here. We annotate them as ints and move on for now 😄
BUT ... it could acutally be a good idea to write a section a about high dpi stuff in advanced docs. It should include mouse coordinates and how we handle a window with pixel ratio != 1.0.
Let's keep this issue. I changed the title.
On Windows, I am using this ctypes hack on my main function:
# (...)
from os import name as os_name
def main():
"""Main function"""
if os_name == "nt": # Windows
import ctypes
ctypes.windll.shcore.SetProcessDpiAwareness(1)
ctypes.windll.user32.SetProcessDPIAware()
window = arcade.Window(SCREEN_WIDTH, SCREEN_HEIGHT, SCREEN_TITLE)
menu_view = MainMenu()
window.show_view(menu_view)
arcade.run()
if __name__ == "__main__":
main()
I do the same in tkinter apps.
On Windows, I am using this
ctypeshack on my main function:
You might just PR that in pyglet? https://github.com/pyglet/pyglet/blob/9727b43a48fab6b5ca65f4a951bb87616aaadb12/pyglet/font/win32.py