blob: 2ae1eb2d922d8bd0b00babd9682118fc8bb0e0b7 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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(span<rgb, display::width * display::height> front_buffer) -> void;
};
} // namespace nes::app
|