From 95a039c8d1f926365c8bf3c20b09ec6250e60d8a Mon Sep 17 00:00:00 2001 From: Markus Gerber Date: Fri, 7 Feb 2025 12:51:29 +0100 Subject: added internal buffer to get rid of display::get --- lib/nes/app/application.hh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/nes/app/application.hh') diff --git a/lib/nes/app/application.hh b/lib/nes/app/application.hh index f0117b1..d0973e8 100644 --- a/lib/nes/app/application.hh +++ b/lib/nes/app/application.hh @@ -31,6 +31,9 @@ namespace nes::app class display_proxy final : public display { preferences& preferences_; + rgb buffers_[2][display::width * display::height]{}; + span buffer_front_ = buffers_[0]; + span buffer_back_ = buffers_[1]; public: fps_counter fps_counter; @@ -44,8 +47,9 @@ namespace nes::app { } - auto get(u32 const x, u32 const y) const -> rgb override { return base.get(x, y); } - auto set(u32 const x, u32 const y, rgb const value) -> void override { base.set(x, y, value); } + auto set(u32 const x, u32 const y, rgb const value) -> void override; + auto get_front() const -> span; + auto switch_buffers() -> void override; }; -- cgit v1.3.1