Rust bindings for Orbiter 2016 Space Flight Simulator API.
- Install Orbiter 2016 Space Flight Simulator
- Install Rust
- Install
i686-pc-windows-msvc
target for Rust withrustup target add i686-pc-windows-msvc
- Set the
ORBITER_DIR
orORBITER_SDK
environment variable. In PowerShell, you can do$env:ORBITER_DIR = "<absolute_path_to_orbiter>"
for example.ORBITER_DIR
: points to the root of your Orbiter installation (whereorbiter.exe
can be found).ORBITER_SDK
: points to theOrbitersdk
directory of your Orbiter installation.- Note:
ORBITER_SDK
always take precedence toORBITER_DIR
.
- Create a new Rust project with
cargo new <project_name>
- In the
Cargo.toml
, add the following:[lib] crate-type = ["cdylib"] [dependencies] orbiter = { git = "https://github.com/emgre/orbiter-rs" }
- Add a
.cargo/config.toml
with the following content:[build] target = "i686-pc-windows-msvc" rustflags = [ "-Ctarget-feature=+crt-static", # Static CRT "-Clink-args=/NODEFAULTLIB:msvcrt.lib" # Avoid conflicts generated in OrbiterSDK ]
- Write your code, build it and copy the DLL in Orbiter for fun! Check the module example for inspiration.
Licensed under the MIT license. See LICENSE.md for more details.
Orbiter Space Flight Simulator (not included here) is licensed under a different license.
Copyright 2020 Émile Grégoire