From 1d5f5482f91391a6dfee9ec0e7cb0a22ee5f0464 Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Sat, 1 Feb 2025 00:38:55 +0100 Subject: implement screens --- lib/nes/app/ui/screen-title.cc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 lib/nes/app/ui/screen-title.cc (limited to 'lib/nes/app/ui/screen-title.cc') 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 -- cgit v1.3.1