diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-12-07 04:06:12 +0100 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-12-08 05:20:38 +0100 |
commit | 195fedccf07b909c95e5905c7154c595bb260fc7 (patch) | |
tree | b36ecb555672b6994e4bd11812a605fe2726d172 /src/video_core/renderer_base.cpp | |
parent | VideoCore: Rename HWRasterizer methods to be less confusing (diff) | |
download | yuzu-195fedccf07b909c95e5905c7154c595bb260fc7.tar yuzu-195fedccf07b909c95e5905c7154c595bb260fc7.tar.gz yuzu-195fedccf07b909c95e5905c7154c595bb260fc7.tar.bz2 yuzu-195fedccf07b909c95e5905c7154c595bb260fc7.tar.lz yuzu-195fedccf07b909c95e5905c7154c595bb260fc7.tar.xz yuzu-195fedccf07b909c95e5905c7154c595bb260fc7.tar.zst yuzu-195fedccf07b909c95e5905c7154c595bb260fc7.zip |
Diffstat (limited to 'src/video_core/renderer_base.cpp')
-rw-r--r-- | src/video_core/renderer_base.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/video_core/renderer_base.cpp b/src/video_core/renderer_base.cpp new file mode 100644 index 000000000..93e980216 --- /dev/null +++ b/src/video_core/renderer_base.cpp @@ -0,0 +1,28 @@ +// Copyright 2015 Citra Emulator Project +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#include <memory> + +#include "common/make_unique.h" + +#include "core/settings.h" + +#include "video_core/renderer_base.h" +#include "video_core/video_core.h" +#include "video_core/swrasterizer.h" +#include "video_core/renderer_opengl/gl_rasterizer.h" + +void RendererBase::RefreshRasterizerSetting() { + bool hw_renderer_enabled = VideoCore::g_hw_renderer_enabled; + if (rasterizer == nullptr || opengl_rasterizer_active != hw_renderer_enabled) { + opengl_rasterizer_active = hw_renderer_enabled; + + if (hw_renderer_enabled) { + rasterizer = Common::make_unique<RasterizerOpenGL>(); + } else { + rasterizer = Common::make_unique<VideoCore::SWRasterizer>(); + } + rasterizer->InitObjects(); + } +} |