# Questions

> What people ask about the framework before they ask anything else: raylib, scenes, main(), targets, saves, players' machines, libraries and licences.

Source: https://omardev29.github.io/rmp-docs/manual/help/faq.html

Short answers, each with a link to where the long one is.

## The framework

### Is it ready to ship a game with?

The framework's own README says that it is experimental and not meant for production. The pipeline is real — every target is built, and every target with a machine to run on is booted and checked for pixels — but the features themselves are young. Test your game on the platforms you ship it to.

### Can I still call raylib?

All of it, from any scene, with nothing to unlock: the framework adds `rmp::` beside raylib and changes none of raylib's functions. A handful of calls are the framework's to make — opening and closing the window, beginning and ending the frame — and [raylib in your game](https://omardev29.github.io/rmp-docs/manual/raylib/raylib.html) lists them and why.

### Do I have to use scenes?

No. [`RMP_GAME`](https://omardev29.github.io/rmp-docs/reference/macros.html#RMP_GAME) is built on a lower-level entry point, [`RMP_ENTRY_POINT`](https://omardev29.github.io/rmp-docs/reference/macros.html#RMP_ENTRY_POINT), which takes three functions of yours and nothing else. The window and the frame are then yours to open and close, as in a plain raylib program, while the framework still writes the right loop for each target, opens the asset pack, samples the input `rmp::input` reads once a frame, clamps the frame time, keeps Escape from closing the window and reports to CI. Many of the framework's examples are written this way:

```cpp
#include <rmp/app.h>

static void on_ready() { InitWindow(RMP_WINDOW_WIDTH, RMP_WINDOW_HEIGHT, RMP_WINDOW_TITLE); }

static void on_frame(float delta) {
    static float seconds = 0;
    seconds += delta;
    BeginDrawing();
    ClearBackground(RAYWHITE);
    DrawText(TextFormat("%.1f s", seconds), 20, 20, 20, DARKGRAY);
    EndDrawing();
}

static void on_exit() { CloseWindow(); }

RMP_ENTRY_POINT(on_ready, on_frame, on_exit);
```

### Can I write my own `main()`?

In plain C, yes: a game whose `src/` holds no C++, and no `src/rmp/`, is linked against raylib alone, and its `main()` is its own — on the targets where a program owns its loop, which the web and iOS are not. See [Plain C](https://omardev29.github.io/rmp-docs/manual/raylib/plain-c.html). In C++ with the framework, the entry-point macro writes `main()` for you, and a second one is a link error.

### Does it use exceptions?

No. Nothing of the framework's throws to your code. A load that finds nothing gives an empty handle that draws nothing; [`rmp::app::quit()`](https://omardev29.github.io/rmp-docs/reference/namespaces/rmp-app.html#quit) raises a flag the loop reads; a mistake it can see is said once in the log. Where a standard-library call inside it can throw, the framework catches it and turns it into a value — three places in `rmp::save`.

### Which C++?

C++20, with designated initialisers throughout: the options of a call are written by name — `rmp::ui::begin({ .placement = rmp::ui::Align::TOP_LEFT })` — in the order the struct declares them. Out of order is a compile error with every compiler the framework builds with: GCC and MSVC refuse it themselves, and every build gives Clang `-Werror=reorder-init-list` — CMake, Android and the generated Xcode project alike. A plain C game is C99.

## Targets

### Which platforms does it build for?

17 targets: Linux x86-64, Linux ARM64, Linux RISC-V, Linux x86-64 (musl / Alpine), Windows x86-64, Windows ARM64, macOS (universal), iOS (simulator), Web (WebAssembly), Android, FreeBSD x86-64, FreeBSD ARM64, OpenBSD x86-64, OpenBSD ARM64, NetBSD x86-64, Linux DRM/KMS (no X11), Linux ARM64 DRM/KMS (no X11). A game turns any of them off in `[targets]`. See [Platforms](https://omardev29.github.io/rmp-docs/manual/platforms/index.html).

### Can I build for a platform I do not have?

CI builds every target a game enables, on GitHub's runners, so a release has all of them whatever machine you work on. On your own machine you build for that machine, for the web with the Emscripten SDK, and for Android with the Android SDK and NDK. iOS needs a Mac with Xcode, and a real iPhone needs an Apple Developer account as well.

### Which targets does a push build?

Linux x86-64, the web, Windows x86-64 and Android, in about ten minutes. A release tag builds every enabled target. See [what CI does with each target](https://omardev29.github.io/rmp-docs/manual/platforms/index.html#what-ci-does-with-each-target).

### Do I need GitHub?

Not to build or play the game: `rmp run` and `rmp build release` work on your machine alone. The CI and the release pipeline that come with every game are GitHub Actions workflows, so building every target, and publishing, happens on GitHub.

### Does it run on a Raspberry Pi?

There is a target made for one with no desktop installed: `linux-arm64-glibc-drm`, which draws straight to the screen. CI builds it and checks it is an ARM64 binary linked against libdrm, and does not run it, because what it is for is the Pi's own display hardware, which no runner has. Its glibc floor is the one of the machine that built it, which CI prints whenever it builds it: compare it with the system on your Pi. `linux-arm64-glibc`, the ARM64 desktop build, asks for OpenGL 3.3 like every desktop build, and CI starts it on GitHub's ARM64 runners under a virtual X server, never on a Pi. See [Desktop](https://omardev29.github.io/rmp-docs/manual/platforms/desktop.html).

On the Pi's own console, with no desktop, `rmp run` builds for DRM/KMS as on any Linux console, and starts the game on its screen: see [Linux from a console](https://omardev29.github.io/rmp-docs/manual/platforms/linux-console.html).

## Players

### Do players need to install anything?

No. raylib is linked into the game, and on Windows the compiler's C and C++ runtimes are too, so there are no DLLs to ship: CI reads every `.exe` it ships and fails on an import that is not part of Windows 10. The macOS build opens on macOS 10.15 on Intel and macOS 11 on Apple silicon. A Linux build opens X11 and OpenGL at run time from the system, and needs no glibc newer than `[linux] glibc` — except the RISC-V build, which `[linux] glibc` does not reach and which needs glibc 2.38 or newer. The DRM builds are the other exception: they link libdrm, GBM and EGL directly, and those have to be on the machine that runs them. [Desktop and BSD archives](https://omardev29.github.io/rmp-docs/publishing/desktop.html) has each one.

### Where do saves go?

| Target | Folder |
|---|---|
| Windows | `%APPDATA%\<name>\`, or `saves\` next to the `.exe` with `[save] portable = true` |
| macOS | `~/Library/Application Support/<name>/` |
| Linux and the BSDs | `$XDG_DATA_HOME/<name>/` or `~/.local/share/<name>/`, or `saves/` next to the executable with `[save] portable = true` — except on OpenBSD and NetBSD, which cannot say where the executable is, so the saves stay in the user's folder |
| Web | IndexedDB, as the folder `/rmp_save/<name>/` |
| Android | The app's private storage, in `saves/` |
| iOS | The app's `Library/Application Support/` |

`<name>` is `[project] name`. [`rmp::save::directory()`](https://omardev29.github.io/rmp-docs/reference/namespaces/rmp-save.html#directory) says which folder a running game is using.

### Does a release start from any folder?

Yes. A desktop release reads `./resources/`, and before it reads anything it moves into the executable's folder when there is a `resources/` in it — so a double-click, a shortcut or a terminal somewhere else all find the files the archive put next to it. OpenBSD and NetBSD are the exception: raylib cannot say where the executable is there, so the game reads `resources/` from the folder it was started in, and says so in its log. See [Desktop](https://omardev29.github.io/rmp-docs/manual/platforms/desktop.html#running-a-release-build), and [Troubleshooting](https://omardev29.github.io/rmp-docs/manual/help/troubleshooting.html#a-release-build-finds-nothing) when it finds nothing.

## The project

### Why is there no version in the .toml?

Because it comes from the git tag: `v1.2.3` becomes the Android version name and version code and the iOS app's version, and CI makes the release from that tag, so there is no number in the project to forget to change. The desktop and web builds carry no version inside them. See [Releases](https://omardev29.github.io/rmp-docs/publishing/releases.html).

### How do I make the game smaller?

A release build already drops what it does not call, at link time. Beyond that, `[raylib] disabled_modules` can leave out raylib's 3D models and its audio when the game uses neither — the shapes, textures and text cannot go, because the framework is built on them — and `[upx]` compresses four Linux binaries by default — `linux-x64-glibc`, `linux-arm64-glibc`, `linux-x64-musl` and `linux-x64-glibc-drm`, the ones whose compressed binary CI starts — and the others you add to it. To keep it small once it is, write the sizes down: CI then warns when a binary moves more than 1.5% and fails past 10%. See [the size budget](https://omardev29.github.io/rmp-docs/publishing/ci.html#size-budget).

```toml
[raylib]
disabled_modules = ["rmodels"]
```

The modules do not reach iOS, which links a prebuilt raylib.

### Can I add another library?

Yes, and it is a licence decision before it is a build one. Put it under `thirdparty/` and give it a row in `THIRD_PARTY_LICENSES.md`: `rmp test config` fails on a folder there it does not know, and on a copyleft licence. That row is also how its notice gets into the `LICENSES.txt` every build ships. Then add it to the build — to `CMakeLists.txt`, and, for Android and iOS, to the projects those two build through.

### What licence is my game under?

None that the framework chooses: a game made with `rmp new` has no licence of its own, and picking one is yours. The framework's own code is MIT, and it is built on a copy of raylib, which is zlib-licensed and modified, each change listed beside it. Every build ships `LICENSES.txt` with the notices of everything in it, the framework's included.
