Opened 6 years ago

Last modified 8 months ago

#2349 new enhancement

[PATCH] Add support for Hi-DPI displays

Reported by: julian37 Owned by:
Priority: Nice to Have Milestone: Work In Progress
Component: Core engine Keywords: patch, review
Cc: Ilya Ryzhenkov, hal9000 Patch:

Description (last modified by stanislas69)

It would be nice if 0 A.D. could take advantage of Hi-DPI displays, such as Apple's Retina displays.

As far as I can tell, this requires the following:

  • Upgrading to SDL2, which adds the SDL_WINDOW_ALLOW_HIGHDPI flag
  • Ensuring the GUI remains at the original size (i.e. magnifying it by 2x with respect to 3D graphics)

And the following are nice-to-haves:

  • Doubling the resolution of the prerendered fonts for crisp text rendering
  • Providing all bitmap graphics in double the resolution (seeing that 4K displays are on the horizon, perhaps new bitmaps graphics should be prepared at 4x the resolution)

I've attached a simple-minded patch for the first issue (SDL2 support) to ticket #2041, and I've prepared a patch to address issues 2 and 3 (scaled-up GUI and high-res fonts), will attach it shortly.

Attachments (3)

hidpi.patch (6.3 KB) - added by historic_bruno 4 years ago.
patch by orangy from #3692
highdpi2.patch (8.7 KB) - added by wraitii 3 years ago.
#2349.3.diff (89.6 KB) - added by stanislas69 2 years ago.
Add back the default.cfg changes.

Download all attachments as: .zip

Change History (19)

comment:1 Changed 6 years ago by julian37

Description: modified (diff)

comment:2 Changed 5 years ago by historic_bruno

SDL2 support has been merged into SVN. It's not yet the default for OS X, but will be for A17 and this task can be worked on.

comment:3 Changed 5 years ago by historic_bruno

r16223 added a GUI scaling option.

comment:4 Changed 5 years ago by historic_bruno

Description: modified (diff)

Changed 4 years ago by historic_bruno

Attachment: hidpi.patch added

patch by orangy from #3692

comment:5 Changed 4 years ago by historic_bruno

Cc: Ilya Ryzhenkov added

#3692 was a duplicate, I moved the patch here.

comment:6 Changed 4 years ago by historic_bruno

Keywords: patch review added
Milestone: BacklogAlpha 20
Summary: Add support for Hi-DPI displays[PATCH] Add support for Hi-DPI displays

comment:7 Changed 4 years ago by Itms

Milestone: Alpha 20Alpha 21

comment:8 Changed 3 years ago by Itms

Keywords: rfc added; review removed

Move tickets from the review queue to the rfc one.

comment:9 Changed 3 years ago by Moul

I am using a HiDPI screen almost 4K and 13': It not very good to play with it. Here a screenshot with current SVN version a21: http://pix.toile-libre.org/upload/original/1473526126.png

comment:10 Changed 3 years ago by fabio

Hi, to scale the GUI see here.

comment:11 Changed 3 years ago by Vladislav Belov

Milestone: Alpha 21Alpha 22

Too few time remaining for A21 release.

comment:12 Changed 3 years ago by wraitii

Keywords: review added; rfc removed

Attached patch is rebased, fixed, and I added a config flag to enable/disable it. The problem is that high DPI is excruciatingly slow on my system, and I suspect it would be similar or many other people.

It would be great if the renderer could have a resolution independent from the screen/GUI resolution, i.e. render the GUI at retina resolution and then renderer at non-retina, but that would require us to decouple the renderer resolution and it's not that easy and probably requires using frame buffers all the time and I don't believe we want to support that now.

Changed 3 years ago by wraitii

Attachment: highdpi2.patch added

comment:13 Changed 3 years ago by elexis

Milestone: Alpha 22Work In Progress

Moving to the new WIP milestone.

comment:14 Changed 2 years ago by stanislas69

Description: modified (diff)

Use c++ casts as c casts are not tested on compile time.

Changed 2 years ago by stanislas69

Attachment: #2349.3.diff added

Add back the default.cfg changes.

comment:15 Changed 9 months ago by hal9000

Cc: hal9000 added
Note: See TracTickets for help on using tickets.