summaryrefslogtreecommitdiff
path: root/lib/nes/app/ui/screen-title.cc
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-02-01 00:38:55 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-02-01 00:38:55 +0100
commit1d5f5482f91391a6dfee9ec0e7cb0a22ee5f0464 (patch)
tree80e1dff12390aa36ec532da655136e4b83b6ccf3 /lib/nes/app/ui/screen-title.cc
parentccb81b60dac888e44079fb0228c1d5d8542ceade (diff)
implement screens
Diffstat (limited to 'lib/nes/app/ui/screen-title.cc')
-rw-r--r--lib/nes/app/ui/screen-title.cc30
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/nes/app/ui/screen-title.cc b/lib/nes/app/ui/screen-title.cc
new file mode 100644
index 0000000..2a7bc5c
--- /dev/null
+++ b/lib/nes/app/ui/screen-title.cc
@@ -0,0 +1,30 @@
+#include "nes/app/ui/screen-title.hh"
+#include "nes/app/graphics/renderer.hh"
+#include "nes/app/graphics/color.hh"
+#include "nes/app/graphics/mask-tile.hh"
+#include "nes/app/input/input-manager.hh"
+
+namespace nes::app
+{
+ screen_title::screen_title(input_manager& input_manager)
+ : input_manager_{ input_manager }
+ {
+ }
+
+ auto screen_title::render(renderer& renderer) -> void
+ {
+ renderer.render_fill(color::background_primary);
+ renderer.render_rect(2, 4, 28, 8, color::accent_primary);
+ renderer.render_mask_tile(10, 16, tiles::letter_a, color::foreground_primary);
+ }
+
+ auto screen_title::process_events() -> action
+ {
+ if (input_manager_.get_keyboard().read_key_start())
+ {
+ return action::load_game;
+ }
+
+ return action::none;
+ }
+} // namespace nes::app \ No newline at end of file