
Unified Raylib API with automatic C-header code generation to produce language bindings, sample applications, and build tooling for creating statically-linked games and streamlined debugging.
AI Disclaimer: THIS PROJECT IS AI SLOP, DO NOT READ THE CODE IF YOU VALUE YOUR EYES. But it works and I would never have bothered writing this myself so now it exists. This is just a project that generates wrappers around other projects, so if it compiles it most likely works all good.
This is a Kotlin Multiplatform expects and actual for Raylib that currently targets JVM and native Desktop. This is
useful because it lets your write small statically linked Raylib games in Kotlin. But also run in the JVM if you want
to use JVM tooling for development (like the portability and debugging tools for example)
Check out the /sample module for an example of how to use. In particular the runJvm command which lets you run in JVM.
But you can copy that entire build.gradle.kts file to get it working on a project. If I can be bothered I might see if I
can include some of the build in the published library.
Here is my very simple platformer game built with this dependency: https://github.com/tom-delalande/strawberrry-platformer
| Platform | Status |
|---|---|
| JVM | ✅ (via Jaylib) |
| macOS (x86_64) | ✅ (via cinterop) |
| macOS (arm64) | ✅ (via cinterop) |
| Linux (x64) | ✅ (via cinterop) |
| Windows (x64) | ✅ (via cinterop) |
| Web (WasmJS) | 🚧 In progress |
The project is structured as follows:
library/ — The core KMP library providing a unified Raylib API across all targets via expect/actual declarations.codegen/ — Code generation tool that parses raylib C headers and generates the Kotlin bindings automatically.sample/ — Sample applications demonstrating usage on different platforms.input/ — raylib C source (git submodule) used as input for code generation and native interop.Add the library as a dependency in your KMP project:
// build.gradle.kts
kotlin {
sourceSets {
commonMain {
dependencies {
implementation("com.raylib.kmp:library:VERSION")
}
}
}
}See the sample/ module for runnable examples.
brew install raylib
./gradlew build# JVM
./gradlew :sample:runJvm
# Native (macOS arm64)
./gradlew :sample:macosArm64MainRunThis project is licensed under the same terms as raylib (zlib/libpng).
AI Disclaimer: THIS PROJECT IS AI SLOP, DO NOT READ THE CODE IF YOU VALUE YOUR EYES. But it works and I would never have bothered writing this myself so now it exists. This is just a project that generates wrappers around other projects, so if it compiles it most likely works all good.
This is a Kotlin Multiplatform expects and actual for Raylib that currently targets JVM and native Desktop. This is
useful because it lets your write small statically linked Raylib games in Kotlin. But also run in the JVM if you want
to use JVM tooling for development (like the portability and debugging tools for example)
Check out the /sample module for an example of how to use. In particular the runJvm command which lets you run in JVM.
But you can copy that entire build.gradle.kts file to get it working on a project. If I can be bothered I might see if I
can include some of the build in the published library.
Here is my very simple platformer game built with this dependency: https://github.com/tom-delalande/strawberrry-platformer
| Platform | Status |
|---|---|
| JVM | ✅ (via Jaylib) |
| macOS (x86_64) | ✅ (via cinterop) |
| macOS (arm64) | ✅ (via cinterop) |
| Linux (x64) | ✅ (via cinterop) |
| Windows (x64) | ✅ (via cinterop) |
| Web (WasmJS) | 🚧 In progress |
The project is structured as follows:
library/ — The core KMP library providing a unified Raylib API across all targets via expect/actual declarations.codegen/ — Code generation tool that parses raylib C headers and generates the Kotlin bindings automatically.sample/ — Sample applications demonstrating usage on different platforms.input/ — raylib C source (git submodule) used as input for code generation and native interop.Add the library as a dependency in your KMP project:
// build.gradle.kts
kotlin {
sourceSets {
commonMain {
dependencies {
implementation("com.raylib.kmp:library:VERSION")
}
}
}
}See the sample/ module for runnable examples.
brew install raylib
./gradlew build# JVM
./gradlew :sample:runJvm
# Native (macOS arm64)
./gradlew :sample:macosArm64MainRunThis project is licensed under the same terms as raylib (zlib/libpng).