ReXGlue SDK
Loading...
Searching...
No Matches
title_app.h
Go to the documentation of this file.
1
10
11#pragma once
12
13#include <memory>
14#include <string_view>
15
16#include <rex/app/app.h>
17#include <rex/cli.h>
18#include <rex/ppc/image.h>
19#include <rex/platform.h>
20#include <rex/result.h>
23
24#if REX_PLATFORM_WIN32
25#include <windows.h>
26#endif
27
28namespace rex::app {
29
37class REX_APP_API TitleApp : public App {
38 public:
42 TitleApp(std::string_view app_name, const ppc::PPCImage& image);
43 ~TitleApp() override;
44
51 [[nodiscard]] Result<void> LaunchTitle();
52
55
60
61 protected:
66
73
76
78 void OnRun() override;
79
85 void ReportError(std::string_view message) override;
86
91
92 void OnStop() final;
93
94 void OnRelease() override;
95
96 void RestartTitle();
97
98 private:
99 struct State;
100 std::unique_ptr<State> state_;
101};
102
103} // namespace rex::app
104
122#define REX_TITLE_APP(AppClass) \
123 static int ReXTitleEntry(const ::rex::CLIArgList& args) { \
124 AppClass rex_app; \
125 if (rex_app.Init(args) && rex_app.LaunchTitle()) { \
126 rex_app.Run(); \
127 } \
128 return rex_app.Shutdown(); \
129 } \
130 REX_DETAIL_ENTRY_POINTS(ReXTitleEntry)
131
152#define REX_TITLE_APP_MAIN(AppClass, Function) \
153 static int ReXTitleEntry(const ::rex::CLIArgList& args) { \
154 AppClass rex_app; \
155 return Function(rex_app, args); \
156 } \
157 REX_DETAIL_ENTRY_POINTS(ReXTitleEntry)
App(std::string_view name)
void ReportError(std::string_view message) override
Result< void > LaunchTitle()
virtual Result< void > OnTitleLaunch(rex::kernel::TitleRuntime &title)
void OnRelease() override
void OnStop() final
AppSysRequirements GetRequirements() const override
virtual void OnTitleExit(rex::kernel::TitleExitReason reason)
TitleApp(std::string_view app_name, const ppc::PPCImage &image)
rex::kernel::TitleRuntime & GetTitleRuntime()
void OnRun() override
platform::CrashReporterOptions GetCrashOptions() override
Definition title_runtime.h:85
PPC image layout, embedded metadata assets and pdata decoding.
TitleExitReason
Definition title_exit.h:18
std::expected< T, Error > Result
Definition result.h:98
Platform flags, packing macros and export markers.
#define REX_APP_API
Definition platform.h:279
Definition app_info.h:20
Definition process.h:200
Definition image.h:73