From 2e16c237845bf1b5ff89b7b7a3f8bc1a84729eb1 Mon Sep 17 00:00:00 2001 From: bunnei Date: Mon, 17 Feb 2020 15:35:14 -0500 Subject: frontend: sdl2: emu_window: Implement separate presentation thread. --- src/yuzu_cmd/emu_window/emu_window_sdl2.h | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) (limited to 'src/yuzu_cmd/emu_window/emu_window_sdl2.h') diff --git a/src/yuzu_cmd/emu_window/emu_window_sdl2.h b/src/yuzu_cmd/emu_window/emu_window_sdl2.h index b38f56661..fffac4252 100644 --- a/src/yuzu_cmd/emu_window/emu_window_sdl2.h +++ b/src/yuzu_cmd/emu_window/emu_window_sdl2.h @@ -10,9 +10,13 @@ struct SDL_Window; +namespace Core { +class System; +} + class EmuWindow_SDL2 : public Core::Frontend::EmuWindow { public: - explicit EmuWindow_SDL2(bool fullscreen); + explicit EmuWindow_SDL2(Core::System& system, bool fullscreen); ~EmuWindow_SDL2(); /// Polls window events @@ -24,6 +28,9 @@ public: /// Returns if window is shown (not minimized) bool IsShown() const override; + /// Presents the next frame + virtual void Present() = 0; + protected: /// Called by PollEvents when a key is pressed or released. void OnKeyEvent(int key, u8 state); @@ -55,6 +62,9 @@ protected: /// Called when a configuration change affects the minimal size of the window void OnMinimalClientAreaChangeRequest(std::pair minimal_size) override; + /// Instance of the system, used to access renderer for the presentation thread + Core::System& system; + /// Is the window still open? bool is_open = true; @@ -62,7 +72,7 @@ protected: bool is_shown = true; /// Internal SDL2 render window - SDL_Window* render_window; + SDL_Window* render_window{}; /// Keeps track of how often to update the title bar during gameplay u32 last_time = 0; -- cgit v1.2.3