diff options
| author | 2020-04-10 20:06:55 -0400 | |
|---|---|---|
| committer | 2020-04-10 20:06:55 -0400 | |
| commit | 51c6688e214a9bdcf335fb0598dc7e5bc194f8f6 (patch) | |
| tree | 37ef2214634c2423ca617e9e22a2c9d57693ed86 /src/core/frontend | |
| parent | Merge pull request #3607 from FearlessTobi/input-kms (diff) | |
| parent | yuzu: Drop SDL2 and Qt frontend Vulkan requirements (diff) | |
| download | yuzu-51c6688e214a9bdcf335fb0598dc7e5bc194f8f6.tar.gz yuzu-51c6688e214a9bdcf335fb0598dc7e5bc194f8f6.tar.xz yuzu-51c6688e214a9bdcf335fb0598dc7e5bc194f8f6.zip | |
Merge pull request #3594 from ReinUsesLisp/vk-instance
yuzu: Drop SDL2 and Qt frontend Vulkan requirements
Diffstat (limited to 'src/core/frontend')
| -rw-r--r-- | src/core/frontend/emu_window.h | 41 |
1 files changed, 36 insertions, 5 deletions
diff --git a/src/core/frontend/emu_window.h b/src/core/frontend/emu_window.h index 72294d4d8..13aa14934 100644 --- a/src/core/frontend/emu_window.h +++ b/src/core/frontend/emu_window.h | |||
| @@ -12,6 +12,15 @@ | |||
| 12 | 12 | ||
| 13 | namespace Core::Frontend { | 13 | namespace Core::Frontend { |
| 14 | 14 | ||
| 15 | /// Information for the Graphics Backends signifying what type of screen pointer is in | ||
| 16 | /// WindowInformation | ||
| 17 | enum class WindowSystemType { | ||
| 18 | Headless, | ||
| 19 | Windows, | ||
| 20 | X11, | ||
| 21 | Wayland, | ||
| 22 | }; | ||
| 23 | |||
| 15 | /** | 24 | /** |
| 16 | * Represents a drawing context that supports graphics operations. | 25 | * Represents a drawing context that supports graphics operations. |
| 17 | */ | 26 | */ |
| @@ -76,6 +85,23 @@ public: | |||
| 76 | std::pair<unsigned, unsigned> min_client_area_size; | 85 | std::pair<unsigned, unsigned> min_client_area_size; |
| 77 | }; | 86 | }; |
| 78 | 87 | ||
| 88 | /// Data describing host window system information | ||
| 89 | struct WindowSystemInfo { | ||
| 90 | // Window system type. Determines which GL context or Vulkan WSI is used. | ||
| 91 | WindowSystemType type = WindowSystemType::Headless; | ||
| 92 | |||
| 93 | // Connection to a display server. This is used on X11 and Wayland platforms. | ||
| 94 | void* display_connection = nullptr; | ||
| 95 | |||
| 96 | // Render surface. This is a pointer to the native window handle, which depends | ||
| 97 | // on the platform. e.g. HWND for Windows, Window for X11. If the surface is | ||
| 98 | // set to nullptr, the video backend will run in headless mode. | ||
| 99 | void* render_surface = nullptr; | ||
| 100 | |||
| 101 | // Scale of the render surface. For hidpi systems, this will be >1. | ||
| 102 | float render_surface_scale = 1.0f; | ||
| 103 | }; | ||
| 104 | |||
| 79 | /// Polls window events | 105 | /// Polls window events |
| 80 | virtual void PollEvents() = 0; | 106 | virtual void PollEvents() = 0; |
| 81 | 107 | ||
| @@ -87,10 +113,6 @@ public: | |||
| 87 | /// Returns if window is shown (not minimized) | 113 | /// Returns if window is shown (not minimized) |
| 88 | virtual bool IsShown() const = 0; | 114 | virtual bool IsShown() const = 0; |
| 89 | 115 | ||
| 90 | /// Retrieves Vulkan specific handlers from the window | ||
| 91 | virtual void RetrieveVulkanHandlers(void* get_instance_proc_addr, void* instance, | ||
| 92 | void* surface) const = 0; | ||
| 93 | |||
| 94 | /** | 116 | /** |
| 95 | * Signal that a touch pressed event has occurred (e.g. mouse click pressed) | 117 | * Signal that a touch pressed event has occurred (e.g. mouse click pressed) |
| 96 | * @param framebuffer_x Framebuffer x-coordinate that was pressed | 118 | * @param framebuffer_x Framebuffer x-coordinate that was pressed |
| @@ -128,6 +150,13 @@ public: | |||
| 128 | } | 150 | } |
| 129 | 151 | ||
| 130 | /** | 152 | /** |
| 153 | * Returns system information about the drawing area. | ||
| 154 | */ | ||
| 155 | const WindowSystemInfo& GetWindowInfo() const { | ||
| 156 | return window_info; | ||
| 157 | } | ||
| 158 | |||
| 159 | /** | ||
| 131 | * Gets the framebuffer layout (width, height, and screen regions) | 160 | * Gets the framebuffer layout (width, height, and screen regions) |
| 132 | * @note This method is thread-safe | 161 | * @note This method is thread-safe |
| 133 | */ | 162 | */ |
| @@ -142,7 +171,7 @@ public: | |||
| 142 | void UpdateCurrentFramebufferLayout(unsigned width, unsigned height); | 171 | void UpdateCurrentFramebufferLayout(unsigned width, unsigned height); |
| 143 | 172 | ||
| 144 | protected: | 173 | protected: |
| 145 | EmuWindow(); | 174 | explicit EmuWindow(); |
| 146 | virtual ~EmuWindow(); | 175 | virtual ~EmuWindow(); |
| 147 | 176 | ||
| 148 | /** | 177 | /** |
| @@ -179,6 +208,8 @@ protected: | |||
| 179 | client_area_height = size.second; | 208 | client_area_height = size.second; |
| 180 | } | 209 | } |
| 181 | 210 | ||
| 211 | WindowSystemInfo window_info; | ||
| 212 | |||
| 182 | private: | 213 | private: |
| 183 | /** | 214 | /** |
| 184 | * Handler called when the minimal client area was requested to be changed via SetConfig. | 215 | * Handler called when the minimal client area was requested to be changed via SetConfig. |