summaryrefslogtreecommitdiffstats
path: root/src/video_core/renderer_base.cpp
diff options
context:
space:
mode:
authorzhupengfei <zhupengfei321@sina.cn>2018-08-31 08:16:16 +0200
committerfearlessTobi <thm.frey@gmail.com>2018-12-18 22:54:41 +0100
commita2be49305d8c5c66cfa2ec2060688013cf3729b9 (patch)
tree2a2e38805ae8af0718628682d7e911ccb253fc16 /src/video_core/renderer_base.cpp
parentMerge pull request #1868 from lioncash/config (diff)
downloadyuzu-a2be49305d8c5c66cfa2ec2060688013cf3729b9.tar
yuzu-a2be49305d8c5c66cfa2ec2060688013cf3729b9.tar.gz
yuzu-a2be49305d8c5c66cfa2ec2060688013cf3729b9.tar.bz2
yuzu-a2be49305d8c5c66cfa2ec2060688013cf3729b9.tar.lz
yuzu-a2be49305d8c5c66cfa2ec2060688013cf3729b9.tar.xz
yuzu-a2be49305d8c5c66cfa2ec2060688013cf3729b9.tar.zst
yuzu-a2be49305d8c5c66cfa2ec2060688013cf3729b9.zip
Diffstat (limited to 'src/video_core/renderer_base.cpp')
-rw-r--r--src/video_core/renderer_base.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/video_core/renderer_base.cpp b/src/video_core/renderer_base.cpp
index 1482cdb40..94223f45f 100644
--- a/src/video_core/renderer_base.cpp
+++ b/src/video_core/renderer_base.cpp
@@ -27,4 +27,16 @@ void RendererBase::UpdateCurrentFramebufferLayout() {
render_window.UpdateCurrentFramebufferLayout(layout.width, layout.height);
}
+void RendererBase::RequestScreenshot(void* data, std::function<void()> callback,
+ const Layout::FramebufferLayout& layout) {
+ if (renderer_settings.screenshot_requested) {
+ LOG_ERROR(Render, "A screenshot is already requested or in progress, ignoring the request");
+ return;
+ }
+ renderer_settings.screenshot_bits = data;
+ renderer_settings.screenshot_complete_callback = std::move(callback);
+ renderer_settings.screenshot_framebuffer_layout = layout;
+ renderer_settings.screenshot_requested = true;
+}
+
} // namespace VideoCore