mirror of
https://github.com/citra-emu/citra.git
synced 2024-12-19 23:31:06 +00:00
video_core: Allow changing background color while emulation is running
As @jroweboy stated, this is just one more atomic in VideoCore.
This commit is contained in:
parent
6bc87cdf3e
commit
0c37140690
@ -31,6 +31,8 @@ void Apply() {
|
|||||||
VideoCore::g_emu_window->UpdateCurrentFramebufferLayout(layout.width, layout.height);
|
VideoCore::g_emu_window->UpdateCurrentFramebufferLayout(layout.width, layout.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VideoCore::g_renderer_bg_color_update_requested = true;
|
||||||
|
|
||||||
if (Core::System::GetInstance().IsPoweredOn()) {
|
if (Core::System::GetInstance().IsPoweredOn()) {
|
||||||
Core::DSP().SetSink(values.sink_id, values.audio_device_id);
|
Core::DSP().SetSink(values.sink_id, values.audio_device_id);
|
||||||
Core::DSP().EnableStretching(values.enable_audio_stretching);
|
Core::DSP().EnableStretching(values.enable_audio_stretching);
|
||||||
|
@ -384,6 +384,12 @@ void RendererOpenGL::DrawSingleScreenRotated(const ScreenInfo& screen_info, floa
|
|||||||
* Draws the emulated screens to the emulator window.
|
* Draws the emulated screens to the emulator window.
|
||||||
*/
|
*/
|
||||||
void RendererOpenGL::DrawScreens() {
|
void RendererOpenGL::DrawScreens() {
|
||||||
|
if (VideoCore::g_renderer_bg_color_update_requested.exchange(false)) {
|
||||||
|
// Update background color before drawing
|
||||||
|
glClearColor(Settings::values.bg_red, Settings::values.bg_green, Settings::values.bg_blue,
|
||||||
|
0.0f);
|
||||||
|
}
|
||||||
|
|
||||||
auto layout = render_window->GetFramebufferLayout();
|
auto layout = render_window->GetFramebufferLayout();
|
||||||
const auto& top_screen = layout.top_screen;
|
const auto& top_screen = layout.top_screen;
|
||||||
const auto& bottom_screen = layout.bottom_screen;
|
const auto& bottom_screen = layout.bottom_screen;
|
||||||
|
@ -22,6 +22,7 @@ std::atomic<bool> g_shader_jit_enabled;
|
|||||||
std::atomic<bool> g_hw_shader_enabled;
|
std::atomic<bool> g_hw_shader_enabled;
|
||||||
std::atomic<bool> g_hw_shader_accurate_gs;
|
std::atomic<bool> g_hw_shader_accurate_gs;
|
||||||
std::atomic<bool> g_hw_shader_accurate_mul;
|
std::atomic<bool> g_hw_shader_accurate_mul;
|
||||||
|
std::atomic<bool> g_renderer_bg_color_update_requested;
|
||||||
|
|
||||||
/// Initialize the video core
|
/// Initialize the video core
|
||||||
bool Init(EmuWindow* emu_window) {
|
bool Init(EmuWindow* emu_window) {
|
||||||
|
@ -25,6 +25,7 @@ extern std::atomic<bool> g_shader_jit_enabled;
|
|||||||
extern std::atomic<bool> g_hw_shader_enabled;
|
extern std::atomic<bool> g_hw_shader_enabled;
|
||||||
extern std::atomic<bool> g_hw_shader_accurate_gs;
|
extern std::atomic<bool> g_hw_shader_accurate_gs;
|
||||||
extern std::atomic<bool> g_hw_shader_accurate_mul;
|
extern std::atomic<bool> g_hw_shader_accurate_mul;
|
||||||
|
extern std::atomic<bool> g_renderer_bg_color_update_requested;
|
||||||
|
|
||||||
/// Start the video core
|
/// Start the video core
|
||||||
void Start();
|
void Start();
|
||||||
|
Loading…
Reference in New Issue
Block a user