The X-Plane SDK 2.0
X-Plane 9 will feature the X-Plane plugin system version 2.0. This is the first major revision of the X-Plane plugin API, and it exposes a number of new features.
The goal of the SDK team with the new 2.0 API was not just to add new features, but to address some of the fundamental limitations of how we add features. Future updates to the API (2.1, 2.2) will be more frequent, but additive to continue backward compatibility. See "new features" below for more details.
Compatibility and Availability
The 2.0 API is an extension of the 1.0 API.
- Binary plugins from the 1.0 SDK should run on X-Plane 9 without modification.
- Plugin source from the 1.0 SDK should compile against the new SDK without modification.
- The new functionality are exposed in the form of new enums and functions. A #define is required to enable use of this functionality.
- Plugins that use the 2.0 interface will only run on a version of X-Plane that supports the 2.0 API. So plugins that want to utilize the new functionality will have to target X-Plane 9.0 or higher.
The implementation of the plugin system continue to ship with X-Plane, so X-Plane 9 will always come supporting a 2.0 SDK. No installation into X-Plane is necessary. The DLLs that ship with X-Plane 9 and enable the 2.0 SDK will not work with X-Plane 8, and vice versa.
You can read more about how the 2.0 SDK is versioned [here|SDKVersioning].
- XPLMFindSymbol allows a plugin to find an SDK API at runtime _if_ it is supported. This will allow plugins to utilize new SDK features when present while falling back on older behavior for older versions of X-Plane. With more frequent API revisions, this will allow new plugin APIs to grow incrementally, similar to how datarefs have worked.
- Fat plugins. A plugin may be packaged in the aircraft folder, with three .xpls inside the folder for Mac, Windows, and Linux.* This means one plugin folder for all platforms. An example file structure and naming convention is shown below. Note: Linux is case sensitive.
Cessna 172SP plugins Note: the lower case "p" MyPluginName Note: plugin name only; no extension win.xpl mac.xpl Note: the use of lower case. lin.xpl
- Plugins in the aircaft folder. An aircraft can have a "plugins" folder - plugins from this folder are loaded when the ACF is loaded (as the user's plane) and unloaded when the ACF is unloaded. These plugins must be fat; an aircraft can be plugin-enabled and still shipped as a package. A message is sent when an aircraft is unloaded for appropriate cleanup of overrides.
- Command API. Plugins have access to X-Plane's internal command system (used for all joystick and keyboard-activated "stuff") and can override, augment, engage, or create new commands. Commands have string names like datarefs, so plugins will have access to new sim commands without SDK API revisions.
ExampleCommandCode ExampleCommandCodeWithCustomDataRef ExampleCommandCodeWithCustomDataRefAndRegistrationInDRE
- Terrain height probe. Plugins can probe the terrain mesh height at any point.
- Graphics. Plugins can use the mouse wheel, control the mouse cursor image, and have extended access to proportional fonts.