ReXGlue SDK
Loading...
Searching...
No Matches
title_app.h File Reference
#include <memory>
#include <string_view>
#include <rex/app/app.h>
#include <rex/cli.h>
#include <rex/ppc/image.h>
#include <rex/platform.h>
#include <rex/result.h>
#include <rex/kernel/title_runtime.h>
#include <rex/kernel/title_exit.h>

Go to the source code of this file.

Classes

class  rex::app::TitleApp

Namespaces

namespace  rex

Macros

#define REX_TITLE_APP(AppClass)
#define REX_TITLE_APP_MAIN(AppClass, Function)

Detailed Description

License
BSD 3-Clause License See LICENSE file in the project root for full license text.

Macro Definition Documentation

◆ REX_TITLE_APP

#define REX_TITLE_APP ( AppClass)
Value:
static int ReXTitleEntry(const ::rex::CLIArgList& args) { \
AppClass rex_app; \
if (rex_app.Init(args) && rex_app.LaunchTitle()) { \
rex_app.Run(); \
} \
return rex_app.Shutdown(); \
} \
REX_DETAIL_ENTRY_POINTS(ReXTitleEntry)

Defines main, and wWinMain on Windows, for a title app. An exception that escapes is printed to stderr and the exit code is 1.

Parameters
AppClassA class deriving from rex::app::TitleApp whose default constructor passes the app name and the kPPCImageConfig that the codegen init header declares to TitleApp.
#include "generated/default/foo_init.h"
class FooApp : public rex::app::TitleApp {
public:
FooApp() : TitleApp("foo", kPPCImageConfig) {}
};
Definition title_app.h:37
const rex::ppc::PPCImage kPPCImageConfig
#define REX_TITLE_APP(AppClass)
Definition title_app.h:122

◆ REX_TITLE_APP_MAIN

#define REX_TITLE_APP_MAIN ( AppClass,
Function )
Value:
static int ReXTitleEntry(const ::rex::CLIArgList& args) { \
AppClass rex_app; \
return Function(rex_app, args); \
} \
REX_DETAIL_ENTRY_POINTS(ReXTitleEntry)

Defines the entry point for a title app that calls its own steps, such as one with an installer.

Parameters
AppClassA class deriving from rex::app::TitleApp with a default constructor.
FunctionA function taking AppClass& and const rex::CLIArgList&, returning int.
int GameMain(Game& game, const rex::CLIArgList& args) {
if (game.Init(args)) {
while (game.NeedsInstall() && game.RunFrame()) {
}
if (game.LaunchTitle()) {
game.Run();
}
}
return game.Shutdown();
}
REX_TITLE_APP_MAIN(Game, GameMain)
Definition cli.h:36
#define REX_TITLE_APP_MAIN(AppClass, Function)
Definition title_app.h:152