# Licences

> The framework is MIT and built on a modified raylib; every library it carries is on record with its licence, checked on every build, and credited in a LICENSES.txt that ships with the game. What that means for a game made with it.

Source: https://omardev29.github.io/rmp-docs/framework/licences.html

The framework is free software under the MIT licence, and it is built on raylib, whose zlib licence it keeps. Everything else it carries — the layout engine, the JSON reader, the packer, the libraries raylib itself bundles — is on record with its licence, checked on every build, and credited in a `LICENSES.txt` that ships with every package of your game. The short version of what a game owes: keep that file with it, which the release builds do for you.

## The framework: MIT

The framework's own code — what is under `src/rmp/` and `include/rmp/`, the tools and the build files — is under the MIT licence in its `LICENSE` file. A game may use it, change it, sell what it makes with it and keep its own code closed. MIT asks one thing in return: that its copyright notice and licence text travel with copies of the software, which is what the generated notice below does.

In a game made with [`rmp new`](https://omardev29.github.io/rmp-docs/reference/commands.html#new), the framework's licence is not at the root of the repository. It sits in `thirdparty/raylib_multiplatform/LICENSE`, as a component of the game like every other one, because a `LICENSE` at the root would say the whole game is MIT. The game's own code is its author's, under whatever licence they choose, or none.

## raylib, modified

raylib is by Ramon Santamaria and is under the zlib/libpng licence. The framework is built on it, is not affiliated with or endorsed by the raylib project, and ships a modified copy. The zlib licence asks three things, and the second is the one that matters here: an altered version must be plainly marked as altered, and not presented as the original.

So it is marked. [`thirdparty/raylib/PATCHES.md`](https://github.com/omardev29/raylib_multiplatform/blob/982bf2a1e307c49776bff84211260703b8de6895/thirdparty/raylib/PATCHES.md) says in its first line that the copy is modified, and lists every change by file, line, where it comes from and why. The copy is raylib 6.2 as raylib_cmake_template carries it — raylib's own fixes from after 6.2 brought back, and the gaps its security audit left closed — and the framework's patches on top: build-system and platform-selection changes, so the windowing backend can be chosen from the `.toml`; one that makes Android's EGL ask for the OpenGL ES version raylib was compiled for; the DRM backend's card probe, Escape on its terminal and no flow control; and one fix of the framework's own in the software renderer, which upstream does not have: its nearest-texel lookup is clamped to the texture, so the far edge of a texture reads its last texel and not the one past it. Each change is also commented at its site, and no document of the framework may describe its raylib as unchanged.

## Everything it carries

Every vendored component has a row in the `components` block of `THIRD_PARTY_LICENSES.md`: its licence, which alternative the project takes when the upstream offers a choice, whether the copy is modified, which platforms it reaches, and where its licence text is. The main ones:

| Component | Licence | Copy | Reaches |
|---|---|---|---|
| raylib | zlib | modified | every platform |
| Clay, under `rmp::ui` | zlib | modified: one line, a C++ version check | every platform |
| cute_tiled, for Tiled maps | zlib or Unlicense — the Unlicense is taken | modified | every platform |
| cute_aseprite, for sprite sheets | zlib or Unlicense — the Unlicense is taken | unmodified | every platform |
| raylib-cpp, behind `rmp/math.h` | zlib | the math headers only | every platform |
| rres, the resource pack | MIT | unmodified | every platform |
| cJSON, under saves and LDtk maps | MIT | unmodified | every platform |
| Monocypher, which seals a save | BSD-2 or CC0 — CC0 is taken | unmodified | every platform |
| tiny-AES-c, for an encrypted pack | Unlicense | unmodified | every platform |
| raymob, the Android glue | MIT | modified | Android only |
| raylib-iOS and ANGLE | zlib; BSD-3 | unmodified | iOS only |
| the rest of what raylib bundles: GLFW, miniaudio, the stb libraries, the decoders and loaders | zlib, MIT, public domain and similar | unmodified | where raylib uses them |
| rlsw, raylib's software renderer; RGFW; tinyobj_loader_c | MIT; zlib; MIT | modified: a fix of the framework's own; the gamepad code on older kernel headers; raylib's own OBJ face fix, newer than the release | rlsw and tinyobj_loader_c everywhere, RGFW on the desktop |
| doctest | MIT | unmodified | nowhere: the tests only, the framework's and a game's own |
| RapidCheck | BSD-2 | unmodified | nowhere: the framework's property tests only, and left out of a game |

Where an upstream offers a choice, the project takes the alternative that owes the least, and says so in the file, so the choice is a decision on record rather than something inferred from a build. Where it has altered a component, that component's directory has its own `PATCHES.md`, as raylib does — even under MIT, which does not ask for one, because a reader should not need to know which licence imposes what.

## A new dependency is a licence decision

That block is not documentation that can fall behind. `tools/license_db.py --check` runs in the `config` stage of `rmp test`, in the framework and in every game, and compares three things:

- **The tree and the record, both ways.** A component in `thirdparty/` with no row fails, and so does a row whose component is gone.
- **The record and the text.** Each row's licence text is found on disk and recognised, and it has to say what the row says: a row cannot claim MIT for a file that says GPL.
- **The rules.** A copyleft licence fails — GPL, AGPL, MPL and the rest, and LGPL too, because LGPL's way out is dynamic linking, which a static build and iOS do not have. A non-commercial licence fails. A licence the tool cannot recognise fails. And a zlib or Apache component, whose licence asks for changes to be marked, is either pinned unmodified by its sha256 in `thirdparty/FROZEN_VERSIONS.md` or marked modified with a `PATCHES.md` beside it.

So adding a library to a game is adding a row to `THIRD_PARTY_LICENSES.md`, and forgetting to is a red test, not a missing credit discovered after release.

## LICENSES.txt, generated

The same block is what `configure.py` generates the shipped notice from. There is one `LICENSES.txt` per family of packages — the desktop packages, the web package, the Android app, the iOS app — and each holds exactly the components that reach that family: the Android notice credits raymob and no other does; GLFW is in the desktop notice and in neither the web nor the Android one, because the browser build talks to Emscripten's own JavaScript GLFW and contains no GLFW code; doctest and anything not compiled into a game are in none. Each component's licence is reproduced in full, under a line saying whether this build's copy is unmodified, modified or partial; a public-domain component, which owes no notice, gets a line saying so and where it comes from instead. The framework's own MIT notice is in all of them, and the file opens by saying the game is built on raylib, is not affiliated with it, and uses a modified copy.

Where it goes:

- **Desktop and the BSDs:** next to the executable in every package the release builds.
- **The web:** in the package, beside the page and the `.wasm`.
- **Android:** inside the APK and the App Bundle, among the app's assets.
- **iOS:** at the root of the app bundle.

A component whose licence text cannot be found stops the configure step: a missing notice is a licence problem, and the moment to act on it is before anything is built.

The iOS notice credits the raylib-iOS fork the app is built on, so it is never written without that checkout. A plain configure with `ios` among the targets and the checkout missing warns and writes no iOS notice; the iOS build in CI configures with `--require-notices`, which turns that warning into a refusal, rather than ship an app with no notice or one with the fork missing from it.

## What a game owes

The licences the framework carries are all permissive: none of them asks a game to publish its source. What most of them ask is credit — their notice, kept with copies of the software — and the default does that.

- **Ship `LICENSES.txt` with the game.** The release builds put it where it belongs; leave [`[deploy]
licenses`](https://omardev29.github.io/rmp-docs/reference/configuration.html#deploy-licenses) at its default and there is nothing else to do.
- **Or give the credits inside the game.** A credits screen that reproduces the same notices satisfies the same licences, and then a loose text file next to the executable is only noise. Turning the file off says where the credits are instead, and `configure.py` will not take one without the other:

```toml
[deploy]
licenses = false
```

```text
  raylib_multiplatform.toml:2: licenses = false
                               ^^^^^^^^^^^^^^^^

  configure: error: [deploy] licenses = false removes LICENSES.txt from every package, and it is the only third-party notice the game ships.
                    Say where the credits are instead: credits_note = "the Credits scene, from the main menu". If there is no such scene, leave licenses = true.
```

raylib_multiplatform.toml

```toml
[deploy]
licenses = false
credits_note = "the Credits scene, from the main menu"
```

- **Record what you add.** A library added under `thirdparty/` needs its row in `THIRD_PARTY_LICENSES.md`; `rmp test` says so if it is missing, and the generated notice credits it from then on.
- **Your art and sound are yours to license.** The notice covers code. The picture a new game starts with, `resources/rabbit.png`, is from Kenney's Animal Pack under CC0, and `resources/License.txt` beside it says so; whatever you put in `resources/` after that, its terms are between you and its author.
