summaryrefslogtreecommitdiff
path: root/lib/nes/app/application.hh
diff options
context:
space:
mode:
authorHannes Schulze <haschu0103@outlook.de>2025-02-06 18:24:59 +0100
committerHannes Schulze <haschu0103@outlook.de>2025-02-06 18:24:59 +0100
commitd060e3a50c987d10799ccc739bdbf9d7d7a13c10 (patch)
tree4b5585383ada85608b57bcf76e5828817962fddf /lib/nes/app/application.hh
parentdbed1c0fa5599b1b96c221b89b10f1e350351645 (diff)
implement settings
Diffstat (limited to 'lib/nes/app/application.hh')
-rw-r--r--lib/nes/app/application.hh18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/nes/app/application.hh b/lib/nes/app/application.hh
index 66b5206..c23f654 100644
--- a/lib/nes/app/application.hh
+++ b/lib/nes/app/application.hh
@@ -3,12 +3,15 @@
#include "nes/app/input/input-manager.hh"
#include "nes/app/ui/screen-title.hh"
#include "nes/app/ui/screen-browser.hh"
+#include "nes/app/ui/screen-settings.hh"
#include "nes/app/ui/screen-freeze.hh"
#include "nes/app/ui/screen-error.hh"
#include "nes/app/ui/screen-confirm-quit.hh"
+#include "nes/app/preferences.hh"
#include "nes/sys/nes.hh"
#include "nes/common/containers/box.hh"
#include "nes/common/display.hh"
+#include "nes/common/fps-counter.hh"
#include "nes/common/types.hh"
#include <chrono>
@@ -28,13 +31,17 @@ namespace nes::app
/// buffers.
class display_proxy final : public display
{
+ preferences& preferences_;
+
public:
+ fps_counter fps_counter;
display& base;
screen* popup{ nullptr };
screen* screen{ nullptr };
- explicit display_proxy(display& base)
- : base{ base }
+ explicit display_proxy(preferences& preferences, display& base)
+ : preferences_{ preferences }
+ , base{ base }
{
}
@@ -43,18 +50,20 @@ namespace nes::app
auto switch_buffers() -> void override;
};
- display_proxy display_;
input_manager input_manager_;
+ preferences preferences_;
file_browser& file_browser_;
+ display_proxy display_;
box<sys::nes> console_{};
screen_title screen_title_;
screen_browser screen_browser_;
+ screen_settings screen_settings_;
screen_freeze screen_freeze_;
screen_error screen_error_;
screen_confirm_quit screen_confirm_quit_;
public:
- explicit application(display&, input_device_keyboard&, file_browser& file_browser);
+ explicit application(display&, input_device_keyboard&, file_browser&);
application(application const&) = delete;
application(application&&) = delete;
@@ -70,5 +79,6 @@ namespace nes::app
private:
auto handle_action(action const&) -> void;
auto show_error(std::string_view message, status error, action const& action = action::close_popup()) -> void;
+ auto go_to_screen(screen*) -> void;
};
} // namespace nes::app \ No newline at end of file