ReXApp class is the foundation for building recompiled Xbox 360 applications with ReXGlue. It handles all boilerplate setup including runtime initialization, window creation, ImGui integration, module launch, and shutdown.
Overview
ReXApp provides a complete application framework that:
- Initializes the Runtime subsystem with configurable backends
- Creates and manages the application window
- Sets up ImGui for debug overlays and UI
- Launches the recompiled PPC module on a background thread
- Provides virtual hooks for customization without modifying framework code
Class Declaration
Defined inrex/rex_app.h:
Basic Usage
The typical pattern is to subclassReXApp in your main.cpp:
Constructor
Parameters
- ctx: Window system context from the platform entry point
- name: Application name (used for window title, logging)
- ppc_info: PPC image layout from generated config header
- usage: Optional command-line usage string
PPCImageInfo Structure
rexglue codegen.
Virtual Hooks
See Custom Hooks for detailed documentation of all customization points.Protected Accessors
Subclasses can access framework objects through protected methods:Runtime Access
rex/rex_app.h:106
Window Access
rex/rex_app.h:107
ImGui Drawer Access
rex/rex_app.h:108
Path Configuration
OnConfigurePaths().
See rex/rex_app.h:110-112
Initialization Sequence
Understanding the initialization order helps you choose the right hook:Path Configuration
Default paths are computed from CLI args and cvars.
OnConfigurePaths() is called to allow customization.Pre-Setup Hook
OnPreSetup() is called. This is your chance to configure backend injection before Runtime::Setup().Runtime Setup
Runtime::Setup() initializes all subsystems (memory, VFS, kernel, graphics, audio, input).ImGui Initialization
ImGui drawer is created and default dialogs (console, debug overlay) are registered.
Shutdown Sequence
When the application closes:Built-in Features
ReXApp provides these features out of the box:Debug Overlays
- Console: Press
`(backtick) to toggle log console - Debug Overlay: Performance stats and system info
- Settings: Runtime configuration UI
Command-Line Processing
ReXApp processes standard command-line arguments:game_data_root.
Logging Integration
All log output is captured and displayed in the console overlay. Use ReXGlue’s logging macros:Thread Safety
The PPC module runs on a background thread. ImGui callbacks run on the main thread. Use appropriate synchronization when sharing state:Next Steps
Runtime Setup
Configure backend systems (graphics, audio, input)
Custom Hooks
Customize application behavior with virtual hooks
UI Integration
Add custom ImGui dialogs and overlays