diff options
| author | Hannes Schulze <haschu0103@outlook.de> | 2025-02-06 16:28:39 +0100 |
|---|---|---|
| committer | Hannes Schulze <haschu0103@outlook.de> | 2025-02-06 16:28:39 +0100 |
| commit | 30b4364c772114303d9045677186a53855ea5343 (patch) | |
| tree | 3ac3443cdea7274e688bc633fa12bf1e089d6624 /lib/nes/app/ui/screen-freeze.cc | |
| parent | 64308c9e520dbd8e72b675d0ba064ecdaf9bd494 (diff) | |
implement in-game popups
Diffstat (limited to 'lib/nes/app/ui/screen-freeze.cc')
| -rw-r--r-- | lib/nes/app/ui/screen-freeze.cc | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/lib/nes/app/ui/screen-freeze.cc b/lib/nes/app/ui/screen-freeze.cc new file mode 100644 index 0000000..60410dd --- /dev/null +++ b/lib/nes/app/ui/screen-freeze.cc @@ -0,0 +1,33 @@ +#include "nes/app/ui/screen-freeze.hh" +#include "nes/app/graphics/renderer.hh" + +namespace nes::app +{ + auto screen_freeze::freeze(display const& disp) -> void + { + for (auto y = u32{ 0 }; y < display::height; ++y) + { + for (auto x = u32{ 0 }; x < display::width; ++x) + { + frozen_data_[y * display::width + x] = disp.get(x, y); + } + } + } + + auto screen_freeze::render(renderer& renderer) -> void + { + auto& disp = renderer.get_display(); + for (auto y = u32{ 0 }; y < display::height; ++y) + { + for (auto x = u32{ 0 }; x < display::width; ++x) + { + disp.set(x, y, frozen_data_[y * display::width + x]); + } + } + } + + auto screen_freeze::process_events() -> action + { + return action{}; + } +} // namespace nes::app
\ No newline at end of file |
