ReXGlue SDK
Toggle main menu visibility
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
>
21
#include <
rex/kernel/title_runtime.h
>
22
#include <
rex/kernel/title_exit.h
>
23
24
#if REX_PLATFORM_WIN32
25
#include <windows.h>
26
#endif
27
28
namespace
rex::app {
29
37
class
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
54
void
UnloadTitle
();
55
59
rex::kernel::TitleRuntime
&
GetTitleRuntime
();
60
61
protected
:
65
AppSysRequirements
GetRequirements
()
const override
;
66
72
[[nodiscard]]
virtual
Result<void>
OnTitleLaunch
(
rex::kernel::TitleRuntime
& title);
73
75
virtual
void
OnTitleExit
(
rex::kernel::TitleExitReason
reason);
76
78
void
OnRun
()
override
;
79
85
void
ReportError
(std::string_view message)
override
;
86
90
platform::CrashReporterOptions
GetCrashOptions
()
override
;
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.h
rex::app::App::App
App(std::string_view name)
rex::app::TitleApp::ReportError
void ReportError(std::string_view message) override
rex::app::TitleApp::LaunchTitle
Result< void > LaunchTitle()
rex::app::TitleApp::OnTitleLaunch
virtual Result< void > OnTitleLaunch(rex::kernel::TitleRuntime &title)
rex::app::TitleApp::OnRelease
void OnRelease() override
rex::app::TitleApp::UnloadTitle
void UnloadTitle()
rex::app::TitleApp::OnStop
void OnStop() final
rex::app::TitleApp::GetRequirements
AppSysRequirements GetRequirements() const override
rex::app::TitleApp::OnTitleExit
virtual void OnTitleExit(rex::kernel::TitleExitReason reason)
rex::app::TitleApp::TitleApp
TitleApp(std::string_view app_name, const ppc::PPCImage &image)
rex::app::TitleApp::GetTitleRuntime
rex::kernel::TitleRuntime & GetTitleRuntime()
rex::app::TitleApp::OnRun
void OnRun() override
rex::app::TitleApp::GetCrashOptions
platform::CrashReporterOptions GetCrashOptions() override
rex::kernel::TitleRuntime
Definition
title_runtime.h:85
cli.h
image.h
PPC image layout, embedded metadata assets and pdata decoding.
rex::kernel::TitleExitReason
TitleExitReason
Definition
title_exit.h:18
rex::Result
std::expected< T, Error > Result
Definition
result.h:98
platform.h
Platform flags, packing macros and export markers.
REX_APP_API
#define REX_APP_API
Definition
platform.h:279
result.h
rex::AppSysRequirements
Definition
app_info.h:20
rex::platform::CrashReporterOptions
Definition
process.h:200
rex::ppc::PPCImage
Definition
image.h:73
title_exit.h
title_runtime.h
rex
app
title_app.h
Generated by
1.18.0