Opened 7 years ago

Last modified 2 days 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: Phab:D1925

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 5 years ago.
patch by orangy from #3692
highdpi2.patch (8.7 KB ) - added by wraitii 4 years ago.
#2349.3.diff (89.6 KB ) - added by stanislas69 3 years ago.
Add back the default.cfg changes.

Download all attachments as: .zip

Change History (20)

comment:1 by julian37, 7 years ago

Description: modified (diff)

comment:2 by historic_bruno, 6 years ago

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 by historic_bruno, 5 years ago

r16223 added a GUI scaling option.

comment:4 by historic_bruno, 5 years ago

Description: modified (diff)

by historic_bruno, 5 years ago

Attachment: hidpi.patch added

patch by orangy from #3692

comment:5 by historic_bruno, 5 years ago

Cc: Ilya Ryzhenkov added

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

comment:6 by historic_bruno, 5 years ago

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

comment:7 by Itms, 4 years ago

Milestone: Alpha 20Alpha 21

comment:8 by Itms, 4 years ago

Keywords: rfc added; review removed

Move tickets from the review queue to the rfc one.

comment:9 by Moul, 4 years ago

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:

comment:10 by fabio, 4 years ago

Hi, to scale the GUI see here.

comment:11 by Vladislav Belov, 4 years ago

Milestone: Alpha 21Alpha 22

Too few time remaining for A21 release.

comment:12 by wraitii, 4 years ago

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.

by wraitii, 4 years ago

Attachment: highdpi2.patch added

comment:13 by elexis, 4 years ago

Milestone: Alpha 22Work In Progress

Moving to the new WIP milestone.

comment:14 by stanislas69, 3 years ago

Description: modified (diff)

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

by stanislas69, 3 years ago

Attachment: #2349.3.diff added

Add back the default.cfg changes.

comment:15 by hal9000, 15 months ago

Cc: hal9000 added

comment:17 by stanislas69, 2 days ago

Patch: Phab:D1925
Note: See TracTickets for help on using tickets.