diff options
| author | Markus Gerber <markus.gerber@fau.de> | 2025-02-07 12:51:29 +0100 |
|---|---|---|
| committer | Markus Gerber <markus.gerber@fau.de> | 2025-02-07 12:51:46 +0100 |
| commit | 95a039c8d1f926365c8bf3c20b09ec6250e60d8a (patch) | |
| tree | d13af527cf4b59794448308d92574290c352aed8 /lib/nes/app/application.hh | |
| parent | e39508e6f2bac8ae171b496bc3ece7eaa2e63114 (diff) | |
added internal buffer to get rid of display::get
Diffstat (limited to 'lib/nes/app/application.hh')
| -rw-r--r-- | lib/nes/app/application.hh | 8 |
1 files changed, 6 insertions, 2 deletions
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<rgb, display::width * display::height> buffer_front_ = buffers_[0]; + span<rgb, display::width * display::height> 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<rgb, display::width * display::height>; + auto switch_buffers() -> void override; }; |
