summaryrefslogtreecommitdiff
path: root/lib/nes/app/ui/screen-freeze.hh
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-02-06 16:28:39 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-02-06 16:28:39 +0100
commit30b4364c772114303d9045677186a53855ea5343 (patch)
tree3ac3443cdea7274e688bc633fa12bf1e089d6624 /lib/nes/app/ui/screen-freeze.hh
parent64308c9e520dbd8e72b675d0ba064ecdaf9bd494 (diff)
implement in-game popups
Diffstat (limited to 'lib/nes/app/ui/screen-freeze.hh')
-rw-r--r--lib/nes/app/ui/screen-freeze.hh25
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/nes/app/ui/screen-freeze.hh b/lib/nes/app/ui/screen-freeze.hh
new file mode 100644
index 0000000..fe67aad
--- /dev/null
+++ b/lib/nes/app/ui/screen-freeze.hh
@@ -0,0 +1,25 @@
+#pragma once
+
+#include "nes/app/ui/screen.hh"
+#include "nes/common/rgb.hh"
+#include "nes/common/display.hh"
+
+namespace nes::app
+{
+ /// Freeze screen which preserves the display buffer at a certain state.
+ ///
+ /// This is usually used to preserve the image from the console when the game should not continue.
+ class screen_freeze final : public screen
+ {
+ rgb frozen_data_[display::width * display::height]{};
+
+ public:
+ explicit screen_freeze() = default;
+
+ auto render(renderer&) -> void override;
+ auto process_events() -> action override;
+
+ /// Update the image shown to the back buffer of the given display.
+ auto freeze(display const&) -> void;
+ };
+} // namespace nes::app \ No newline at end of file