core: improve DPI awareness & add docs #1102

Open
opened 2023-11-05 04:57:57 +00:00 by emidoots · 2 comments
emidoots commented 2023-11-05 04:57:57 +00:00 (Migrated from github.com)

Today mach-core provides:

  1. Framebuffer size in pixels (arbitrary units)
  2. Window size in pixels (arbitrary units)
  3. A guarantee that framebuffer size is always >= window size.
  • Example A: on a non-retina/HDPI display, the framebuffer size and window size may be the same.
  • Example B: on a retina/HDPI display, the framebuffer size may be twice the window size.

The following issues exist:

  • https://machengine.org/core should have documentation about how mach-core handles resolutions, DPI and Retina displays, etc.
  • on MacOS, today we always choose to have the framebuffer size match the actual native resolution (e.g. 2x the window size), see [0] [1], this should be made configurable.
  • on Windows, we currently do not have a way to opt-in to e.g. "Per-Monitor (V2) DPI Awareness"
  • on Linux, it is unclear how mach-core/GLFW behaves currently when using e.g. fractional scaling in gnome or similar.
Today mach-core provides: 1. Framebuffer size in pixels (arbitrary units) 2. Window size in pixels (arbitrary units) 3. A guarantee that framebuffer size is always >= window size. * Example A: on a non-retina/HDPI display, the framebuffer size and window size may be the same. * Example B: on a retina/HDPI display, the framebuffer size may be twice the window size. The following issues exist: * [ ] https://machengine.org/core should have documentation about how mach-core handles resolutions, DPI and Retina displays, etc. * [ ] on MacOS, today we always choose to have the framebuffer size match the actual native resolution (e.g. 2x the window size), see [[0]](https://github.com/hexops/mach-core/blob/cce02fb96ca787378289c5855b381f0ca9f3e090/src/platform/native/Core.zig#L156) [[1]](https://github.com/hexops/mach-core/blob/cce02fb96ca787378289c5855b381f0ca9f3e090/src/platform/native/Core.zig#L156), this should be made configurable. * [ ] on Windows, we currently do not have a way to opt-in to e.g. ["Per-Monitor (V2) DPI Awareness"](https://learn.microsoft.com/en-us/windows/win32/hidpi/high-dpi-desktop-application-development-on-windows) * [ ] on Linux, it is unclear how mach-core/GLFW behaves currently when using e.g. fractional scaling in gnome or similar.
pdoane commented 2023-11-05 19:11:39 +00:00 (Migrated from github.com)

DXGI_SCALING_NONE might want to be tracked elsewhere. It's a nice to have during resize events to give better stability.

DXGI_SCALING_NONE might want to be tracked elsewhere. It's a nice to have during resize events to give better stability.
emidoots commented 2023-11-06 03:23:08 +00:00 (Migrated from github.com)
Done! https://github.com/hexops/mach/issues/1105
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
hexops/mach#1102
No description provided.