osu-native is a C# NativeAOT library that exposes selected features from osu!(lazer) over a C-declaration FFI. It allows other languages and runtimes to interface with parts of osu!(lazer) without depending on .NET directly.
It is primarily designed to allow the osu!(stable) client to access osu!(lazer)'s difficulty and performance calculation algorithms, but furthermore aims to provide the ability for certain parts of osu! to be integrated in other languages.
Refer to the wiki for more information.
Here is a list of wrappers created for osu-native in other programming languages:
| Language | Author | Package |
|---|---|---|
| Rust | Chiffa | |
| Python | 7mochi | |
| Java | 7mochi | |
| Node | tosuapp |
Note
The listed wrappers are maintained by 3rd-parties, and support for these is not provided via this repository. Please refer to the repository of the wrapper for any help.
The wrappers may not be entirely up-to-date or choose to version their releases differently.
- Beatmap file parsing (providing limited information for demonstration, mostly to be used in other features)
- Full osu!(lazer) mods construction for usage in other features
- Calculation of difficulty and performance attributes in all rulesets
If you would like to see support for more osu!(lazer) features, feel free to open an issue.
osu-native aims to mirror the object-oriented infrastructure of osu!(lazer). Managed .NET objects are created via a function, stored in osu-native, and handles (sometimes whole native objects) are returned that can be used by the caller to refer to the them.
As an example, osu!(lazer)'s FlatWorkingBeatmap is represented by a NativeBeatmap over the FFI, including a handle to refer to the managed object.
In a similar fashion, exception handling aims to offer a similar experience to interaction you would have with osu!(lazer) within the .NET ecosystem. Thrown exceptions' messages and stack trace are directly exposed in error messages. For more information see Error Handling (wiki).
Human contributions are always welcome. If you would like to request a feature, feel free to do so via an issue. If you intend to PR something, discussing it before-hand (eg. via an issue) is appreciated, but not a necessity.
If your changes involve updating the targetted osu!(lazer) version, please check this wiki entry.
If you would like to learn more about the project before getting started on contributing, make sure to check out the wiki as well. It contains some information on the inner workings of osu-native, such as error-handling and source-generation.