One entry point. Any platform. Command line tool or rendered frame — your
Appclass never has to know the difference.
rapp is a cross-platform application framework that hands you a clean init / update / draw / shutDown lifecycle and gets out of the way. Write your program once as a class, and rapp wires up the window, the message loop, input, threading and tooling on every supported platform.
It is heavily based on the bgfx examples entry point (source here), and graphics code is still bgfx based — but with a twist.
The dependency on bx and bgfx has been removed by aggressively copying code, plus a special feature of the build system that lets the same library live in one 'solution' under different configurations.
In the screenshot below, the first sample (command line) links against rapp and rbase, while the second (graphics) links against rapp_bgfx, rbase, bx, bimg and bgfx — all automated.
Thanks to the multiple-configurations-per-project feature of build, the script that makes this happen is tiny — see it here. It basically just flips a library-wide define.
A complete command-line application is just a class. Define the lifecycle, register it, and you're running:
#include <rapp/inc/rapp.h>
struct CmdLineApp : public rapp::App
{
RAPP_CLASS(CmdLineApp)
int init(int32_t /*_argc*/, const char* const* /*_argv*/, rtmLibInterface* /*_libInterface*/)
{
static const rapp::InputBinding bindings[] =
{
{ 0, "exit", 1, { rapp::KeyboardKey::KeyQ, rapp::KeyboardModifier::LCtrl }},
RAPP_INPUT_BINDING_END
};
rapp::inputAddBindings("bindings", bindings);
rapp::cmdAdd("exit", cmdExit);
return 0;
}
void update(float /*_time*/) {}
void draw(float /*_alpha*/) {}
void suspend() {}
void resume() {}
void shutDown()
{
rapp::inputRemoveBindings("bindings");
}
static int cmdExit(App* _app, void* /*_userData*/, int /*_argc*/, char const* const* /*_argv*/)
{
_app->quit();
return 0;
}
};
RAPP_REGISTER(CmdLineApp, "Command line", "Example of command line application");That same App interface scales straight up to a full bgfx graphics application — see the samples directory for command line, task system, bgfx rendering, multiple-apps-in-one-binary and profiler examples.
rapp currently has the following functionality:
- Applications written as classes with init/shutdown/suspend/resume functionality
- Command line (tools, unit tests, etc.) or graphics applications (games, etc.)
- Custom commands
- Input controllers (mouse, keyboard, gamepad, etc.) with input binding callbacks and debug visualizations
- Ability to run code on main/message loop thread
- Job scheduler with job stealing for fine grained parallelism
- ImGui and NanoVG integration
- Quake like console - ImGui based
- Built-in rprof CPU profiler
- Multiple applications in one binary
- Window functions
rprof CPU profiler is an optional dependency and needs to be explicitly requested when generating project files, for example:
GENie --with-rprof vs2022
Here's a screenshot of a bgfx sample showing input debugging, an ImGui dialog and the Quake-like console, as well as a NanoVG shape (eyes):
| Input (KMG) | Threading | Console | Graphics | |
|---|---|---|---|---|
| Windows | ✓✓✓ | ✓ | ✓ | ✓ |
| Xbox One | ✓✓✓ | ✓ | ✓ | ✓ |
| PlayStation 4 | ✓✓✓ | ✓ | ✓ | ✓ |
| Linux | ✓✓X | ✓ | ✓ | ✓ |
| Android | XXX | ✓ | ? | ✓ |
| OSX | ✓✓X | ✓ | ✓ | ✓ |
| Emscripten | ✓✓✓ | X | ✓ | ✓ |
✓ - Working
X - Not yet implemented
? - Not supported
Platforms with partial implementations or not tested: iOS, UWP, FreeBSD
Input (KMG) stands for Keyboard, Mouse and Gamepad
You can get the latest source code by cloning it from github:
git clone https://github.com/RudjiGames/rapp.git
There's quite a few dependencies and they can be fetched manually or using a batch file. For the list of dependencies please refer to the batch file.
Once dependencies are cloned, the GENie project generator tool can be used to generate project files/solution. This batch file is an example of generating a solution and project files for VS2022.
Copyright 2025 Milos Tosic. All rights reserved.
https://github.com/RudjiGames/rapp
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
EVENT SHALL COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.