Tools for creating Defold native extensions in Rust.
You will need:
Follow the instructions in the build server's README to get it built and running. Once it's up, open the template project in Defold and open /myextension/src
in a Rust-compatible IDE. To tell Defold to use your build server, select File > Preferences > Extensions
and set Build Server
to http://localhost:9000
. Once that's done, you can just press Ctrl+B
in Defold to begin compiling your project! The first build will take some time while it downloads files from Defold's servers and compiles the crate from scratch.
Defold is a free and open-source game engine focused on making fast, lightweight games for desktop, web, mobile, and console with zero setup. Almost all game logic is written in Lua scripts, but the engine also provides a way to extend its functionality with C++ using native extensions.
Native extensions allow you to extend Defold's functionality using C++ or any platform-specific language. You can write extensions in JavaScript for web games, Java for Android, or Objective-C for macOS/iOS. Defold's extension SDK (dmSDK for short) grants you much deeper control of the engine than standard Lua scripts and is great for performance-sensitive processing.
It's two main pieces that come together to let you write native extensions in Rust:
defold-rs
- This repository is home to thedmsdk
anddmsdk_ffi
crates. In short,dmsdk_ffi
contains auto-generated bindings to the dmSDK anddmsdk
wraps those unsafe bindings into a nice Rust-y package.defold-rs-extender
- A fork of Defold's extension build server with added Rust support. You'll need to run one of these yourself in order to use this project.