Crates.io | xplane-sdk-sys |
lib.rs | xplane-sdk-sys |
version | 0.3.0 |
source | src |
created_at | 2022-12-29 16:17:26.278334 |
updated_at | 2024-06-23 16:20:13.67515 |
description | Low level bindings for the X-Plane SDK |
homepage | |
repository | https://github.com/constvoidptr/xplane-sdk/tree/master/xplane-sdk-sys |
max_upload_size | |
id | 747431 |
size | 1,672,095 |
Low level Rust bindings for the X-Plane SDK.
XPLM400
(X-Plane 12.04 and newer)To generate your own bindings instead of using the pre-built ones, activate the generate-bindings
feature by adding
the following to your Cargo.toml
:
xplane-sdk-sys = { version = "*", features = ["generate-bindings"] }
This will invoke bindgen
at compile-time in a build script to generate the bindings for you. You must specify the
location of the SDK in your filesystem by setting the XPLANE_SDK_PATH
environment variable.
xplane-sdk-sys
inherits the bindgen
requirements. They are
documented here.
When generating bindings yourself you can specify what XPLM versions you would like to use. This not only enables you to target earlier X-Plane versions but also ensures that the library is compatible with future versions.
To achieve this, you need to set the XPLANE_SDK_VERSIONS
environment variable. It expects a semicolon-separated list
of SDK versions. Defining at as XPLM303;XPLM400
, for example, will result in the generation of bindings for SDK
versions 3.0.3
and 4.0.0
respectively.
Please note that SDK versions do not automatically imply older versions. To ensure that the latest version with all features is targeted, it is necessary to specify every version individually.
If you leave the XPLANE_SDK_VERSIONS
environment variable unspecified, the default set of versions used for generating
the pre-built binding will be applied.