summaryrefslogtreecommitdiffstats
path: root/src/yuzu_cmd/emu_window/emu_window_sdl2.h
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2020-02-17 21:35:14 +0100
committerbunnei <bunneidev@gmail.com>2020-02-26 03:23:00 +0100
commit2e16c237845bf1b5ff89b7b7a3f8bc1a84729eb1 (patch)
tree2ee5617fc3e3bdc47028d9d65097ceb070031727 /src/yuzu_cmd/emu_window/emu_window_sdl2.h
parentrenderer_opengl: Add texture mailbox support for presenter thread. (diff)
downloadyuzu-2e16c237845bf1b5ff89b7b7a3f8bc1a84729eb1.tar
yuzu-2e16c237845bf1b5ff89b7b7a3f8bc1a84729eb1.tar.gz
yuzu-2e16c237845bf1b5ff89b7b7a3f8bc1a84729eb1.tar.bz2
yuzu-2e16c237845bf1b5ff89b7b7a3f8bc1a84729eb1.tar.lz
yuzu-2e16c237845bf1b5ff89b7b7a3f8bc1a84729eb1.tar.xz
yuzu-2e16c237845bf1b5ff89b7b7a3f8bc1a84729eb1.tar.zst
yuzu-2e16c237845bf1b5ff89b7b7a3f8bc1a84729eb1.zip
Diffstat (limited to 'src/yuzu_cmd/emu_window/emu_window_sdl2.h')
-rw-r--r--src/yuzu_cmd/emu_window/emu_window_sdl2.h14
1 files changed, 12 insertions, 2 deletions
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<unsigned, unsigned> 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;