diff options
author | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-04-02 07:32:58 +0200 |
---|---|---|
committer | ReinUsesLisp <reinuseslisp@airmail.cc> | 2020-04-07 21:32:19 +0200 |
commit | bf1d66b7c074c02aa8148f2edbdc959082c229e1 (patch) | |
tree | 744ff7c8db629f73181da21c44ec76ee70cd4e52 /src/core/frontend | |
parent | renderer_vulkan: Query device names from the backend (diff) | |
download | yuzu-bf1d66b7c074c02aa8148f2edbdc959082c229e1.tar yuzu-bf1d66b7c074c02aa8148f2edbdc959082c229e1.tar.gz yuzu-bf1d66b7c074c02aa8148f2edbdc959082c229e1.tar.bz2 yuzu-bf1d66b7c074c02aa8148f2edbdc959082c229e1.tar.lz yuzu-bf1d66b7c074c02aa8148f2edbdc959082c229e1.tar.xz yuzu-bf1d66b7c074c02aa8148f2edbdc959082c229e1.tar.zst yuzu-bf1d66b7c074c02aa8148f2edbdc959082c229e1.zip |
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 @@ namespace Core::Frontend { +/// Information for the Graphics Backends signifying what type of screen pointer is in +/// WindowInformation +enum class WindowSystemType { + Headless, + Windows, + X11, + Wayland, +}; + /** * Represents a drawing context that supports graphics operations. */ @@ -76,6 +85,23 @@ public: std::pair<unsigned, unsigned> min_client_area_size; }; + /// Data describing host window system information + struct WindowSystemInfo { + // Window system type. Determines which GL context or Vulkan WSI is used. + WindowSystemType type = WindowSystemType::Headless; + + // Connection to a display server. This is used on X11 and Wayland platforms. + void* display_connection = nullptr; + + // Render surface. This is a pointer to the native window handle, which depends + // on the platform. e.g. HWND for Windows, Window for X11. If the surface is + // set to nullptr, the video backend will run in headless mode. + void* render_surface = nullptr; + + // Scale of the render surface. For hidpi systems, this will be >1. + float render_surface_scale = 1.0f; + }; + /// Polls window events virtual void PollEvents() = 0; @@ -87,10 +113,6 @@ public: /// Returns if window is shown (not minimized) virtual bool IsShown() const = 0; - /// Retrieves Vulkan specific handlers from the window - virtual void RetrieveVulkanHandlers(void* get_instance_proc_addr, void* instance, - void* surface) const = 0; - /** * Signal that a touch pressed event has occurred (e.g. mouse click pressed) * @param framebuffer_x Framebuffer x-coordinate that was pressed @@ -128,6 +150,13 @@ public: } /** + * Returns system information about the drawing area. + */ + const WindowSystemInfo& GetWindowInfo() const { + return window_info; + } + + /** * Gets the framebuffer layout (width, height, and screen regions) * @note This method is thread-safe */ @@ -142,7 +171,7 @@ public: void UpdateCurrentFramebufferLayout(unsigned width, unsigned height); protected: - EmuWindow(); + explicit EmuWindow(); virtual ~EmuWindow(); /** @@ -179,6 +208,8 @@ protected: client_area_height = size.second; } + WindowSystemInfo window_info; + private: /** * Handler called when the minimal client area was requested to be changed via SetConfig. |