diff options
author | bunnei <bunneidev@gmail.com> | 2018-12-23 20:36:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-23 20:36:51 +0100 |
commit | 9a22a94a510e6f537b5156a960f0d49307089668 (patch) | |
tree | 05d895b5fc1aa0caa51cce9314fd1c81244f69a0 /src/video_core/renderer_base.h | |
parent | Merge pull request #1930 from lioncash/common (diff) | |
parent | yuzu, video_core: Screenshot functionality (diff) | |
download | yuzu-9a22a94a510e6f537b5156a960f0d49307089668.tar yuzu-9a22a94a510e6f537b5156a960f0d49307089668.tar.gz yuzu-9a22a94a510e6f537b5156a960f0d49307089668.tar.bz2 yuzu-9a22a94a510e6f537b5156a960f0d49307089668.tar.lz yuzu-9a22a94a510e6f537b5156a960f0d49307089668.tar.xz yuzu-9a22a94a510e6f537b5156a960f0d49307089668.tar.zst yuzu-9a22a94a510e6f537b5156a960f0d49307089668.zip |
Diffstat (limited to 'src/video_core/renderer_base.h')
-rw-r--r-- | src/video_core/renderer_base.h | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/video_core/renderer_base.h b/src/video_core/renderer_base.h index 669e26e15..1d54c3723 100644 --- a/src/video_core/renderer_base.h +++ b/src/video_core/renderer_base.h @@ -9,6 +9,7 @@ #include <optional> #include "common/common_types.h" +#include "core/frontend/emu_window.h" #include "video_core/gpu.h" #include "video_core/rasterizer_interface.h" @@ -21,6 +22,12 @@ namespace VideoCore { struct RendererSettings { std::atomic_bool use_framelimiter{false}; std::atomic_bool set_background_color{false}; + + // Screenshot + std::atomic<bool> screenshot_requested{false}; + void* screenshot_bits; + std::function<void()> screenshot_complete_callback; + Layout::FramebufferLayout screenshot_framebuffer_layout; }; class RendererBase : NonCopyable { @@ -57,9 +64,29 @@ public: return *rasterizer; } + Core::Frontend::EmuWindow& GetRenderWindow() { + return render_window; + } + + const Core::Frontend::EmuWindow& GetRenderWindow() const { + return render_window; + } + + RendererSettings& Settings() { + return renderer_settings; + } + + const RendererSettings& Settings() const { + return renderer_settings; + } + /// Refreshes the settings common to all renderers void RefreshBaseSettings(); + /// Request a screenshot of the next frame + void RequestScreenshot(void* data, std::function<void()> callback, + const Layout::FramebufferLayout& layout); + protected: Core::Frontend::EmuWindow& render_window; ///< Reference to the render window handle. std::unique_ptr<RasterizerInterface> rasterizer; |