Crates.io | dmsdk |
lib.rs | dmsdk |
version | 0.2.0 |
source | src |
created_at | 2022-12-15 02:40:37.274692 |
updated_at | 2023-01-13 02:23:32.723468 |
description | Rust-friendly wrappers around the Defold dmSDK |
homepage | https://forum.defold.com/t/writing-native-extensions-in-rust/71980?u=justapotota |
repository | https://github.com/JustAPotota/defold-rs |
max_upload_size | |
id | 737578 |
size | 52,313 |
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.
defold-rs
then?It's two main pieces that come together to let you write native extensions in Rust:
defold-rs
- This repository is home to the dmsdk
and dmsdk_ffi
crates. In short, dmsdk_ffi
contains auto-generated bindings to the dmSDK and dmsdk
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.