Opened 10 years ago

Last modified 15 months ago

#2349 new enhancement

[PATCH] Add support for Hi-DPI displays

Reported by: julian37 Owned by: wraitii
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 Stan)

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

Download all attachments as: .zip

Change History (22)

comment:1 by julian37, 10 years ago

Description: modified (diff)

comment:2 by historic_bruno, 10 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, 9 years ago

r16223 added a GUI scaling option.

comment:4 by historic_bruno, 9 years ago

Description: modified (diff)

by historic_bruno, 8 years ago

Attachment: hidpi.patch added

patch by orangy from #3692

comment:5 by historic_bruno, 8 years ago

Cc: Ilya Ryzhenkov added

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

comment:6 by historic_bruno, 8 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, 8 years ago

Milestone: Alpha 20Alpha 21

comment:8 by Itms, 8 years ago

Keywords: rfc added; review removed

Move tickets from the review queue to the rfc one.

comment:9 by Moul, 8 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: http://pix.toile-libre.org/upload/original/1473526126.png

comment:10 by fabio, 8 years ago

Hi, to scale the GUI see here.

comment:11 by Vladislav Belov, 8 years ago

Milestone: Alpha 21Alpha 22

Too few time remaining for A21 release.

comment:12 by wraitii, 7 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, 7 years ago

Attachment: highdpi2.patch added

comment:13 by elexis, 7 years ago

Milestone: Alpha 22Work In Progress

Moving to the new WIP milestone.

comment:14 by Stan, 7 years ago

Description: modified (diff)

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

by Stan, 7 years ago

Attachment: #2349.3.diff added

Add back the default.cfg changes.

comment:15 by hal9000, 5 years ago

Cc: hal9000 added

comment:17 by Stan, 4 years ago

Patch: Phab:D1925

comment:18 by Silier, 3 years ago

Owner: set to wraitii

comment:19 by Langbart, 15 months ago

duplicate ticket closed #6726

Note: See TracTickets for help on using tickets.