From cd8ae0e4f628bd491fcaf1dd4778bc283d619065 Mon Sep 17 00:00:00 2001 From: Hannes Schulze Date: Fri, 31 Jan 2025 23:24:45 +0100 Subject: implement renderer --- lib/nes/app/application.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'lib/nes/app/application.cc') diff --git a/lib/nes/app/application.cc b/lib/nes/app/application.cc index db43854..ad3c1af 100644 --- a/lib/nes/app/application.cc +++ b/lib/nes/app/application.cc @@ -1,6 +1,11 @@ #include "nes/app/application.hh" #include "nes/app/input/input-device-keyboard.hh" #include "nes/app/input/input-device-controller.hh" +#include "nes/app/graphics/renderer.hh" +#include "nes/app/graphics/color.hh" +#include "nes/app/graphics/mask-tile.hh" +#include "nes/app/graphics/image-tile.hh" +#include "nes/common/display.hh" #include namespace nes @@ -24,7 +29,7 @@ namespace nes auto application::frame(std::chrono::microseconds const elapsed_time) -> void { - console_.ref_controller_1().set_pressed(input_manager_.get_input_1().read_mask()); + /*console_.ref_controller_1().set_pressed(input_manager_.get_input_1().read_mask()); console_.ref_controller_2().set_pressed(input_manager_.get_input_2().read_mask()); console_.step(elapsed_time); @@ -33,6 +38,12 @@ namespace nes { std::cerr << "Invalid state: " << to_string(console_.get_status()) << std::endl; std::abort(); - } + }*/ + + auto r = app::renderer{ display_ }; + r.render_fill(app::color::background_primary); + r.render_mask_tile(10, 5, app::tiles::letter_a, app::color::foreground_primary); + r.render_image_tile(5, 5, app::tiles::test); + display_.switch_buffers(); } } // namespace nes \ No newline at end of file -- cgit v1.3.1