blob: 07e9d6f7813365d58db6d8d4a21aebb04f8e09a4 (
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
26
27
28
29
30
31
|
#pragma once
#include "nes/app/ui/action.hh"
namespace nes::app
{
class renderer;
/// A part of the UI which takes care of rendering and handling input events.
///
/// One screen may be shown at a time. It may be used as an overlay over an active game.
class screen
{
public:
virtual ~screen() = default;
screen(screen const&) = delete;
screen(screen&&) = delete;
auto operator=(screen const&) -> screen& = delete;
auto operator=(screen&&) -> screen& = delete;
/// Render a frame with the current UI state.
virtual auto render(renderer&) -> void = 0;
/// Handle events and return an action for the application to execute.
virtual auto process_events() -> action = 0;
protected:
explicit screen() = default;
};
} // namespace nes::app
|