xplm-sys-lb 0.1.0

X-Plane SDK bindings for Rust.
Documentation
  • Coverage
  • 2.11%
    26 out of 1233 items documented0 out of 38 items with examples
  • Size
  • Source code size: 6.22 MB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 35.07 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 33s Average build duration of successful builds.
  • all releases: 33s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • leecbaker/xplm-lb
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • leecbaker

xplm-sys-lb: Lee Baker's Rust bindings for the X-Plane SDK

Rust bindings to the X-Plane plugin SDK.

This crate contains the XPLM SDK from Laminar, with minor modifications that produce a more Rust-like interface.

SDK versioning

In order to support previous versions of X-Plane, crate features are used to select which API to compile against:

  • xplm4: Support the latest version of X-Plane SDK v4 (4.2.0), supporting X-Plane 12 features (includes xplm3 and xplm2).
  • xplm3: Support the latest version of X-Plane SDK v3 (3.0.3), supporting X-Plane 11 features (includes xplm2).
  • xplm2: Support the latest version of X-Plane SDK v2 (2.1.0), supporting X-Plane 10 features.
  • deprecated: Include SDK features deprecated by Laminar (corresponds to defining XPLM_DEPRECATED).

For more details on what's included in each feature, the actual compiler flags are in build.rs along with some information about which X-Plane versions they correspond to.

As new versions of the SDK come out, I'll update this crate with support.

Changes to the XPLM SDK

There are a number of changes to the XPLM SDK to fix bugs, or better support Rust interfaces:

  • Enums have generally been converted from using C int types to using C enum so that bindgen's rustified_enum() can be used to generate compatible Rust enums.
  • Some SDK functions don't have the #ifdefs to compile for older versions of X-Plane. An incomplete list:
    • XPLMCreateInstance() has no XPLM #ifdef, but does use a XPLMObjectRef parameter which needs SDK 2.0. I've added some.
    • XPLMInstanceSetPosition() has no XPLM #ifdef, but does use a XPLMDrawInfo_t parameter which needs SDK 2.0. I've added some.

I expect to continue making similar trivial changes to the header files that don't break the C interface.

Plugins built on this SDK

This SDK is used to produce my X-Plane plugins, including DataRefTool v2.

Links

Similar projects

I've intentionally put my initials in the name of this crate (xplm-sys-lb) to distinguish it from several other very similar crates which are unfortunately out of date:

  • Sam Crow's original SDK bindings crate xplm-sys, which inspired this crate. At time of writing, the crate was last updated in Nov 2024 for SDK 4.1.0.
  • mkreu/judemille's fork xplm-sys. At time of writing, the crate was last updated in Feb 2024 for SDK 4.0.1.

License

Code for the bindings (ie. everything not in SDK/) is dual licensed under the same license as Rust itself, specifically:

The X-Plane SDK is licensed its own license. See SDK/license.txt for details.