Comments on: Plugin Compatibility and New XPLM 3.0 Features https:/2017/09/plugin-compatibility-and-new-xplm-3-0-features/ Developer resources for the X-Plane flight simulator Tue, 26 Sep 2017 00:13:02 +0000 hourly 1 https://wordpress.org/?v=6.6.1 By: Marius https:/2017/09/plugin-compatibility-and-new-xplm-3-0-features/#comment-21921 Tue, 26 Sep 2017 00:13:02 +0000 http://developer.x-plane.com/?p=7862#comment-21921 In reply to Ben Supnik.

Exactly what I meant, thanks. Great news, really looking forward to getting my hands on the new lego brick assets in 11.10 as I have two airfields ready for them.

p.s.: you should get Alex to post on the dev blog too! 😉

]]>
By: sparker https:/2017/09/plugin-compatibility-and-new-xplm-3-0-features/#comment-21919 Mon, 25 Sep 2017 21:47:08 +0000 http://developer.x-plane.com/?p=7862#comment-21919 In reply to Ben Supnik.

Thanks Ben,

The second option looks like it will work quite well for us.

I assume there would also be paths of plugin/lin_x64/plugin.xpl and plugin/mac_x64/plugin.xpl for the other platforms.

Bill

]]>
By: Ben Supnik https:/2017/09/plugin-compatibility-and-new-xplm-3-0-features/#comment-21918 Mon, 25 Sep 2017 13:20:06 +0000 http://developer.x-plane.com/?p=7862#comment-21918 In reply to sparker.

You _can_ make a plugin _dynamically_ use both APIs but it is significantly more work. You would basically need to:

1. Query at runtime which SDK version you have.
2. Pass different size window init structs that are version appropriate.
3. Call any 3.0 API by using XPLMFindSymbol and _not_ linking directly against it.

It is absolutely possible to create a binary that works this way, but the SDK doesn’t have a one-shot #define that gets it for you. The least bad thing I can think of is:

– For window initialization create two separate CPPs with utility functions (create_window_21, create_window_30) and define XPLM_300 in one of them to get the new window create struct.
– Manually create function ptrs to any new 3.0 APIs you need, again maybe in a separate #define XPLM300 file.

There is also a cheap trick you could do: pack the 2.1 plugin into the old packing (plugin/64/win.xpl) and pack the 3.0 plugin into the new packing (plugin/win_x64/plugin.xpl). The new 3.0 search path is higher priority in 11.10 and newer, and the old search path will make old SDKs work.

You’d then just compile your plugin twice, once with XPLM300 on and once with it off and #define your own code around the new APIs.

]]>
By: sparker https:/2017/09/plugin-compatibility-and-new-xplm-3-0-features/#comment-21917 Mon, 25 Sep 2017 12:19:01 +0000 http://developer.x-plane.com/?p=7862#comment-21917 In reply to Ben Supnik.

Hi Ben,

So if I understand correctly if I want our Xchecklist plugin to use the new features from SDK 3.0 for users with hi-DPI/4k monitors we will need two different plugin versions to support both XP10 & XP11?

Thanks Bill

]]>
By: Ben Supnik https:/2017/09/plugin-compatibility-and-new-xplm-3-0-features/#comment-21916 Mon, 25 Sep 2017 11:42:42 +0000 http://developer.x-plane.com/?p=7862#comment-21916 In reply to sparker.

Hi Bill,

Yes – you do that by getting the new SDK and NOT defining XPLM300 to 1 – the SDK then ‘looks’ like the 2.0 SDK to your plugin and provides a binary that X-plane things is 2.0 as well.

We usually keep legacy SDK distributions available for download, e.g. the new SDK can ‘look’ like 3.0, 2.1, 2.0 or 1.0, but it will only generate x86_64 binaries — we don’t have PowerPC DLLs, for example.

]]>
By: sparker https:/2017/09/plugin-compatibility-and-new-xplm-3-0-features/#comment-21915 Mon, 25 Sep 2017 10:54:54 +0000 http://developer.x-plane.com/?p=7862#comment-21915 Is it possible to build a plugin with SDK version 3.0 and also have it work in X-Plane 10.51r2?

How is the bug removing going?

Thanks Bill

]]>
By: Ben Supnik https:/2017/09/plugin-compatibility-and-new-xplm-3-0-features/#comment-21888 Fri, 22 Sep 2017 13:56:05 +0000 http://developer.x-plane.com/?p=7862#comment-21888 In reply to Marius.

It was referring to beta-stopping bugs, and we think we fixed it.

]]>
By: Marius https:/2017/09/plugin-compatibility-and-new-xplm-3-0-features/#comment-21882 Fri, 22 Sep 2017 02:55:32 +0000 http://developer.x-plane.com/?p=7862#comment-21882 Okay, I’ll bite: is that a literal “the last bug” and is that referring to a last bug in the 3.0 SDK, or to 11.10 in general? 😀

]]>