MonoGame/MonoGame

[DesktopGL] Add Retina support

Open

#4 802 ouverte le 25 avr. 2016

Voir sur GitHub
 (41 commentaires) (0 réactions) (0 assignés)C# (3 071 forks)batch import
Help WantedWindowingenhancementhelp wantedplatform: macosscope: openglscope: windowingstatus: needs-design

Métriques du dépôt

Stars
 (13 886 stars)
Métriques de merge PR
 (Merge moyen 25j 3h) (22 PRs mergées en 30 j)

Description

Hello,

I tried to add Hi-DPI / Retina support to the new SDLGameWindow but it turns out it is way more complicated than just adding the Sdl.Window.State.AllowHiDpi creation flag to the window.

I lack the OS X understanding and unlimited access to a Retina, and I don't get what OS X is expecting when it comes to backbuffer, window and viewport size. Their virtual DPI system is totally different from other systems and the documentation didn't quite helped me. There are some design decisions to take as well, because setting a 2880x1800 resolution may end up to a 1440x900 viewport, which is misleading compared to what XNA users are used to and specific to OS X. Do we want this? Do we need some virtualisation?

Right now, GraphicsDeviceManager.HardwareModeSwitch = true renders a black screen on any Retina displays, while the borderless mode displays games only on 1/4th of the screen (on the lower left). This means that it is a regression compared to OpenTK (which was supporting Hi-DPI, but only correctly working with the desktop resolution, or borderless).

I wouldn't mind some help on this front, or any hints on how OS X works with Hi-DPI, OpenGL and SDL2. ( @tomspilman mind adding the "help wanted" tag?)

Note that on Windows, enabling Hi-DPI is as simple as adding a manifest to enable it. No other action is required and it works as expected. I'll push a PR to add this to the DesktopGL template.

@dellis1972 Did you have any issues with Retina on the latest SDL changes?

Guide contributeur