| 1 | // Copyright 2018 Dolphin Emulator Project |
| 2 | // SPDX-License-Identifier: GPL-2.0-or-later |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | enum class WindowSystemType |
| 7 | { |
| 8 | Headless, |
| 9 | Windows, |
| 10 | MacOS, |
| 11 | Android, |
| 12 | X11, |
| 13 | Wayland, |
| 14 | FBDev, |
| 15 | Haiku, |
| 16 | }; |
| 17 | |
| 18 | struct WindowSystemInfo |
| 19 | { |
| 20 | WindowSystemInfo() = default; |
| 21 | WindowSystemInfo(WindowSystemType type_, void* display_connection_, void* render_window_, |
| 22 | void* render_surface_) |
| 23 | : type(type_), display_connection(display_connection_), render_window(render_window_), |
| 24 | render_surface(render_surface_) |
| 25 | { |
| 26 | } |
| 27 | |
| 28 | // Window system type. Determines which GL context or Vulkan WSI is used. |
| 29 | WindowSystemType type = WindowSystemType::Headless; |
| 30 | |
| 31 | // Connection to a display server. This is used on X11 and Wayland platforms. |
| 32 | void* display_connection = nullptr; |
| 33 | |
| 34 | // Render window. This is a pointer to the native window handle, which depends |
| 35 | // on the platform. e.g. HWND for Windows, Window for X11. If the surface is |
| 36 | // set to nullptr, the video backend will run in headless mode. |
| 37 | void* render_window = nullptr; |
| 38 | |
| 39 | // Render surface. Depending on the host platform, this may differ from the window. |
| 40 | // This is kept separate as input may require a different handle to rendering, and |
| 41 | // during video backend startup the surface pointer may change (MoltenVK). |
| 42 | void* render_surface = nullptr; |
| 43 | |
| 44 | // Scale of the render surface. For hidpi systems, this will be >1. |
| 45 | float render_surface_scale = 1.0f; |
| 46 | }; |