Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve GUI for HiDPI screens #271

Closed
sa666666 opened this issue Dec 18, 2017 · 4 comments
Closed

Improve GUI for HiDPI screens #271

sa666666 opened this issue Dec 18, 2017 · 4 comments
Assignees
Labels
Milestone

Comments

@sa666666
Copy link
Member

OK, so I got a 4K monitor for myself for Christmas, and in Linux at least, the window is minicule. It's a little better in Windows, but then the output is blurry. I think we need to add an option to essentially tell the UI to 'double' its size when enabled.

This should be relatively easy, since the dialogs are stored as textures anyway, so we simply need to change the output coordinates to stretch the texture. It happens automatically in emulation mode; the TIA image is actually only 160x210 pixels or so, but it can fill a 4K monitor when you turn up the zoom level.

Stella once had the ability to scale the UI in a similar fashion. I need to look into it again.

@sa666666 sa666666 self-assigned this Dec 18, 2017
@thrust26 thrust26 added this to the Prio 2 milestone Dec 18, 2017
@thrust26
Copy link
Member

Hmm... do you want to stretch the Stella UI output (e.g. using SDL) or to double the UI output itself? The latter will cause more CPU load.

@sa666666
Copy link
Member Author

sa666666 commented Dec 18, 2017

The stretching is done by SDL, which in turn is using hardware. Everything in Stella is a texture at some point, both the TIA output and the UI itself (ie, all dialog boxes). They already have the concept of 'src' rects and 'dst' rects. The source rect defines where in the surface to get data from. The dest rect maps that src area to output.

In the case of the TIA emulation output, the src and dst are different (aka, free scaling). Currently in the case of the UI, the src and dst size are always the same, so we get 1-to-1 mapping of output. I suggest adding a 'hidpi' option that enables to map UI to 1-to-2, so that the UI is essentially doubled in size. Note that this all happens as part of the output pipeline, and doesn't have any effect on the rest of the code.

Note that #158 still needs to be fixed, and might be exacerbated by this new mode. That issue determines how often something is drawn, but in this new mode nothing extra is being drawn; it is just scanned out at a larger size.

I already have some working code here, but will not commit/work on this until after 5.1. I needed to do it now, though, since otherwise I can't work on the ROM properties without being able to see the dialog boxes 😄

@sa666666
Copy link
Member Author

Some code has already been committed which fix issues with dialog boxes and overlaid messages (runtime statistics and error messages). Basically it amounts to using surface().dstRect() instead of width() and height() to properly position UI elements.

@thrust26 thrust26 added the target 6.0 Christmas 2018 Release label Jan 15, 2018
@sa666666 sa666666 added target 6.1 2020-03 Release and removed target 6.0 Christmas 2018 Release labels Aug 6, 2018
@sa666666
Copy link
Member Author

Implemented in a few commits over the past week. There is still testing to do, but the main functionality is there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants