ReXGlue SDK
Loading...
Searching...
No Matches
rex::app::TitleApp Class Reference

#include <rex/app/title_app.h>

Inheritance diagram for rex::app::TitleApp:
[legend]

Public Member Functions

 TitleApp (std::string_view app_name, const ppc::PPCImage &image)
Result< void > LaunchTitle ()
void UnloadTitle ()
rex::kernel::TitleRuntime & GetTitleRuntime ()
Public Member Functions inherited from rex::app::App
 REX_SETTING (std::string, name, "", "App name, set by the constructor", kStartupOnly, kNoSave)
 REX_SETTING (std::filesystem::path, root, "", "Folder the app keeps its files in, the folder of the executable when empty", kStartupOnly)
 REX_SETTING (std::filesystem::path, log_root, "{app.root}/logs", "Log folder", kStartupOnly)
 REX_SETTING (std::string, single_instance, "", "Lock name only one running copy may hold, empty for none", kStartupOnly)
 App (std::string_view name)
 App (const App &)=delete
App & operator= (const App &)=delete
std::string_view GetName () const
AppPhase GetPhase () const
std::span< const std::string > GetArgs () const
rex::hid::IInputSystem & GetInput ()
rex::gpu::IGraphicsSystem & GetGraphics ()
rex::apu::IAudioSystem & GetAudio ()
rex::ui::IUISystem & GetUI ()
void RequestShutdown ()
void RequestRestart ()
Result< void > Init (const CLIArgList &args)
bool RunFrame ()
void Run ()
int Shutdown ()
Public Member Functions inherited from rex::SettingOwner
 SettingOwner (std::string_view scope)
virtual ~SettingOwner ()
const std::string & GetScope () const
std::span< SettingBase *const > GetOwnedSettings () const

Protected Member Functions

AppSysRequirements GetRequirements () const override
virtual Result< void > OnTitleLaunch (rex::kernel::TitleRuntime &title)
virtual void OnTitleExit (rex::kernel::TitleExitReason reason)
void OnRun () override
void ReportError (std::string_view message) override
platform::CrashReporterOptions GetCrashOptions () override
void OnStop () final
void OnRelease () override
void RestartTitle ()
Protected Member Functions inherited from rex::app::App
virtual Result< void > OnConfigure (SettingsRegistry &settings)
virtual std::span< const CLIAction > GetActions () const
virtual Result< void > OnAction (const CLIActionHit &hit)
virtual void OnModules (std::vector< std::string > &modules)
virtual void OnRegisterModules (std::vector< IModule * > &modules)
virtual Result< void > OnInit ()
virtual void OnShutdown ()
rex::ui::IUISystem * FindUI ()
bool IsHeadlessRequested () const
Result< void > Fail (std::string_view step, Error error)
IInterfaceFactory & GetControlFactory ()
void SetPhase (AppPhase phase)
Protected Member Functions inherited from rex::NonCopyable
 NonCopyable (const NonCopyable &)=delete
NonCopyable & operator= (const NonCopyable &)=delete

Detailed Description

An app that runs a title. REX_TITLE_APP calls Init, LaunchTitle, Run and Shutdown in order. A project with an installer or a launcher uses REX_TITLE_APP_MAIN, calling RunFrame until it is ready to launch. LaunchTitle and UnloadTitle may run any number of times, each launch from a fresh mapping. When the title exits on its own the app asks the player to restart it or exit, or shuts down when headless. Every step and hook runs on the UI thread that called Init.

Constructor & Destructor Documentation

◆ TitleApp()

rex::app::TitleApp::TitleApp ( std::string_view app_name,
const ppc::PPCImage & image )
Parameters
imageThe recompiled image the codegen header declares.

Member Function Documentation

◆ GetCrashOptions()

platform::CrashReporterOptions rex::app::TitleApp::GetCrashOptions ( )
overrideprotectedvirtual

Returns the options the crash reporter starts with.

Reimplemented from rex::app::App.

◆ GetRequirements()

AppSysRequirements rex::app::TitleApp::GetRequirements ( ) const
overrideprotectedvirtual

Requires the Xenos graphics family, audio, input and UI.

Reimplemented from rex::app::App.

◆ GetTitleRuntime()

rex::kernel::TitleRuntime & rex::app::TitleApp::GetTitleRuntime ( )

Returns the title runtime, loaded or not.

◆ LaunchTitle()

Result< void > rex::app::TitleApp::LaunchTitle ( )
nodiscard

The launch phase. Runs TitleRuntime::Load, OnTitleLaunch, then TitleRuntime::Launch. Call on the UI thread after Init. Returns Ok and does nothing once shutdown is requested.

Returns
Ok, or an error, which the app shows to the player.

◆ OnRelease()

void rex::app::TitleApp::OnRelease ( )
overrideprotectedvirtual

Releases what a derived app type created after Init. Runs after OnShutdown.

Reimplemented from rex::app::App.

◆ OnRun()

void rex::app::TitleApp::OnRun ( )
overrideprotectedvirtual

Runs the title until it exits or shutdown is requested.

Reimplemented from rex::app::App.

◆ OnStop()

void rex::app::TitleApp::OnStop ( )
finalprotectedvirtual

Stops what a derived app type runs. Shutdown calls it first, before OnShutdown.

Reimplemented from rex::app::App.

◆ OnTitleExit()

virtual void rex::app::TitleApp::OnTitleExit ( rex::kernel::TitleExitReason reason)
protectedvirtual

The title exited on its own. The default asks the player to restart or exit.

◆ OnTitleLaunch()

virtual Result< void > rex::app::TitleApp::OnTitleLaunch ( rex::kernel::TitleRuntime & title)
nodiscardprotectedvirtual

Runs after TitleRuntime::Load and before the guest starts.

Returns
Ok, or an error that stops the launch.

◆ ReportError()

void rex::app::TitleApp::ReportError ( std::string_view message)
overrideprotectedvirtual

Reports an error through the host.

Parameters
messageThe error text.

Reimplemented from rex::app::App.

◆ UnloadTitle()

void rex::app::TitleApp::UnloadTitle ( )

The unload phase runs TitleRuntime::Unload and returns to running. Call on the UI thread.


The documentation for this class was generated from the following file: