diff --git a/CHANGELOG.md b/CHANGELOG.md index fadb602..5e41b90 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # xplm-sys changelog +## 0.5.2 - yyyy-mm-dd + +* Updated X-Plane SDK to version 4.2.0 + ## 0.5.1 - 2024-11-13 * Updated X-Plane SDK to version 4.1.1 diff --git a/Cargo.toml b/Cargo.toml index fa69135..846daf7 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "xplm-sys" -version = "0.5.1" +version = "0.5.2" authors = ["Sam Crow "] description = "Low-level bindings for the X-Plane plugin SDK" repository = "https://github.com/samcrow/xplm-sys" diff --git a/README.md b/README.md index 04fe1b2..25b0814 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,7 @@ This library provides Rust bindings to the X-Plane plugin SDK. ## SDK versions ## -This crate supports SDK version 4.0.1, which is supported on X-Plane 12.04 and later. Plugins can be used with earlier X-Plane versions as long as they do not use newer APIs. +This crate supports SDK version 4.3.0, which is supported on X-Plane 12.4.0 and later. Plugins can be used with earlier X-Plane versions as long as they do not use newer APIs. Some features in earlier versions of the SDK have been removed. This library currently does not provide a way to access them. diff --git a/SDK/CHeaders/Widgets/XPStandardWidgets.h b/SDK/CHeaders/Widgets/XPStandardWidgets.h index 1903e87..f185960 100644 --- a/SDK/CHeaders/Widgets/XPStandardWidgets.h +++ b/SDK/CHeaders/Widgets/XPStandardWidgets.h @@ -2,7 +2,7 @@ #define _XPStandardWidgets_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -44,9 +44,7 @@ extern "C" { * */ - #define xpWidgetClass_MainWindow 1 - /* * Main Window Type Values * @@ -62,7 +60,6 @@ enum { }; - /* * Main Window Properties * @@ -78,7 +75,6 @@ enum { }; - /* * MainWindow Messages * @@ -89,7 +85,6 @@ enum { }; - /*************************************************************************** * SUB WINDOW ***************************************************************************/ @@ -100,9 +95,7 @@ enum { * */ - #define xpWidgetClass_SubWindow 2 - /* * SubWindow Type Values * @@ -121,7 +114,6 @@ enum { }; - /* * SubWindow Properties * @@ -133,7 +125,6 @@ enum { }; - /*************************************************************************** * BUTTON ***************************************************************************/ @@ -157,9 +148,7 @@ enum { * */ - #define xpWidgetClass_Button 3 - /* * Button Types * @@ -187,7 +176,6 @@ enum { }; - /* * Button Behavior Values * @@ -212,7 +200,6 @@ enum { }; - /* * Button Properties * @@ -232,7 +219,6 @@ enum { }; - /* * Button Messages * @@ -258,7 +244,6 @@ enum { }; - /*************************************************************************** * TEXT FIELD ***************************************************************************/ @@ -281,9 +266,7 @@ enum { * */ - #define xpWidgetClass_TextField 4 - /* * Text Field Type Values * @@ -304,7 +287,6 @@ enum { }; - /* * Text Field Properties * @@ -345,7 +327,6 @@ enum { }; - /* * Text Field Messages * @@ -357,7 +338,6 @@ enum { }; - /*************************************************************************** * SCROLL BAR ***************************************************************************/ @@ -368,9 +348,7 @@ enum { * */ - #define xpWidgetClass_ScrollBar 5 - /* * Scroll Bar Type Values * @@ -386,7 +364,6 @@ enum { }; - /* * Scroll Bar Properties * @@ -413,7 +390,6 @@ enum { }; - /* * Scroll Bar Messages * @@ -425,7 +401,6 @@ enum { }; - /*************************************************************************** * CAPTION ***************************************************************************/ @@ -436,9 +411,7 @@ enum { * */ - #define xpWidgetClass_Caption 6 - /* * Caption Properties * @@ -450,7 +423,6 @@ enum { }; - /*************************************************************************** * GENERAL GRAPHICS ***************************************************************************/ @@ -460,9 +432,7 @@ enum { * */ - #define xpWidgetClass_GeneralGraphics 7 - /* * General Graphics Types Values * @@ -510,7 +480,6 @@ enum { }; - /* * General Graphics Properties * @@ -521,7 +490,6 @@ enum { }; - /*************************************************************************** * PROGRESS INDICATOR ***************************************************************************/ @@ -531,7 +499,6 @@ enum { */ #define xpWidgetClass_Progress 8 - /* * Progress Indicator Properties * @@ -548,7 +515,6 @@ enum { }; - #ifdef __cplusplus } #endif diff --git a/SDK/CHeaders/Widgets/XPUIGraphics.h b/SDK/CHeaders/Widgets/XPUIGraphics.h index 83ed302..dc4969d 100644 --- a/SDK/CHeaders/Widgets/XPUIGraphics.h +++ b/SDK/CHeaders/Widgets/XPUIGraphics.h @@ -2,7 +2,7 @@ #define _XPUIGraphics_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -12,6 +12,7 @@ ***************************************************************************/ #include "XPWidgetDefs.h" +#include "XPLMGraphics.h" #ifdef __cplusplus extern "C" { @@ -61,7 +62,6 @@ enum { }; typedef int XPWindowStyle; - /* * XPDrawWindow * @@ -77,7 +77,6 @@ WIDGET_API void XPDrawWindow( int inX2, int inY2, XPWindowStyle inStyle); - /* * XPGetWindowDefaultDimensions * @@ -89,7 +88,6 @@ WIDGET_API void XPGetWindowDefaultDimensions( XPWindowStyle inStyle, int * outWidth, /* Can be NULL */ int * outHeight); /* Can be NULL */ - /* * XPElementStyle * @@ -216,7 +214,6 @@ enum { }; typedef int XPElementStyle; - /* * XPDrawElement * @@ -234,7 +231,6 @@ WIDGET_API void XPDrawElement( int inY2, XPElementStyle inStyle, int inLit); - /* * XPGetElementDefaultDimensions * @@ -248,7 +244,6 @@ WIDGET_API void XPGetElementDefaultDimensions( int * outWidth, /* Can be NULL */ int * outHeight, /* Can be NULL */ int * outCanBeLit); /* Can be NULL */ - /* * XPTrackStyle * @@ -278,7 +273,6 @@ enum { }; typedef int XPTrackStyle; - /* * XPDrawTrack * @@ -299,7 +293,6 @@ WIDGET_API void XPDrawTrack( int inValue, XPTrackStyle inTrackStyle, int inLit); - /* * XPGetTrackDefaultDimensions * @@ -312,7 +305,6 @@ WIDGET_API void XPGetTrackDefaultDimensions( XPTrackStyle inStyle, int * outWidth, int * outCanBeLit); - /* * XPGetTrackMetrics * @@ -345,7 +337,6 @@ WIDGET_API void XPGetTrackMetrics( int * outThumbSize, int * outUpPageSize, int * outUpBtnSize); - #ifdef __cplusplus } #endif diff --git a/SDK/CHeaders/Widgets/XPWidgetDefs.h b/SDK/CHeaders/Widgets/XPWidgetDefs.h index a4fc1ba..18cd222 100644 --- a/SDK/CHeaders/Widgets/XPWidgetDefs.h +++ b/SDK/CHeaders/Widgets/XPWidgetDefs.h @@ -2,7 +2,7 @@ #define _XPWidgetDefs_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -61,7 +61,6 @@ extern "C" { * */ - /* * XPWidgetID * @@ -72,7 +71,6 @@ extern "C" { * */ typedef void * XPWidgetID; - /* * XPWidgetPropertyID * @@ -124,7 +122,6 @@ enum { }; typedef int XPWidgetPropertyID; - /* * XPMouseState_t * @@ -142,7 +139,6 @@ typedef struct { int delta; #endif /* XPLM200 */ } XPMouseState_t; - /* * XPKeyState_t * @@ -159,7 +155,6 @@ typedef struct { /* The virtual key code for the key */ char vkey; } XPKeyState_t; - /* * XPWidgetGeometryChange_t * @@ -174,7 +169,6 @@ typedef struct { int dwidth; int dheight; } XPWidgetGeometryChange_t; - /* * XPDispatchMode * @@ -206,7 +200,6 @@ enum { }; typedef int XPDispatchMode; - /* * XPWidgetClass * @@ -216,11 +209,9 @@ typedef int XPDispatchMode; * */ typedef int XPWidgetClass; - /* An unspecified widget class. Other widget classes are in * * XPStandardWidgets.h */ #define xpWidgetClass_None 0 - /*************************************************************************** * WIDGET MESSAGES ***************************************************************************/ @@ -443,7 +434,6 @@ enum { }; typedef int XPWidgetMessage; - /*************************************************************************** * WIDGET CALLBACK FUNCTION ***************************************************************************/ @@ -464,7 +454,6 @@ typedef int (* XPWidgetFunc_t)( XPWidgetID inWidget, intptr_t inParam1, intptr_t inParam2); - #ifdef __cplusplus } #endif diff --git a/SDK/CHeaders/Widgets/XPWidgetUtils.h b/SDK/CHeaders/Widgets/XPWidgetUtils.h index 60e4b95..ccf5833 100644 --- a/SDK/CHeaders/Widgets/XPWidgetUtils.h +++ b/SDK/CHeaders/Widgets/XPWidgetUtils.h @@ -2,7 +2,7 @@ #define _XPWidgetUtils_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -69,7 +69,6 @@ extern "C" { #define IN_RECT(x, y, l, t, r, b) \ (((x) >= (l)) && ((x) <= (r)) && ((y) >= (b)) && ((y) <= (t))) - /* * XPWidgetCreate_t * @@ -101,14 +100,10 @@ typedef struct { int containerIndex; XPWidgetClass widgetClass; } XPWidgetCreate_t; - #define NO_PARENT -1 - #define PARAM_PARENT -2 - #define WIDGET_COUNT(x) ((sizeof(x) / sizeof(XPWidgetCreate_t))) - -/* + /* * XPUCreateWidgets * * This function creates a series of widgets from a table (see @@ -130,7 +125,6 @@ WIDGET_API void XPUCreateWidgets( int inCount, XPWidgetID inParamParent, XPWidgetID * ioWidgets); - /* * XPUMoveWidgetBy * @@ -142,7 +136,6 @@ WIDGET_API void XPUMoveWidgetBy( XPWidgetID inWidget, int inDeltaX, int inDeltaY); - /*************************************************************************** * LAYOUT MANAGERS ***************************************************************************/ @@ -153,7 +146,6 @@ WIDGET_API void XPUMoveWidgetBy( * */ - /* * XPUFixedLayout * @@ -167,7 +159,6 @@ WIDGET_API int XPUFixedLayout( XPWidgetID inWidget, intptr_t inParam1, intptr_t inParam2); - /*************************************************************************** * WIDGET PROC BEHAVIORS ***************************************************************************/ @@ -178,7 +169,6 @@ WIDGET_API int XPUFixedLayout( * */ - /* * XPUSelectIfNeeded * @@ -193,7 +183,6 @@ WIDGET_API int XPUSelectIfNeeded( intptr_t inParam1, intptr_t inParam2, int inEatClick); - /* * XPUDefocusKeyboard * @@ -207,7 +196,6 @@ WIDGET_API int XPUDefocusKeyboard( intptr_t inParam1, intptr_t inParam2, int inEatClick); - /* * XPUDragWidget * @@ -225,7 +213,6 @@ WIDGET_API int XPUDragWidget( int inTop, int inRight, int inBottom); - #ifdef __cplusplus } #endif diff --git a/SDK/CHeaders/Widgets/XPWidgets.h b/SDK/CHeaders/Widgets/XPWidgets.h index f09885a..0742560 100644 --- a/SDK/CHeaders/Widgets/XPWidgets.h +++ b/SDK/CHeaders/Widgets/XPWidgets.h @@ -2,7 +2,7 @@ #define _XPWidgets_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -119,7 +119,6 @@ WIDGET_API XPWidgetID XPCreateWidget( int inIsRoot, XPWidgetID inContainer, XPWidgetClass inClass); - /* * XPCreateCustomWidget * @@ -140,7 +139,6 @@ WIDGET_API XPWidgetID XPCreateCustomWidget( int inIsRoot, XPWidgetID inContainer, XPWidgetFunc_t inCallback); - /* * XPDestroyWidget * @@ -155,7 +153,6 @@ WIDGET_API XPWidgetID XPCreateCustomWidget( WIDGET_API void XPDestroyWidget( XPWidgetID inWidget, int inDestroyChildren); - /* * XPSendMessageToWidget * @@ -179,7 +176,6 @@ WIDGET_API int XPSendMessageToWidget( XPDispatchMode inMode, intptr_t inParam1, intptr_t inParam2); - /*************************************************************************** * WIDGET POSITIONING AND VISIBILITY ***************************************************************************/ @@ -205,7 +201,6 @@ WIDGET_API int XPSendMessageToWidget( WIDGET_API void XPPlaceWidgetWithin( XPWidgetID inSubWidget, XPWidgetID inContainer); - /* * XPCountChildWidgets * @@ -214,7 +209,6 @@ WIDGET_API void XPPlaceWidgetWithin( */ WIDGET_API int XPCountChildWidgets( XPWidgetID inWidget); - /* * XPGetNthChildWidget * @@ -226,7 +220,6 @@ WIDGET_API int XPCountChildWidgets( WIDGET_API XPWidgetID XPGetNthChildWidget( XPWidgetID inWidget, int inIndex); - /* * XPGetParentWidget * @@ -236,7 +229,6 @@ WIDGET_API XPWidgetID XPGetNthChildWidget( */ WIDGET_API XPWidgetID XPGetParentWidget( XPWidgetID inWidget); - /* * XPShowWidget * @@ -247,7 +239,6 @@ WIDGET_API XPWidgetID XPGetParentWidget( */ WIDGET_API void XPShowWidget( XPWidgetID inWidget); - /* * XPHideWidget * @@ -257,7 +248,6 @@ WIDGET_API void XPShowWidget( */ WIDGET_API void XPHideWidget( XPWidgetID inWidget); - /* * XPIsWidgetVisible * @@ -268,7 +258,6 @@ WIDGET_API void XPHideWidget( */ WIDGET_API int XPIsWidgetVisible( XPWidgetID inWidget); - /* * XPFindRootWidget * @@ -278,7 +267,6 @@ WIDGET_API int XPIsWidgetVisible( */ WIDGET_API XPWidgetID XPFindRootWidget( XPWidgetID inWidget); - /* * XPBringRootWidgetToFront * @@ -291,7 +279,6 @@ WIDGET_API XPWidgetID XPFindRootWidget( */ WIDGET_API void XPBringRootWidgetToFront( XPWidgetID inWidget); - /* * XPIsWidgetInFront * @@ -302,7 +289,6 @@ WIDGET_API void XPBringRootWidgetToFront( */ WIDGET_API int XPIsWidgetInFront( XPWidgetID inWidget); - /* * XPGetWidgetGeometry * @@ -316,7 +302,6 @@ WIDGET_API void XPGetWidgetGeometry( int * outTop, /* Can be NULL */ int * outRight, /* Can be NULL */ int * outBottom); /* Can be NULL */ - /* * XPSetWidgetGeometry * @@ -329,7 +314,6 @@ WIDGET_API void XPSetWidgetGeometry( int inTop, int inRight, int inBottom); - /* * XPGetWidgetForLocation * @@ -354,7 +338,6 @@ WIDGET_API XPWidgetID XPGetWidgetForLocation( int inYOffset, int inRecursive, int inVisibleOnly); - /* * XPGetWidgetExposedGeometry * @@ -373,7 +356,6 @@ WIDGET_API void XPGetWidgetExposedGeometry( int * outTop, /* Can be NULL */ int * outRight, /* Can be NULL */ int * outBottom); /* Can be NULL */ - /*************************************************************************** * ACCESSING WIDGET DATA ***************************************************************************/ @@ -393,7 +375,6 @@ WIDGET_API void XPGetWidgetExposedGeometry( WIDGET_API void XPSetWidgetDescriptor( XPWidgetID inWidget, const char * inDescriptor); - /* * XPGetWidgetDescriptor * @@ -410,7 +391,6 @@ WIDGET_API int XPGetWidgetDescriptor( XPWidgetID inWidget, char * outDescriptor, int inMaxDescLength); - /* * XPGetWidgetUnderlyingWindow * @@ -424,7 +404,6 @@ WIDGET_API int XPGetWidgetDescriptor( */ WIDGET_API XPLMWindowID XPGetWidgetUnderlyingWindow( XPWidgetID inWidget); - /* * XPSetWidgetProperty * @@ -436,7 +415,6 @@ WIDGET_API void XPSetWidgetProperty( XPWidgetID inWidget, XPWidgetPropertyID inProperty, intptr_t inValue); - /* * XPGetWidgetProperty * @@ -451,7 +429,6 @@ WIDGET_API intptr_t XPGetWidgetProperty( XPWidgetID inWidget, XPWidgetPropertyID inProperty, int * inExists); /* Can be NULL */ - /*************************************************************************** * KEYBOARD MANAGEMENT ***************************************************************************/ @@ -475,7 +452,6 @@ WIDGET_API intptr_t XPGetWidgetProperty( */ WIDGET_API XPWidgetID XPSetKeyboardFocus( XPWidgetID inWidget); - /* * XPLoseKeyboardFocus * @@ -486,7 +462,6 @@ WIDGET_API XPWidgetID XPSetKeyboardFocus( */ WIDGET_API void XPLoseKeyboardFocus( XPWidgetID inWidget); - /* * XPGetWidgetWithFocus * @@ -496,7 +471,6 @@ WIDGET_API void XPLoseKeyboardFocus( * */ WIDGET_API XPWidgetID XPGetWidgetWithFocus(void); - /*************************************************************************** * CREATING CUSTOM WIDGETS ***************************************************************************/ @@ -521,7 +495,6 @@ WIDGET_API XPWidgetID XPGetWidgetWithFocus(void); WIDGET_API void XPAddWidgetCallback( XPWidgetID inWidget, XPWidgetFunc_t inNewCallback); - /* * XPGetWidgetClassFunc * @@ -531,7 +504,6 @@ WIDGET_API void XPAddWidgetCallback( */ WIDGET_API XPWidgetFunc_t XPGetWidgetClassFunc( XPWidgetClass inWidgetClass); - #ifdef __cplusplus } #endif diff --git a/SDK/CHeaders/XPLM/XPLMCamera.h b/SDK/CHeaders/XPLM/XPLMCamera.h index 8b88d28..c81bd5f 100644 --- a/SDK/CHeaders/XPLM/XPLMCamera.h +++ b/SDK/CHeaders/XPLM/XPLMCamera.h @@ -2,7 +2,7 @@ #define _XPLMCamera_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -73,7 +73,6 @@ enum { }; typedef int XPLMCameraControlDuration; - /* * XPLMCameraPosition_t * @@ -94,7 +93,6 @@ typedef struct { float roll; float zoom; } XPLMCameraPosition_t; - /* * XPLMCameraControl_f * @@ -113,7 +111,6 @@ typedef int (* XPLMCameraControl_f)( XPLMCameraPosition_t * outCameraPosition, /* Can be NULL */ int inIsLosingControl, void * inRefcon); - /* * XPLMControlCamera * @@ -126,7 +123,6 @@ XPLM_API void XPLMControlCamera( XPLMCameraControlDuration inHowLong, XPLMCameraControl_f inControlFunc, void * inRefcon); - /* * XPLMDontControlCamera * @@ -139,7 +135,6 @@ XPLM_API void XPLMControlCamera( * */ XPLM_API void XPLMDontControlCamera(void); - /* * XPLMIsCameraBeingControlled * @@ -150,7 +145,6 @@ XPLM_API void XPLMDontControlCamera(void); */ XPLM_API int XPLMIsCameraBeingControlled( XPLMCameraControlDuration * outCameraControlDuration); /* Can be NULL */ - /* * XPLMReadCameraPosition * @@ -159,7 +153,6 @@ XPLM_API int XPLMIsCameraBeingControlled( */ XPLM_API void XPLMReadCameraPosition( XPLMCameraPosition_t * outCameraPosition); - #ifdef __cplusplus } #endif diff --git a/SDK/CHeaders/XPLM/XPLMDataAccess.h b/SDK/CHeaders/XPLM/XPLMDataAccess.h index 22c28ee..d647740 100644 --- a/SDK/CHeaders/XPLM/XPLMDataAccess.h +++ b/SDK/CHeaders/XPLM/XPLMDataAccess.h @@ -2,7 +2,7 @@ #define _XPLMDataAccess_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -115,7 +115,6 @@ extern "C" { * */ - /* * XPLMDataRef * @@ -126,7 +125,6 @@ extern "C" { * */ typedef void * XPLMDataRef; - /* * XPLMDataTypeID * @@ -165,7 +163,6 @@ enum { }; typedef int XPLMDataTypeID; - #if defined(XPLM400) /* * XPLMCountDataRefs @@ -175,7 +172,6 @@ typedef int XPLMDataTypeID; */ XPLM_API int XPLMCountDataRefs(void); #endif /* XPLM400 */ - #if defined(XPLM400) /* * XPLMGetDataRefsByIndex @@ -190,7 +186,6 @@ XPLM_API void XPLMGetDataRefsByIndex( int count, XPLMDataRef * outDataRefs); #endif /* XPLM400 */ - #if defined(XPLM400) /* * XPLMDataRefInfo_t @@ -214,7 +209,6 @@ typedef struct { XPLMPluginID owner; } XPLMDataRefInfo_t; #endif /* XPLM400 */ - #if defined(XPLM400) /* * XPLMGetDataRefInfo @@ -227,7 +221,6 @@ XPLM_API void XPLMGetDataRefInfo( XPLMDataRef inDataRef, XPLMDataRefInfo_t * outInfo); #endif /* XPLM400 */ - /* * XPLMFindDataRef * @@ -244,7 +237,6 @@ XPLM_API void XPLMGetDataRefInfo( */ XPLM_API XPLMDataRef XPLMFindDataRef( const char * inDataRefName); - /* * XPLMCanWriteDataRef * @@ -259,7 +251,6 @@ XPLM_API XPLMDataRef XPLMFindDataRef( */ XPLM_API int XPLMCanWriteDataRef( XPLMDataRef inDataRef); - /* * XPLMIsDataRefGood * @@ -277,7 +268,6 @@ XPLM_API int XPLMCanWriteDataRef( */ XPLM_API int XPLMIsDataRefGood( XPLMDataRef inDataRef); - /* * XPLMGetDataRefTypes * @@ -288,7 +278,6 @@ XPLM_API int XPLMIsDataRefGood( */ XPLM_API XPLMDataTypeID XPLMGetDataRefTypes( XPLMDataRef inDataRef); - /*************************************************************************** * DATA ACCESSORS ***************************************************************************/ @@ -313,7 +302,6 @@ XPLM_API XPLMDataTypeID XPLMGetDataRefTypes( * */ - /* * XPLMGetDatai * @@ -323,7 +311,6 @@ XPLM_API XPLMDataTypeID XPLMGetDataRefTypes( */ XPLM_API int XPLMGetDatai( XPLMDataRef inDataRef); - /* * XPLMSetDatai * @@ -335,7 +322,6 @@ XPLM_API int XPLMGetDatai( XPLM_API void XPLMSetDatai( XPLMDataRef inDataRef, int inValue); - /* * XPLMGetDataf * @@ -346,7 +332,6 @@ XPLM_API void XPLMSetDatai( */ XPLM_API float XPLMGetDataf( XPLMDataRef inDataRef); - /* * XPLMSetDataf * @@ -358,7 +343,6 @@ XPLM_API float XPLMGetDataf( XPLM_API void XPLMSetDataf( XPLMDataRef inDataRef, float inValue); - /* * XPLMGetDatad * @@ -369,7 +353,6 @@ XPLM_API void XPLMSetDataf( */ XPLM_API double XPLMGetDatad( XPLMDataRef inDataRef); - /* * XPLMSetDatad * @@ -381,7 +364,6 @@ XPLM_API double XPLMGetDatad( XPLM_API void XPLMSetDatad( XPLMDataRef inDataRef, double inValue); - /* * XPLMGetDatavi * @@ -404,7 +386,6 @@ XPLM_API int XPLMGetDatavi( int * outValues, /* Can be NULL */ int inOffset, int inMax); - /* * XPLMSetDatavi * @@ -424,7 +405,6 @@ XPLM_API void XPLMSetDatavi( int * inValues, int inoffset, int inCount); - /* * XPLMGetDatavf * @@ -448,7 +428,6 @@ XPLM_API int XPLMGetDatavf( float * outValues, /* Can be NULL */ int inOffset, int inMax); - /* * XPLMSetDatavf * @@ -468,7 +447,6 @@ XPLM_API void XPLMSetDatavf( float * inValues, int inoffset, int inCount); - /* * XPLMGetDatab * @@ -491,7 +469,6 @@ XPLM_API int XPLMGetDatab( void * outValue, /* Can be NULL */ int inOffset, int inMaxBytes); - /* * XPLMSetDatab * @@ -511,7 +488,6 @@ XPLM_API void XPLMSetDatab( void * inValue, int inOffset, int inLength); - /*************************************************************************** * PUBLISHING YOUR PLUGIN'S DATA ***************************************************************************/ @@ -534,7 +510,6 @@ XPLM_API void XPLMSetDatab( * */ - /* * XPLMGetDatai_f * @@ -554,7 +529,6 @@ XPLM_API void XPLMSetDatab( */ typedef int (* XPLMGetDatai_f)( void * inRefcon); - /* * XPLMSetDatai_f * @@ -562,14 +536,12 @@ typedef int (* XPLMGetDatai_f)( typedef void (* XPLMSetDatai_f)( void * inRefcon, int inValue); - /* * XPLMGetDataf_f * */ typedef float (* XPLMGetDataf_f)( void * inRefcon); - /* * XPLMSetDataf_f * @@ -577,14 +549,12 @@ typedef float (* XPLMGetDataf_f)( typedef void (* XPLMSetDataf_f)( void * inRefcon, float inValue); - /* * XPLMGetDatad_f * */ typedef double (* XPLMGetDatad_f)( void * inRefcon); - /* * XPLMSetDatad_f * @@ -592,7 +562,6 @@ typedef double (* XPLMGetDatad_f)( typedef void (* XPLMSetDatad_f)( void * inRefcon, double inValue); - /* * XPLMGetDatavi_f * @@ -602,7 +571,6 @@ typedef int (* XPLMGetDatavi_f)( int * outValues, /* Can be NULL */ int inOffset, int inMax); - /* * XPLMSetDatavi_f * @@ -612,7 +580,6 @@ typedef void (* XPLMSetDatavi_f)( int * inValues, int inOffset, int inCount); - /* * XPLMGetDatavf_f * @@ -622,7 +589,6 @@ typedef int (* XPLMGetDatavf_f)( float * outValues, /* Can be NULL */ int inOffset, int inMax); - /* * XPLMSetDatavf_f * @@ -632,7 +598,6 @@ typedef void (* XPLMSetDatavf_f)( float * inValues, int inOffset, int inCount); - /* * XPLMGetDatab_f * @@ -642,7 +607,6 @@ typedef int (* XPLMGetDatab_f)( void * outValue, /* Can be NULL */ int inOffset, int inMaxLength); - /* * XPLMSetDatab_f * @@ -652,7 +616,6 @@ typedef void (* XPLMSetDatab_f)( void * inValue, int inOffset, int inLength); - /* * XPLMRegisterDataAccessor * @@ -685,7 +648,6 @@ XPLM_API XPLMDataRef XPLMRegisterDataAccessor( XPLMSetDatab_f inWriteData, void * inReadRefcon, void * inWriteRefcon); - /* * XPLMUnregisterDataAccessor * @@ -697,7 +659,6 @@ XPLM_API XPLMDataRef XPLMRegisterDataAccessor( */ XPLM_API void XPLMUnregisterDataAccessor( XPLMDataRef inDataRef); - /*************************************************************************** * SHARING DATA BETWEEN MULTIPLE PLUGINS ***************************************************************************/ @@ -737,7 +698,6 @@ XPLM_API void XPLMUnregisterDataAccessor( * */ - /* * XPLMDataChanged_f * @@ -749,7 +709,6 @@ XPLM_API void XPLMUnregisterDataAccessor( */ typedef void (* XPLMDataChanged_f)( void * inRefcon); - /* * XPLMShareData * @@ -775,7 +734,6 @@ XPLM_API int XPLMShareData( XPLMDataTypeID inDataType, XPLMDataChanged_f inNotificationFunc, void * inNotificationRefcon); - /* * XPLMUnshareData * @@ -790,7 +748,6 @@ XPLM_API int XPLMUnshareData( XPLMDataTypeID inDataType, XPLMDataChanged_f inNotificationFunc, void * inNotificationRefcon); - #ifdef __cplusplus } #endif diff --git a/SDK/CHeaders/XPLM/XPLMDefs.h b/SDK/CHeaders/XPLM/XPLMDefs.h index 7ad9b89..90620a1 100644 --- a/SDK/CHeaders/XPLM/XPLMDefs.h +++ b/SDK/CHeaders/XPLM/XPLMDefs.h @@ -2,7 +2,7 @@ #define _XPLMDefs_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -31,6 +31,7 @@ extern "C" { #if IBM #include #endif + #include /*************************************************************************** * DLL Definitions @@ -46,7 +47,6 @@ extern "C" { * */ - #ifdef __cplusplus #if APL #if __GNUC__ >= 4 @@ -120,7 +120,6 @@ extern "C" { #else #error "Platform not defined!" #endif - /*************************************************************************** * GLOBAL DEFINITIONS ***************************************************************************/ @@ -129,7 +128,6 @@ extern "C" { * */ - /* * XPLMPluginID * @@ -147,16 +145,12 @@ extern "C" { * */ typedef int XPLMPluginID; - /* No plugin. */ #define XPLM_NO_PLUGIN_ID (-1) - /* X-Plane itself */ #define XPLM_PLUGIN_XPLANE (0) - -/* The current XPLM revision is 4.1.1 (411). */ -#define kXPLM_Version (411) - +/* The current XPLM revision is 4.3.0 (430). */ +#define kXPLM_Version (430) /* * XPLMKeyFlags * @@ -193,7 +187,6 @@ enum { }; typedef int XPLMKeyFlags; - /*************************************************************************** * ASCII CONTROL KEY CODES ***************************************************************************/ @@ -211,45 +204,25 @@ typedef int XPLMKeyFlags; * */ - #define XPLM_KEY_RETURN 13 - #define XPLM_KEY_ESCAPE 27 - #define XPLM_KEY_TAB 9 - #define XPLM_KEY_DELETE 8 - #define XPLM_KEY_LEFT 28 - #define XPLM_KEY_RIGHT 29 - #define XPLM_KEY_UP 30 - #define XPLM_KEY_DOWN 31 - #define XPLM_KEY_0 48 - #define XPLM_KEY_1 49 - #define XPLM_KEY_2 50 - #define XPLM_KEY_3 51 - #define XPLM_KEY_4 52 - #define XPLM_KEY_5 53 - #define XPLM_KEY_6 54 - #define XPLM_KEY_7 55 - #define XPLM_KEY_8 56 - #define XPLM_KEY_9 57 - #define XPLM_KEY_DECIMAL 46 - /*************************************************************************** * VIRTUAL KEY CODES ***************************************************************************/ @@ -280,233 +253,121 @@ typedef int XPLMKeyFlags; * */ - #define XPLM_VK_BACK 0x08 - #define XPLM_VK_TAB 0x09 - #define XPLM_VK_CLEAR 0x0C - #define XPLM_VK_RETURN 0x0D - #define XPLM_VK_ESCAPE 0x1B - #define XPLM_VK_SPACE 0x20 - #define XPLM_VK_PRIOR 0x21 - #define XPLM_VK_NEXT 0x22 - #define XPLM_VK_END 0x23 - #define XPLM_VK_HOME 0x24 - #define XPLM_VK_LEFT 0x25 - #define XPLM_VK_UP 0x26 - #define XPLM_VK_RIGHT 0x27 - #define XPLM_VK_DOWN 0x28 - #define XPLM_VK_SELECT 0x29 - #define XPLM_VK_PRINT 0x2A - #define XPLM_VK_EXECUTE 0x2B - #define XPLM_VK_SNAPSHOT 0x2C - #define XPLM_VK_INSERT 0x2D - #define XPLM_VK_DELETE 0x2E - #define XPLM_VK_HELP 0x2F - /* XPLM_VK_0 thru XPLM_VK_9 are the same as ASCII '0' thru '9' (0x30 - 0x39) */ #define XPLM_VK_0 0x30 - #define XPLM_VK_1 0x31 - #define XPLM_VK_2 0x32 - #define XPLM_VK_3 0x33 - #define XPLM_VK_4 0x34 - #define XPLM_VK_5 0x35 - #define XPLM_VK_6 0x36 - #define XPLM_VK_7 0x37 - #define XPLM_VK_8 0x38 - #define XPLM_VK_9 0x39 - /* XPLM_VK_A thru XPLM_VK_Z are the same as ASCII 'A' thru 'Z' (0x41 - 0x5A) */ #define XPLM_VK_A 0x41 - #define XPLM_VK_B 0x42 - #define XPLM_VK_C 0x43 - #define XPLM_VK_D 0x44 - #define XPLM_VK_E 0x45 - #define XPLM_VK_F 0x46 - #define XPLM_VK_G 0x47 - #define XPLM_VK_H 0x48 - #define XPLM_VK_I 0x49 - #define XPLM_VK_J 0x4A - #define XPLM_VK_K 0x4B - #define XPLM_VK_L 0x4C - #define XPLM_VK_M 0x4D - #define XPLM_VK_N 0x4E - #define XPLM_VK_O 0x4F - #define XPLM_VK_P 0x50 - #define XPLM_VK_Q 0x51 - #define XPLM_VK_R 0x52 - #define XPLM_VK_S 0x53 - #define XPLM_VK_T 0x54 - #define XPLM_VK_U 0x55 - #define XPLM_VK_V 0x56 - #define XPLM_VK_W 0x57 - #define XPLM_VK_X 0x58 - #define XPLM_VK_Y 0x59 - #define XPLM_VK_Z 0x5A - #define XPLM_VK_NUMPAD0 0x60 - #define XPLM_VK_NUMPAD1 0x61 - #define XPLM_VK_NUMPAD2 0x62 - #define XPLM_VK_NUMPAD3 0x63 - #define XPLM_VK_NUMPAD4 0x64 - #define XPLM_VK_NUMPAD5 0x65 - #define XPLM_VK_NUMPAD6 0x66 - #define XPLM_VK_NUMPAD7 0x67 - #define XPLM_VK_NUMPAD8 0x68 - #define XPLM_VK_NUMPAD9 0x69 - #define XPLM_VK_MULTIPLY 0x6A - #define XPLM_VK_ADD 0x6B - #define XPLM_VK_SEPARATOR 0x6C - #define XPLM_VK_SUBTRACT 0x6D - #define XPLM_VK_DECIMAL 0x6E - #define XPLM_VK_DIVIDE 0x6F - #define XPLM_VK_F1 0x70 - #define XPLM_VK_F2 0x71 - #define XPLM_VK_F3 0x72 - #define XPLM_VK_F4 0x73 - #define XPLM_VK_F5 0x74 - #define XPLM_VK_F6 0x75 - #define XPLM_VK_F7 0x76 - #define XPLM_VK_F8 0x77 - #define XPLM_VK_F9 0x78 - #define XPLM_VK_F10 0x79 - #define XPLM_VK_F11 0x7A - #define XPLM_VK_F12 0x7B - #define XPLM_VK_F13 0x7C - #define XPLM_VK_F14 0x7D - #define XPLM_VK_F15 0x7E - #define XPLM_VK_F16 0x7F - #define XPLM_VK_F17 0x80 - #define XPLM_VK_F18 0x81 - #define XPLM_VK_F19 0x82 - #define XPLM_VK_F20 0x83 - #define XPLM_VK_F21 0x84 - #define XPLM_VK_F22 0x85 - #define XPLM_VK_F23 0x86 - #define XPLM_VK_F24 0x87 - /* The following definitions are extended and are not based on the Microsoft * * key set. */ #define XPLM_VK_EQUAL 0xB0 - #define XPLM_VK_MINUS 0xB1 - #define XPLM_VK_RBRACE 0xB2 - #define XPLM_VK_LBRACE 0xB3 - #define XPLM_VK_QUOTE 0xB4 - #define XPLM_VK_SEMICOLON 0xB5 - #define XPLM_VK_BACKSLASH 0xB6 - #define XPLM_VK_COMMA 0xB7 - #define XPLM_VK_SLASH 0xB8 - #define XPLM_VK_PERIOD 0xB9 - #define XPLM_VK_BACKQUOTE 0xBA - #define XPLM_VK_ENTER 0xBB - #define XPLM_VK_NUMPAD_ENT 0xBC - #define XPLM_VK_NUMPAD_EQ 0xBD - /* * XPLMFixedString150_t * @@ -538,6 +399,111 @@ enum { /* X-Plane shows the cursor but lets you select an OS cursor. */ xplm_CursorCustom = 3, +#if defined(XPLM420) + /* X-Plane shows a small bi-directional knob-rotating cursor. */ + xplm_CursorRotateSmall = 4, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a small counter-clockwise knob-rotating cursor. */ + xplm_CursorRotateSmallLeft = 5, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a small clockwise knob-rotating cursor. */ + xplm_CursorRotateSmallRight = 6, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a medium bi-directional knob-rotating cursor. */ + xplm_CursorRotateMedium = 7, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a medium counter-clockwise knob-rotating cursor. */ + xplm_CursorRotateMediumLeft = 8, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a medium clockwise knob-rotating cursor. */ + xplm_CursorRotateMediumRight = 9, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a large bi-directional knob-rotating cursor. */ + xplm_CursorRotateLarge = 10, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a large counter-clockwise knob-rotating cursor. */ + xplm_CursorRotateLargeLeft = 11, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a large clockwise knob-rotating cursor. */ + xplm_CursorRotateLargeRight = 12, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows an up-and-down arrows cursor. */ + xplm_CursorUpDown = 13, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a down arrow cursor. */ + xplm_CursorDown = 14, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows an up arrow cursor. */ + xplm_CursorUp = 15, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a left-right arrow cursor. */ + xplm_CursorLeftRight = 16, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a left arrow cursor. */ + xplm_CursorLeft = 17, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a right arrow cursor. */ + xplm_CursorRight = 18, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a button-pushing cursor. */ + xplm_CursorButton = 19, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a handle-grabbing cursor. */ + xplm_CursorHandle = 20, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a four-arrows cursor. */ + xplm_CursorFourArrows = 21, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a cursor to drag a horizontal splitter bar. */ + xplm_CursorSplitterH = 22, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows a cursor to drag a vertical splitter bar. */ + xplm_CursorSplitterV = 23, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* X-Plane shows an I-Beam cursor for text editing. */ + xplm_CursorText = 24, + +#endif /* XPLM420 */ }; typedef int XPLMCursorStatus; diff --git a/SDK/CHeaders/XPLM/XPLMDisplay.h b/SDK/CHeaders/XPLM/XPLMDisplay.h index ba88487..1a548bb 100644 --- a/SDK/CHeaders/XPLM/XPLMDisplay.h +++ b/SDK/CHeaders/XPLM/XPLMDisplay.h @@ -2,7 +2,7 @@ #define _XPLMDisplay_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -113,7 +113,6 @@ extern "C" { * */ - /* * XPLMDrawingPhase * @@ -217,7 +216,6 @@ enum { }; typedef int XPLMDrawingPhase; - /* * XPLMDrawCallback_f * @@ -238,7 +236,6 @@ typedef int (* XPLMDrawCallback_f)( XPLMDrawingPhase inPhase, int inIsBefore, void * inRefcon); - /* * XPLMRegisterDrawCallback * @@ -259,7 +256,6 @@ XPLM_API int XPLMRegisterDrawCallback( XPLMDrawingPhase inPhase, int inWantsBefore, void * inRefcon); - /* * XPLMUnregisterDrawCallback * @@ -278,7 +274,6 @@ XPLM_API int XPLMUnregisterDrawCallback( XPLMDrawingPhase inPhase, int inWantsBefore, void * inRefcon); - #if defined(XPLM400) /*************************************************************************** * AVIONICS API @@ -311,7 +306,6 @@ XPLM_API int XPLMUnregisterDrawCallback( * */ - /* * XPLMDeviceID * @@ -380,10 +374,14 @@ enum { /* Airbus MCDU, copilot side. */ xplm_device_MCDU_2 = 19, +#if defined(XPLM430) + /* Airbus MCDU 3. */ + xplm_device_MCDU_3 = 24, + +#endif /* XPLM430 */ }; typedef int XPLMDeviceID; - /* * XPLMAvionicsCallback_f * @@ -406,7 +404,6 @@ typedef int (* XPLMAvionicsCallback_f)( XPLMDeviceID inDeviceID, int inIsBefore, void * inRefcon); - #if defined(XPLM410) /* * XPLMAvionicsMouse_f @@ -424,7 +421,6 @@ typedef int (* XPLMAvionicsMouse_f)( XPLMMouseStatus inMouse, void * inRefcon); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMAvionicsMouseWheel_f @@ -445,7 +441,6 @@ typedef int (* XPLMAvionicsMouseWheel_f)( int clicks, void * inRefcon); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMAvionicsCursor_f @@ -461,7 +456,6 @@ typedef XPLMCursorStatus (* XPLMAvionicsCursor_f)( int y, void * inRefcon); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMAvionicsKeyboard_f @@ -478,7 +472,6 @@ typedef int (* XPLMAvionicsKeyboard_f)( void * inRefCon, int losingFocus); #endif /* XPLM410 */ - /* * XPLMAvionicsID * @@ -490,7 +483,6 @@ typedef int (* XPLMAvionicsKeyboard_f)( * */ typedef void * XPLMAvionicsID; - /* * XPLMCustomizeAvionics_t * @@ -559,7 +551,6 @@ typedef struct { * to pass information to yourself as needed. */ void * refcon; } XPLMCustomizeAvionics_t; - /* * XPLMRegisterAvionicsCallbacksEx * @@ -577,7 +568,6 @@ typedef struct { */ XPLM_API XPLMAvionicsID XPLMRegisterAvionicsCallbacksEx( XPLMCustomizeAvionics_t * inParams); - /* * XPLMGetAvionicsHandle * @@ -591,7 +581,6 @@ XPLM_API XPLMAvionicsID XPLMRegisterAvionicsCallbacksEx( */ XPLM_API XPLMAvionicsID XPLMGetAvionicsHandle( XPLMDeviceID inDeviceID); - /* * XPLMUnregisterAvionicsCallbacks * @@ -602,7 +591,6 @@ XPLM_API XPLMAvionicsID XPLMGetAvionicsHandle( */ XPLM_API void XPLMUnregisterAvionicsCallbacks( XPLMAvionicsID inAvionicsId); - #if defined(XPLM410) /* * XPLMAvionicsScreenCallback_f @@ -621,7 +609,6 @@ XPLM_API void XPLMUnregisterAvionicsCallbacks( typedef void (* XPLMAvionicsScreenCallback_f)( void * inRefcon); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMAvionicsBezelCallback_f @@ -644,7 +631,6 @@ typedef void (* XPLMAvionicsBezelCallback_f)( float inAmbiantB, void * inRefcon); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMAvionicsBrightness_f @@ -677,7 +663,6 @@ typedef float (* XPLMAvionicsBrightness_f)( float inBusVoltsRatio, void * inRefcon); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMCreateAvionics_t @@ -761,7 +746,6 @@ typedef struct { void * refcon; } XPLMCreateAvionics_t; #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMCreateAvionicsEx @@ -779,7 +763,6 @@ typedef struct { XPLM_API XPLMAvionicsID XPLMCreateAvionicsEx( XPLMCreateAvionics_t * inParams); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMDestroyAvionics @@ -792,7 +775,6 @@ XPLM_API XPLMAvionicsID XPLMCreateAvionicsEx( XPLM_API void XPLMDestroyAvionics( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMIsAvionicsBound @@ -804,7 +786,6 @@ XPLM_API void XPLMDestroyAvionics( XPLM_API int XPLMIsAvionicsBound( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetAvionicsBrightnessRheo @@ -827,7 +808,6 @@ XPLM_API void XPLMSetAvionicsBrightnessRheo( XPLMAvionicsID inHandle, float brightness); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMGetAvionicsBrightnessRheo @@ -848,7 +828,6 @@ XPLM_API void XPLMSetAvionicsBrightnessRheo( XPLM_API float XPLMGetAvionicsBrightnessRheo( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMGetAvionicsBusVoltsRatio @@ -861,7 +840,6 @@ XPLM_API float XPLMGetAvionicsBrightnessRheo( XPLM_API float XPLMGetAvionicsBusVoltsRatio( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMIsCursorOverAvionics @@ -877,7 +855,6 @@ XPLM_API int XPLMIsCursorOverAvionics( int * outX, /* Can be NULL */ int * outY); /* Can be NULL */ #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMAvionicsNeedsDrawing @@ -891,7 +868,6 @@ XPLM_API int XPLMIsCursorOverAvionics( XPLM_API void XPLMAvionicsNeedsDrawing( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetAvionicsPopupVisible @@ -903,7 +879,6 @@ XPLM_API void XPLMSetAvionicsPopupVisible( XPLMAvionicsID inHandle, int inVisible); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMIsAvionicsPopupVisible @@ -914,7 +889,6 @@ XPLM_API void XPLMSetAvionicsPopupVisible( XPLM_API int XPLMIsAvionicsPopupVisible( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMPopOutAvionics @@ -925,7 +899,6 @@ XPLM_API int XPLMIsAvionicsPopupVisible( XPLM_API void XPLMPopOutAvionics( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMIsAvionicsPoppedOut @@ -936,7 +909,6 @@ XPLM_API void XPLMPopOutAvionics( XPLM_API int XPLMIsAvionicsPoppedOut( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMTakeAvionicsKeyboardFocus @@ -948,7 +920,6 @@ XPLM_API int XPLMIsAvionicsPoppedOut( XPLM_API void XPLMTakeAvionicsKeyboardFocus( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMHasAvionicsKeyboardFocus @@ -960,7 +931,6 @@ XPLM_API void XPLMTakeAvionicsKeyboardFocus( XPLM_API int XPLMHasAvionicsKeyboardFocus( XPLMAvionicsID inHandle); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMGetAvionicsGeometry @@ -976,7 +946,6 @@ XPLM_API void XPLMGetAvionicsGeometry( int * outRight, /* Can be NULL */ int * outBottom); /* Can be NULL */ #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetAvionicsGeometry @@ -992,7 +961,6 @@ XPLM_API void XPLMSetAvionicsGeometry( int inRight, int inBottom); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMGetAvionicsGeometryOS @@ -1007,7 +975,6 @@ XPLM_API void XPLMGetAvionicsGeometryOS( int * outRight, /* Can be NULL */ int * outBottom); /* Can be NULL */ #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetAvionicsGeometryOS @@ -1022,7 +989,6 @@ XPLM_API void XPLMSetAvionicsGeometryOS( int inRight, int inBottom); #endif /* XPLM410 */ - #endif /* XPLM400 */ /*************************************************************************** * WINDOW API @@ -1063,7 +1029,6 @@ XPLM_API void XPLMSetAvionicsGeometryOS( * */ - /* * XPLMWindowID * @@ -1074,7 +1039,6 @@ XPLM_API void XPLMSetAvionicsGeometryOS( * */ typedef void * XPLMWindowID; - /* * XPLMDrawWindow_f * @@ -1092,7 +1056,6 @@ typedef void * XPLMWindowID; typedef void (* XPLMDrawWindow_f)( XPLMWindowID inWindowID, void * inRefcon); - /* * XPLMHandleKey_f * @@ -1122,7 +1085,6 @@ typedef void (* XPLMHandleKey_f)( char inVirtualKey, void * inRefcon, int losingFocus); - /* * XPLMHandleMouseClick_f * @@ -1154,7 +1116,6 @@ typedef int (* XPLMHandleMouseClick_f)( int y, XPLMMouseStatus inMouse, void * inRefcon); - #if defined(XPLM200) /* * XPLMHandleCursor_f @@ -1192,7 +1153,6 @@ typedef XPLMCursorStatus (* XPLMHandleCursor_f)( int y, void * inRefcon); #endif /* XPLM200 */ - #if defined(XPLM200) /* * XPLMHandleMouseWheel_f @@ -1222,7 +1182,6 @@ typedef int (* XPLMHandleMouseWheel_f)( int clicks, void * inRefcon); #endif /* XPLM200 */ - #if defined(XPLM300) /* * XPLMWindowLayer @@ -1262,7 +1221,6 @@ enum { }; typedef int XPLMWindowLayer; #endif /* XPLM300 */ - #if defined(XPLM301) /* * XPLMWindowDecoration @@ -1300,7 +1258,6 @@ enum { }; typedef int XPLMWindowDecoration; #endif /* XPLM301 */ - #if defined(XPLM200) /* * XPLMCreateWindow_t @@ -1372,7 +1329,6 @@ typedef struct { #endif /* XPLM300 */ } XPLMCreateWindow_t; #endif /* XPLM200 */ - #if defined(XPLM200) /* * XPLMCreateWindowEx @@ -1388,7 +1344,6 @@ typedef struct { XPLM_API XPLMWindowID XPLMCreateWindowEx( XPLMCreateWindow_t * inParams); #endif /* XPLM200 */ - /* * XPLMCreateWindow * @@ -1421,7 +1376,6 @@ XPLM_API XPLMWindowID XPLMCreateWindow( XPLMHandleKey_f inKeyCallback, XPLMHandleMouseClick_f inMouseCallback, void * inRefcon); - /* * XPLMDestroyWindow * @@ -1432,7 +1386,6 @@ XPLM_API XPLMWindowID XPLMCreateWindow( */ XPLM_API void XPLMDestroyWindow( XPLMWindowID inWindowID); - /* * XPLMGetScreenSize * @@ -1444,7 +1397,6 @@ XPLM_API void XPLMDestroyWindow( XPLM_API void XPLMGetScreenSize( int * outWidth, /* Can be NULL */ int * outHeight); /* Can be NULL */ - #if defined(XPLM300) /* * XPLMGetScreenBoundsGlobal @@ -1485,7 +1437,6 @@ XPLM_API void XPLMGetScreenBoundsGlobal( int * outRight, /* Can be NULL */ int * outBottom); /* Can be NULL */ #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMReceiveMonitorBoundsGlobal_f @@ -1504,7 +1455,6 @@ typedef void (* XPLMReceiveMonitorBoundsGlobal_f)( int inBottomBx, void * inRefcon); #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMGetAllMonitorBoundsGlobal @@ -1534,7 +1484,6 @@ XPLM_API void XPLMGetAllMonitorBoundsGlobal( XPLMReceiveMonitorBoundsGlobal_f inMonitorBoundsCallback, void * inRefcon); #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMReceiveMonitorBoundsOS_f @@ -1554,7 +1503,6 @@ typedef void (* XPLMReceiveMonitorBoundsOS_f)( int inBottomPx, void * inRefcon); #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMGetAllMonitorBoundsOS @@ -1574,7 +1522,6 @@ XPLM_API void XPLMGetAllMonitorBoundsOS( XPLMReceiveMonitorBoundsOS_f inMonitorBoundsCallback, void * inRefcon); #endif /* XPLM300 */ - /* * XPLMGetMouseLocation * @@ -1598,7 +1545,6 @@ XPLM_API void XPLMGetAllMonitorBoundsOS( XPLM_API void XPLMGetMouseLocation( int * outX, /* Can be NULL */ int * outY); /* Can be NULL */ - #if defined(XPLM300) /* * XPLMGetMouseLocationGlobal @@ -1621,7 +1567,6 @@ XPLM_API void XPLMGetMouseLocationGlobal( int * outX, /* Can be NULL */ int * outY); /* Can be NULL */ #endif /* XPLM300 */ - /* * XPLMGetWindowGeometry * @@ -1646,7 +1591,6 @@ XPLM_API void XPLMGetWindowGeometry( int * outTop, /* Can be NULL */ int * outRight, /* Can be NULL */ int * outBottom); /* Can be NULL */ - /* * XPLMSetWindowGeometry * @@ -1669,7 +1613,6 @@ XPLM_API void XPLMSetWindowGeometry( int inTop, int inRight, int inBottom); - #if defined(XPLM300) /* * XPLMGetWindowGeometryOS @@ -1686,7 +1629,6 @@ XPLM_API void XPLMGetWindowGeometryOS( int * outRight, /* Can be NULL */ int * outBottom); /* Can be NULL */ #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMSetWindowGeometryOS @@ -1708,7 +1650,6 @@ XPLM_API void XPLMSetWindowGeometryOS( int inRight, int inBottom); #endif /* XPLM300 */ - #if defined(XPLM301) /* * XPLMGetWindowGeometryVR @@ -1723,7 +1664,6 @@ XPLM_API void XPLMGetWindowGeometryVR( int * outWidthBoxels, /* Can be NULL */ int * outHeightBoxels); /* Can be NULL */ #endif /* XPLM301 */ - #if defined(XPLM301) /* * XPLMSetWindowGeometryVR @@ -1740,7 +1680,6 @@ XPLM_API void XPLMSetWindowGeometryVR( int widthBoxels, int heightBoxels); #endif /* XPLM301 */ - /* * XPLMGetWindowIsVisible * @@ -1749,7 +1688,6 @@ XPLM_API void XPLMSetWindowGeometryVR( */ XPLM_API int XPLMGetWindowIsVisible( XPLMWindowID inWindowID); - /* * XPLMSetWindowIsVisible * @@ -1759,7 +1697,6 @@ XPLM_API int XPLMGetWindowIsVisible( XPLM_API void XPLMSetWindowIsVisible( XPLMWindowID inWindowID, int inIsVisible); - #if defined(XPLM300) /* * XPLMWindowIsPoppedOut @@ -1776,7 +1713,6 @@ XPLM_API void XPLMSetWindowIsVisible( XPLM_API int XPLMWindowIsPoppedOut( XPLMWindowID inWindowID); #endif /* XPLM300 */ - #if defined(XPLM301) /* * XPLMWindowIsInVR @@ -1793,7 +1729,6 @@ XPLM_API int XPLMWindowIsPoppedOut( XPLM_API int XPLMWindowIsInVR( XPLMWindowID inWindowID); #endif /* XPLM301 */ - #if defined(XPLM300) /* * XPLMSetWindowGravity @@ -1825,7 +1760,6 @@ XPLM_API void XPLMSetWindowGravity( float inRightGravity, float inBottomGravity); #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMSetWindowResizingLimits @@ -1847,7 +1781,6 @@ XPLM_API void XPLMSetWindowResizingLimits( int inMaxWidthBoxels, int inMaxHeightBoxels); #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMWindowPositioningMode @@ -1893,7 +1826,6 @@ enum { }; typedef int XPLMWindowPositioningMode; #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMSetWindowPositioningMode @@ -1917,7 +1849,6 @@ XPLM_API void XPLMSetWindowPositioningMode( XPLMWindowPositioningMode inPositioningMode, int inMonitorIndex); #endif /* XPLM300 */ - #if defined(XPLM300) /* * XPLMSetWindowTitle @@ -1932,7 +1863,6 @@ XPLM_API void XPLMSetWindowTitle( XPLMWindowID inWindowID, const char * inWindowTitle); #endif /* XPLM300 */ - /* * XPLMGetWindowRefCon * @@ -1942,7 +1872,6 @@ XPLM_API void XPLMSetWindowTitle( */ XPLM_API void * XPLMGetWindowRefCon( XPLMWindowID inWindowID); - /* * XPLMSetWindowRefCon * @@ -1953,7 +1882,6 @@ XPLM_API void * XPLMGetWindowRefCon( XPLM_API void XPLMSetWindowRefCon( XPLMWindowID inWindowID, void * inRefcon); - /* * XPLMTakeKeyboardFocus * @@ -1965,7 +1893,6 @@ XPLM_API void XPLMSetWindowRefCon( */ XPLM_API void XPLMTakeKeyboardFocus( XPLMWindowID inWindow); - /* * XPLMHasKeyboardFocus * @@ -1976,7 +1903,6 @@ XPLM_API void XPLMTakeKeyboardFocus( */ XPLM_API int XPLMHasKeyboardFocus( XPLMWindowID inWindow); - /* * XPLMBringWindowToFront * @@ -1996,7 +1922,6 @@ XPLM_API int XPLMHasKeyboardFocus( */ XPLM_API void XPLMBringWindowToFront( XPLMWindowID inWindow); - /* * XPLMIsWindowInFront * @@ -2018,7 +1943,6 @@ XPLM_API void XPLMBringWindowToFront( */ XPLM_API int XPLMIsWindowInFront( XPLMWindowID inWindow); - /*************************************************************************** * KEY SNIFFERS ***************************************************************************/ @@ -2028,7 +1952,6 @@ XPLM_API int XPLMIsWindowInFront( * */ - /* * XPLMKeySniffer_f * @@ -2056,7 +1979,6 @@ typedef int (* XPLMKeySniffer_f)( XPLMKeyFlags inFlags, char inVirtualKey, void * inRefcon); - /* * XPLMRegisterKeySniffer * @@ -2073,7 +1995,6 @@ XPLM_API int XPLMRegisterKeySniffer( XPLMKeySniffer_f inCallback, int inBeforeWindows, void * inRefcon); - /* * XPLMUnregisterKeySniffer * @@ -2086,7 +2007,6 @@ XPLM_API int XPLMUnregisterKeySniffer( XPLMKeySniffer_f inCallback, int inBeforeWindows, void * inRefcon); - /*************************************************************************** * HOT KEYS ***************************************************************************/ @@ -2097,7 +2017,6 @@ XPLM_API int XPLMUnregisterKeySniffer( * */ - /* * XPLMHotKey_f * @@ -2106,7 +2025,6 @@ XPLM_API int XPLMUnregisterKeySniffer( */ typedef void (* XPLMHotKey_f)( void * inRefcon); - /* * XPLMHotKeyID * @@ -2114,7 +2032,6 @@ typedef void (* XPLMHotKey_f)( * */ typedef void * XPLMHotKeyID; - /* * XPLMRegisterHotKey * @@ -2132,7 +2049,6 @@ XPLM_API XPLMHotKeyID XPLMRegisterHotKey( const char * inDescription, XPLMHotKey_f inCallback, void * inRefcon); - /* * XPLMUnregisterHotKey * @@ -2141,7 +2057,6 @@ XPLM_API XPLMHotKeyID XPLMRegisterHotKey( */ XPLM_API void XPLMUnregisterHotKey( XPLMHotKeyID inHotKey); - /* * XPLMCountHotKeys * @@ -2149,7 +2064,6 @@ XPLM_API void XPLMUnregisterHotKey( * */ XPLM_API int XPLMCountHotKeys(void); - /* * XPLMGetNthHotKey * @@ -2158,7 +2072,6 @@ XPLM_API int XPLMCountHotKeys(void); */ XPLM_API XPLMHotKeyID XPLMGetNthHotKey( int inIndex); - /* * XPLMGetHotKeyInfo * @@ -2172,7 +2085,6 @@ XPLM_API void XPLMGetHotKeyInfo( XPLMKeyFlags * outFlags, /* Can be NULL */ char * outDescription, /* Can be NULL */ XPLMPluginID * outPlugin); /* Can be NULL */ - /* * XPLMSetHotKeyCombination * @@ -2183,7 +2095,6 @@ XPLM_API void XPLMSetHotKeyCombination( XPLMHotKeyID inHotKey, char inVirtualKey, XPLMKeyFlags inFlags); - #ifdef __cplusplus } #endif diff --git a/SDK/CHeaders/XPLM/XPLMGraphics.h b/SDK/CHeaders/XPLM/XPLMGraphics.h index f05cb1c..f7f62f5 100644 --- a/SDK/CHeaders/XPLM/XPLMGraphics.h +++ b/SDK/CHeaders/XPLM/XPLMGraphics.h @@ -2,7 +2,7 @@ #define _XPLMGraphics_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -56,7 +56,6 @@ extern "C" { * */ - /* * XPLMTextureID * @@ -82,10 +81,21 @@ enum { xplm_Tex_AircraftLiteMap = 2, #endif /* XPLM_DEPRECATED */ +#if defined(XPLM420) + /* The weather radar instrument texture as controlled by the pilot-side radar * + * controls */ + xplm_Tex_Radar_Pilot = 3, + +#endif /* XPLM420 */ +#if defined(XPLM420) + /* The weather radar instrument texture as controlled by the * + * copilot-side radar controls */ + xplm_Tex_Radar_Copilot = 4, + +#endif /* XPLM420 */ }; typedef int XPLMTextureID; - /* * XPLMSetGraphicsState * @@ -142,7 +152,6 @@ XPLM_API void XPLMSetGraphicsState( int inEnableAlphaBlending, int inEnableDepthTesting, int inEnableDepthWriting); - /* * XPLMBindTexture2d * @@ -164,7 +173,6 @@ XPLM_API void XPLMSetGraphicsState( XPLM_API void XPLMBindTexture2d( int inTextureNum, int inTextureUnit); - /* * XPLMGenerateTextureNumbers * @@ -176,20 +184,16 @@ XPLM_API void XPLMBindTexture2d( XPLM_API void XPLMGenerateTextureNumbers( int * outTextureIDs, int inCount); - -#if defined(XPLM_DEPRECATED) /* * XPLMGetTexture * * XPLMGetTexture returns the OpenGL texture ID of an X-Plane texture based on * a generic identifying code. For example, you can get the texture for - * X-Plane's UI bitmaps. + * X-Plane's weather radar. * */ XPLM_API int XPLMGetTexture( XPLMTextureID inTexture); -#endif /* XPLM_DEPRECATED */ - /* * XPLMWorldToLocal * @@ -206,7 +210,6 @@ XPLM_API void XPLMWorldToLocal( double * outX, double * outY, double * outZ); - /* * XPLMLocalToWorld * @@ -226,7 +229,6 @@ XPLM_API void XPLMLocalToWorld( double * outLatitude, double * outLongitude, double * outAltitude); - /* * XPLMDrawTranslucentDarkBox * @@ -240,7 +242,6 @@ XPLM_API void XPLMDrawTranslucentDarkBox( int inTop, int inRight, int inBottom); - /*************************************************************************** * X-PLANE TEXT ***************************************************************************/ @@ -357,7 +358,6 @@ enum { }; typedef int XPLMFontID; - /* * XPLMDrawString * @@ -376,7 +376,6 @@ XPLM_API void XPLMDrawString( const char * inChar, int * inWordWrapWidth, /* Can be NULL */ XPLMFontID inFontID); - /* * XPLMDrawNumber * @@ -397,7 +396,6 @@ XPLM_API void XPLMDrawNumber( int inDecimals, int inShowSign, XPLMFontID inFontID); - /* * XPLMGetFontDimensions * @@ -412,7 +410,6 @@ XPLM_API void XPLMGetFontDimensions( int * outCharWidth, /* Can be NULL */ int * outCharHeight, /* Can be NULL */ int * outDigitsOnly); /* Can be NULL */ - #if defined(XPLM200) /* * XPLMMeasureString @@ -429,7 +426,6 @@ XPLM_API float XPLMMeasureString( const char * inChar, int inNumChars); #endif /* XPLM200 */ - #ifdef __cplusplus } #endif diff --git a/SDK/CHeaders/XPLM/XPLMInstance.h b/SDK/CHeaders/XPLM/XPLMInstance.h index f2460fb..54cc7fd 100644 --- a/SDK/CHeaders/XPLM/XPLMInstance.h +++ b/SDK/CHeaders/XPLM/XPLMInstance.h @@ -2,7 +2,7 @@ #define _XPLMInstance_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -54,7 +54,6 @@ extern "C" { * */ - /* * XPLMInstanceRef * @@ -62,7 +61,6 @@ extern "C" { * */ typedef void * XPLMInstanceRef; - /* * XPLMCreateInstance * @@ -86,7 +84,21 @@ typedef void * XPLMInstanceRef; XPLM_API XPLMInstanceRef XPLMCreateInstance( XPLMObjectRef obj, const char ** datarefs); - +#if defined(XPLM420) +/* + * XPLMInstanceSetAutoShift + * + * XPLMInstanceSetAutoShift tells X-Plane to move the location of your + * instance every time the sim\'s local coordinate sytem changes, so that a + * static instance does not have to be moved. Without this, a plugin is + * responsible for updating an instance's local position when the coordinate + * system shifts. Use this for static instances that you would not otherwise + * have to move. + * + */ +XPLM_API void XPLMInstanceSetAutoShift( + XPLMInstanceRef instance); +#endif /* XPLM420 */ /* * XPLMDestroyInstance * @@ -100,7 +112,6 @@ XPLM_API XPLMInstanceRef XPLMCreateInstance( */ XPLM_API void XPLMDestroyInstance( XPLMInstanceRef instance); - /*************************************************************************** * Instance Manipulation ***************************************************************************/ @@ -128,7 +139,28 @@ XPLM_API void XPLMInstanceSetPosition( XPLMInstanceRef instance, const XPLMDrawInfo_t * new_position, const float * data); - +#if defined(XPLM420) +/* + * XPLMInstanceSetPositionDouble + * + * Updates both the position of the instance and all datarefs you registered + * for it. Call this from a flight loop callback or UI callback. + * + * __DO_NOT__ call XPLMInstanceSetPositionDouble from a drawing callback; the + * whole point of instancing is that you do not need any drawing callbacks. + * Setting instance data from a drawing callback may have undefined + * consequences, and the drawing callback hurts FPS unnecessarily. + * + * The memory pointed to by the data pointer must be large enough to hold one + * float for every dataref you have registered, and must contain valid + * floating point data. + * + */ +XPLM_API void XPLMInstanceSetPositionDouble( + XPLMInstanceRef instance, + const XPLMDrawInfoDouble_t * new_position, + const float * data); +#endif /* XPLM420 */ #ifdef __cplusplus } #endif diff --git a/SDK/CHeaders/XPLM/XPLMMap.h b/SDK/CHeaders/XPLM/XPLMMap.h index de77144..33fe51c 100644 --- a/SDK/CHeaders/XPLM/XPLMMap.h +++ b/SDK/CHeaders/XPLM/XPLMMap.h @@ -2,7 +2,7 @@ #define _XPLMMap_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -79,7 +79,6 @@ extern "C" { * */ - /* * XPLMMapLayerID * @@ -88,7 +87,6 @@ extern "C" { * */ typedef void * XPLMMapLayerID; - /* * XPLMMapProjectionID * @@ -97,7 +95,6 @@ typedef void * XPLMMapLayerID; * */ typedef void * XPLMMapProjectionID; - /* * XPLMMapStyle * @@ -119,7 +116,6 @@ enum { }; typedef int XPLMMapStyle; - /* * XPLMMapDrawingCallback_f * @@ -143,7 +139,6 @@ typedef void (* XPLMMapDrawingCallback_f)( XPLMMapStyle mapStyle, XPLMMapProjectionID projection, void * inRefcon); - /* * XPLMMapIconDrawingCallback_f * @@ -169,7 +164,6 @@ typedef void (* XPLMMapIconDrawingCallback_f)( XPLMMapStyle mapStyle, XPLMMapProjectionID projection, void * inRefcon); - /* * XPLMMapLabelDrawingCallback_f * @@ -195,7 +189,6 @@ typedef void (* XPLMMapLabelDrawingCallback_f)( XPLMMapStyle mapStyle, XPLMMapProjectionID projection, void * inRefcon); - #endif /* XPLM300 */ #if defined(XPLM300) /*************************************************************************** @@ -209,7 +202,6 @@ typedef void (* XPLMMapLabelDrawingCallback_f)( * */ - /* * XPLMMapPrepareCacheCallback_f * @@ -237,7 +229,6 @@ typedef void (* XPLMMapPrepareCacheCallback_f)( const float * inTotalMapBoundsLeftTopRightBottom, XPLMMapProjectionID projection, void * inRefcon); - /* * XPLMMapWillBeDeletedCallback_f * @@ -249,7 +240,6 @@ typedef void (* XPLMMapPrepareCacheCallback_f)( typedef void (* XPLMMapWillBeDeletedCallback_f)( XPLMMapLayerID inLayer, void * inRefcon); - #endif /* XPLM300 */ #if defined(XPLM300) /*************************************************************************** @@ -269,7 +259,6 @@ typedef void (* XPLMMapWillBeDeletedCallback_f)( * */ - /* * XPLMMapLayerType * @@ -290,15 +279,12 @@ enum { }; typedef int XPLMMapLayerType; - /* Globally unique identifier for X-Plane's Map window, used as the * * mapToCreateLayerIn parameter in XPLMCreateMapLayer_t */ #define XPLM_MAP_USER_INTERFACE "XPLM_MAP_USER_INTERFACE" - /* Globally unique identifier for X-Plane's Instructor Operator Station * * window, used as the mapToCreateLayerIn parameter in XPLMCreateMapLayer_t */ #define XPLM_MAP_IOS "XPLM_MAP_IOS" - /* * XPLMCreateMapLayer_t * @@ -350,7 +336,6 @@ typedef struct { /* A reference to arbitrary data that will be passed to your callbacks */ void * refcon; } XPLMCreateMapLayer_t; - /* * XPLMCreateMapLayer * @@ -368,7 +353,6 @@ typedef struct { */ XPLM_API XPLMMapLayerID XPLMCreateMapLayer( XPLMCreateMapLayer_t * inParams); - /* * XPLMDestroyMapLayer * @@ -379,7 +363,6 @@ XPLM_API XPLMMapLayerID XPLMCreateMapLayer( */ XPLM_API int XPLMDestroyMapLayer( XPLMMapLayerID inLayer); - /* * XPLMMapCreatedCallback_f * @@ -393,7 +376,6 @@ XPLM_API int XPLMDestroyMapLayer( typedef void (* XPLMMapCreatedCallback_f)( const char * mapIdentifier, void * refcon); - /* * XPLMRegisterMapCreationHook * @@ -408,7 +390,6 @@ typedef void (* XPLMMapCreatedCallback_f)( XPLM_API void XPLMRegisterMapCreationHook( XPLMMapCreatedCallback_f callback, void * refcon); - /* * XPLMMapExists * @@ -419,7 +400,6 @@ XPLM_API void XPLMRegisterMapCreationHook( */ XPLM_API int XPLMMapExists( const char * mapIdentifier); - #endif /* XPLM300 */ #if defined(XPLM300) /*************************************************************************** @@ -441,7 +421,6 @@ XPLM_API int XPLMMapExists( * */ - /* * XPLMMapOrientation * @@ -463,7 +442,6 @@ enum { }; typedef int XPLMMapOrientation; - /* * XPLMDrawMapIconFromSheet * @@ -509,7 +487,6 @@ XPLM_API void XPLMDrawMapIconFromSheet( XPLMMapOrientation orientation, float rotationDegrees, float mapWidth); - /* * XPLMDrawMapLabel * @@ -526,7 +503,6 @@ XPLM_API void XPLMDrawMapLabel( float mapY, XPLMMapOrientation orientation, float rotationDegrees); - #endif /* XPLM300 */ #if defined(XPLM300) /*************************************************************************** @@ -548,7 +524,6 @@ XPLM_API void XPLMDrawMapLabel( * */ - /* * XPLMMapProject * @@ -566,7 +541,6 @@ XPLM_API void XPLMMapProject( double longitude, float * outX, float * outY); - /* * XPLMMapUnproject * @@ -584,7 +558,6 @@ XPLM_API void XPLMMapUnproject( float mapY, double * outLatitude, double * outLongitude); - /* * XPLMMapScaleMeter * @@ -600,7 +573,6 @@ XPLM_API float XPLMMapScaleMeter( XPLMMapProjectionID projection, float mapX, float mapY); - /* * XPLMMapGetNorthHeading * @@ -619,7 +591,6 @@ XPLM_API float XPLMMapGetNorthHeading( XPLMMapProjectionID projection, float mapX, float mapY); - #endif /* XPLM300 */ #ifdef __cplusplus } diff --git a/SDK/CHeaders/XPLM/XPLMMenus.h b/SDK/CHeaders/XPLM/XPLMMenus.h index 2c8fcd0..146d66c 100644 --- a/SDK/CHeaders/XPLM/XPLMMenus.h +++ b/SDK/CHeaders/XPLM/XPLMMenus.h @@ -2,7 +2,7 @@ #define _XPLMMenus_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -72,7 +72,6 @@ enum { }; typedef int XPLMMenuCheck; - /* * XPLMMenuID * @@ -80,7 +79,6 @@ typedef int XPLMMenuCheck; * */ typedef void * XPLMMenuID; - /* * XPLMMenuHandler_f * @@ -92,7 +90,6 @@ typedef void * XPLMMenuID; typedef void (* XPLMMenuHandler_f)( void * inMenuRef, void * inItemRef); - /* * XPLMFindPluginsMenu * @@ -101,7 +98,6 @@ typedef void (* XPLMMenuHandler_f)( * */ XPLM_API XPLMMenuID XPLMFindPluginsMenu(void); - #if defined(XPLM300) /* * XPLMFindAircraftMenu @@ -120,7 +116,6 @@ XPLM_API XPLMMenuID XPLMFindPluginsMenu(void); */ XPLM_API XPLMMenuID XPLMFindAircraftMenu(void); #endif /* XPLM300 */ - /* * XPLMCreateMenu * @@ -142,7 +137,6 @@ XPLM_API XPLMMenuID XPLMCreateMenu( int inParentItem, XPLMMenuHandler_f inHandler, void * inMenuRef); - /* * XPLMDestroyMenu * @@ -152,7 +146,6 @@ XPLM_API XPLMMenuID XPLMCreateMenu( */ XPLM_API void XPLMDestroyMenu( XPLMMenuID inMenuID); - /* * XPLMClearAllMenuItems * @@ -162,7 +155,6 @@ XPLM_API void XPLMDestroyMenu( */ XPLM_API void XPLMClearAllMenuItems( XPLMMenuID inMenuID); - /* * XPLMAppendMenuItem * @@ -187,7 +179,6 @@ XPLM_API int XPLMAppendMenuItem( const char * inItemName, void * inItemRef, int inDeprecatedAndIgnored); - #if defined(XPLM300) /* * XPLMAppendMenuItemWithCommand @@ -210,19 +201,14 @@ XPLM_API int XPLMAppendMenuItemWithCommand( const char * inItemName, XPLMCommandRef inCommandToExecute); #endif /* XPLM300 */ - /* * XPLMAppendMenuSeparator * * This routine adds a separator to the end of a menu. - * - * Returns a negative index if the append failed (due to an invalid parent - * menu argument). * */ XPLM_API void XPLMAppendMenuSeparator( XPLMMenuID inMenu); - /* * XPLMSetMenuItemName * @@ -235,7 +221,6 @@ XPLM_API void XPLMSetMenuItemName( int inIndex, const char * inItemName, int inDeprecatedAndIgnored); - /* * XPLMCheckMenuItem * @@ -246,7 +231,6 @@ XPLM_API void XPLMCheckMenuItem( XPLMMenuID inMenu, int index, XPLMMenuCheck inCheck); - /* * XPLMCheckMenuItemState * @@ -258,7 +242,6 @@ XPLM_API void XPLMCheckMenuItemState( XPLMMenuID inMenu, int index, XPLMMenuCheck * outCheck); - /* * XPLMEnableMenuItem * @@ -269,7 +252,6 @@ XPLM_API void XPLMEnableMenuItem( XPLMMenuID inMenu, int index, int enabled); - #if defined(XPLM210) /* * XPLMRemoveMenuItem @@ -282,7 +264,6 @@ XPLM_API void XPLMRemoveMenuItem( XPLMMenuID inMenu, int inIndex); #endif /* XPLM210 */ - #ifdef __cplusplus } #endif diff --git a/SDK/CHeaders/XPLM/XPLMNavigation.h b/SDK/CHeaders/XPLM/XPLMNavigation.h index c26ed3b..dd02dff 100644 --- a/SDK/CHeaders/XPLM/XPLMNavigation.h +++ b/SDK/CHeaders/XPLM/XPLMNavigation.h @@ -2,7 +2,7 @@ #define _XPLMNavigation_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -77,7 +77,6 @@ enum { }; typedef int XPLMNavType; - /* * XPLMNavRef * @@ -93,9 +92,7 @@ typedef int XPLMNavType; * */ typedef int XPLMNavRef; - #define XPLM_NAV_NOT_FOUND -1 - /* * XPLMGetFirstNavAid * @@ -105,7 +102,6 @@ typedef int XPLMNavRef; * */ XPLM_API XPLMNavRef XPLMGetFirstNavAid(void); - /* * XPLMGetNextNavAid * @@ -117,7 +113,6 @@ XPLM_API XPLMNavRef XPLMGetFirstNavAid(void); */ XPLM_API XPLMNavRef XPLMGetNextNavAid( XPLMNavRef inNavAidRef); - /* * XPLMFindFirstNavAidOfType * @@ -128,7 +123,6 @@ XPLM_API XPLMNavRef XPLMGetNextNavAid( */ XPLM_API XPLMNavRef XPLMFindFirstNavAidOfType( XPLMNavType inType); - /* * XPLMFindLastNavAidOfType * @@ -139,7 +133,6 @@ XPLM_API XPLMNavRef XPLMFindFirstNavAidOfType( */ XPLM_API XPLMNavRef XPLMFindLastNavAidOfType( XPLMNavType inType); - /* * XPLMFindNavAid * @@ -175,7 +168,6 @@ XPLM_API XPLMNavRef XPLMFindNavAid( float * inLon, /* Can be NULL */ int * inFrequency, /* Can be NULL */ XPLMNavType inType); - /* * XPLMGetNavAidInfo * @@ -207,7 +199,6 @@ XPLM_API void XPLMGetNavAidInfo( char * outID, /* Can be NULL */ char * outName, /* Can be NULL */ char * outReg); /* Can be NULL */ - /*************************************************************************** * FLIGHT MANAGEMENT COMPUTER ***************************************************************************/ @@ -222,7 +213,6 @@ XPLM_API void XPLMGetNavAidInfo( * */ - /* * XPLMCountFMSEntries * @@ -230,7 +220,6 @@ XPLM_API void XPLMGetNavAidInfo( * */ XPLM_API int XPLMCountFMSEntries(void); - /* * XPLMGetDisplayedFMSEntry * @@ -238,7 +227,6 @@ XPLM_API int XPLMCountFMSEntries(void); * */ XPLM_API int XPLMGetDisplayedFMSEntry(void); - /* * XPLMGetDestinationFMSEntry * @@ -246,7 +234,6 @@ XPLM_API int XPLMGetDisplayedFMSEntry(void); * */ XPLM_API int XPLMGetDestinationFMSEntry(void); - /* * XPLMSetDisplayedFMSEntry * @@ -255,7 +242,6 @@ XPLM_API int XPLMGetDestinationFMSEntry(void); */ XPLM_API void XPLMSetDisplayedFMSEntry( int inIndex); - /* * XPLMSetDestinationFMSEntry * @@ -265,7 +251,6 @@ XPLM_API void XPLMSetDisplayedFMSEntry( */ XPLM_API void XPLMSetDestinationFMSEntry( int inIndex); - /* * XPLMGetFMSEntryInfo * @@ -295,7 +280,6 @@ XPLM_API void XPLMGetFMSEntryInfo( int * outAltitude, /* Can be NULL */ float * outLat, /* Can be NULL */ float * outLon); /* Can be NULL */ - /* * XPLMSetFMSEntryInfo * @@ -309,7 +293,6 @@ XPLM_API void XPLMSetFMSEntryInfo( int inIndex, XPLMNavRef inRef, int inAltitude); - /* * XPLMSetFMSEntryLatLon * @@ -322,7 +305,6 @@ XPLM_API void XPLMSetFMSEntryLatLon( float inLat, float inLon, int inAltitude); - /* * XPLMClearFMSEntry * @@ -332,7 +314,6 @@ XPLM_API void XPLMSetFMSEntryLatLon( */ XPLM_API void XPLMClearFMSEntry( int inIndex); - #if defined(XPLM410) /* * XPLMNavFlightPlan @@ -364,7 +345,6 @@ enum { }; typedef int XPLMNavFlightPlan; #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMCountFMSFlightPlanEntries @@ -375,7 +355,6 @@ typedef int XPLMNavFlightPlan; XPLM_API int XPLMCountFMSFlightPlanEntries( XPLMNavFlightPlan inFlightPlan); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMGetDisplayedFMSFlightPlanEntry @@ -386,7 +365,6 @@ XPLM_API int XPLMCountFMSFlightPlanEntries( XPLM_API int XPLMGetDisplayedFMSFlightPlanEntry( XPLMNavFlightPlan inFlightPlan); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMGetDestinationFMSFlightPlanEntry @@ -397,7 +375,6 @@ XPLM_API int XPLMGetDisplayedFMSFlightPlanEntry( XPLM_API int XPLMGetDestinationFMSFlightPlanEntry( XPLMNavFlightPlan inFlightPlan); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetDisplayedFMSFlightPlanEntry @@ -409,7 +386,6 @@ XPLM_API void XPLMSetDisplayedFMSFlightPlanEntry( XPLMNavFlightPlan inFlightPlan, int inIndex); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetDestinationFMSFlightPlanEntry @@ -422,7 +398,6 @@ XPLM_API void XPLMSetDestinationFMSFlightPlanEntry( XPLMNavFlightPlan inFlightPlan, int inIndex); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetDirectToFMSFlightPlanEntry @@ -436,7 +411,6 @@ XPLM_API void XPLMSetDirectToFMSFlightPlanEntry( XPLMNavFlightPlan inFlightPlan, int inIndex); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMGetFMSFlightPlanEntryInfo @@ -469,7 +443,6 @@ XPLM_API void XPLMGetFMSFlightPlanEntryInfo( float * outLat, /* Can be NULL */ float * outLon); /* Can be NULL */ #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetFMSFlightPlanEntryInfo @@ -487,7 +460,6 @@ XPLM_API void XPLMSetFMSFlightPlanEntryInfo( XPLMNavRef inRef, int inAltitude); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetFMSFlightPlanEntryLatLon @@ -503,7 +475,6 @@ XPLM_API void XPLMSetFMSFlightPlanEntryLatLon( float inLon, int inAltitude); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSetFMSFlightPlanEntryLatLonWithId @@ -521,7 +492,6 @@ XPLM_API void XPLMSetFMSFlightPlanEntryLatLonWithId( const char* inId, unsigned int inIdLength); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMClearFMSFlightPlanEntry @@ -534,7 +504,6 @@ XPLM_API void XPLMClearFMSFlightPlanEntry( XPLMNavFlightPlan inFlightPlan, int inIndex); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMLoadFMSFlightPlan @@ -549,7 +518,6 @@ XPLM_API void XPLMLoadFMSFlightPlan( const char * inBuffer, unsigned int inBufferLen); #endif /* XPLM410 */ - #if defined(XPLM410) /* * XPLMSaveFMSFlightPlan @@ -571,7 +539,6 @@ XPLM_API unsigned int XPLMSaveFMSFlightPlan( char * inBuffer, unsigned int inBufferLen); #endif /* XPLM410 */ - /*************************************************************************** * GPS RECEIVER ***************************************************************************/ @@ -588,7 +555,6 @@ XPLM_API unsigned int XPLMSaveFMSFlightPlan( * */ XPLM_API XPLMNavType XPLMGetGPSDestinationType(void); - /* * XPLMGetGPSDestination * @@ -596,7 +562,6 @@ XPLM_API XPLMNavType XPLMGetGPSDestinationType(void); * */ XPLM_API XPLMNavRef XPLMGetGPSDestination(void); - #ifdef __cplusplus } #endif diff --git a/SDK/CHeaders/XPLM/XPLMPlanes.h b/SDK/CHeaders/XPLM/XPLMPlanes.h index bd5b84d..4cc9758 100644 --- a/SDK/CHeaders/XPLM/XPLMPlanes.h +++ b/SDK/CHeaders/XPLM/XPLMPlanes.h @@ -2,7 +2,7 @@ #define _XPLMPlanes_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -14,9 +14,22 @@ * The XPLMPlanes APIs allow you to control the various aircraft in X-Plane, * both the user's and the sim's. * - * *Note*: unlike almost all other APIs in the SDK, aircraft paths are _full_ - * file system paths for historical reasons. You'll need to prefix all - * relative paths with the X-Plane path as accessed via XPLMGetSystemPath. + * You cannot initialize a flight from any XPLM callback. Only initialize a + * flight in response to: + * * Command handlers + * * Menu handlers + * * UI handlers (keyboard, mouse) from XPLMDisplay/widgets + * * The pre-flightmodel processing callback + * + * In particular, do not initialize a flight from: + * * The post-flightmodel processing callback + * * Dataref get/set handlers + * * Any drawing callbacks + * + * *Note*: Some older APIs for accessing aircraft require full paths and not + * paths relative to the X-Plane folder for historical reasons. You will need + * to prefix all relative paths with the X-Plane path as accessed via + * XPLMGetSystemPath. * */ @@ -29,13 +42,106 @@ extern "C" { /*************************************************************************** * USER AIRCRAFT ACCESS ***************************************************************************/ +/* + * These routines are used to initialize and manipulate the user's aircraft. + * + */ + +#if defined(XPLM430) +/* + * XPLMInitResult + * + * Result codes from initializing or updating the user's aircraft. + * Initialization can fail due to unparsable/invalid data, or due to the + * contents of the initialization containing parameters the sim cannot fulfill + * (e.g. an aircraft not on disk, a ramp start not present in an airport due + * to custom scenery). + * + * If an initialization fails, a human-readable string is sent to your + * plugin's error function. This is meant for debugging purposes only and + * should not be parsed. Your plugin's logic should only use the result code + * for flow control. + * + */ +enum { + /* The initialization succeeded. */ + xplm_Init_Success = 0, + + /* The provided argument was invalid. This can be returned if the provided * + * string is not a valid json string. This error can also be returned if one * + * or more of the provided arguments is invalid, such as a missing required * + * field or an unrecognized parameter such as an unknown runway name. Invalid * + * errors imply that your calling code is generating incorrect JSON and should* + * be fixed; use your plugin's error callback to find more detailed * + * information about the problem with your input. */ + xplm_Init_Invalid = 1, + /* The new flight could not be initialized because one of the aircraft * + * requested could not be found on disk or loaded. */ + xplm_Init_MissingAircraft = 2, + + /* The new flight could not be initialized because one of the aircraft's' * + * requested liveries could not be found on disk or loaded. */ + xplm_Init_MissingLivery = 3, + + /* The new flight could not be initialized because the requested airport was * + * not found in X-Plane's airport database. */ + xplm_Init_MissingAirport = 4, + + /* The new flight could not be initialized because the requested ramp start * + * was not found at the specified airport in X-Plane's airport database. */ + xplm_Init_MissingRamp = 5, + + /* The new flight could not be initialized because the requested runway was * + * not found at the specified airport in X-Plane's airport database. */ + xplm_Init_MissingRunway = 6, + + +}; +typedef int XPLMInitResult; +#endif /* XPLM430 */ +#if defined(XPLM430) +/* + * XPLMInitFlight + * + * Initialize a new flight, ending th user's current flight. The flight config + * is provided as json string. See + * https://developer.x-plane.com/article/flight-initialization-api/ for the + * JSON format specification. + * + * Returns a XPLMInitResult enum value specifying whether the initalization + * succeeeded (and if not, what caused it to fail). + * + */ +XPLM_API XPLMInitResult XPLMInitFlight( + char const* inJsonData); +#endif /* XPLM430 */ +#if defined(XPLM430) +/* + * XPLMUpdateFlight + * + * Updates the user's 'current flight, modifying some flight parameters. The + * flight config is provided as a JSON string, see + * https://developer.x-plane.com/article/flight-initialization-api/ for the + * JSON format specification. + * + * Returns an XPLMInitResult enum value specifying whether hte update + * suceeeded (and if not, what caused it to fail). + * + */ +XPLM_API XPLMInitResult XPLMUpdateFlight( + char const* inJsonData); +#endif /* XPLM430 */ /* * XPLMSetUsersAircraft * * This routine changes the user's aircraft. Note that this will reinitialize * the user to be on the nearest airport's first runway. Pass in a full path * (hard drive and everything including the .acf extension) to the .acf file. + * + * Use XPLMInitFlight for complete control over initialization. + * + * **WARNING**: this API takes a full, not relative aicraft path. * */ XPLM_API void XPLMSetUsersAircraft( @@ -45,6 +151,8 @@ XPLM_API void XPLMSetUsersAircraft( * * This routine places the user at a given airport. Specify the airport by * its X-Plane airport ID (e.g. 'KBOS'). + * + * Use XPLMInitFlight for complete control over initialization. * */ XPLM_API void XPLMPlaceUserAtAirport( @@ -60,6 +168,8 @@ XPLM_API void XPLMPlaceUserAtAirport( * aircraft will always start with its engines running, regardless of the * user's preferences (i.e., regardless of what the dataref * `sim/operation/prefs/startup_running` says). + * + * Use XPLMInitFlight for complete control over initialization. * */ XPLM_API void XPLMPlaceUserAtLocation( @@ -72,6 +182,11 @@ XPLM_API void XPLMPlaceUserAtLocation( /*************************************************************************** * GLOBAL AIRCRAFT ACCESS ***************************************************************************/ +/* + * These APIs let you control the AI aircraft and take over multiplayer/aI + * aircraft control. + * + */ /* The user's aircraft is always index 0. */ #define XPLM_USER_AIRCRAFT 0 @@ -154,7 +269,6 @@ XPLM_API void XPLMGetNthAircraftModel( * */ - /* * XPLMPlanesAvailable_f * @@ -165,7 +279,6 @@ XPLM_API void XPLMGetNthAircraftModel( */ typedef void (* XPLMPlanesAvailable_f)( void * inRefcon); - /* * XPLMAcquirePlanes * @@ -178,6 +291,8 @@ typedef void (* XPLMPlanesAvailable_f)( * extension. NULL terminates this array, or pass NULL if there are no planes * you want loaded. * + * Aircraft paths for this API are full, not relative aircraft paths. + * * If you pass in a callback and do not receive access to the planes your * callback will be called when the airplanes are available. If you do receive * airplane access, your callback will not be called. @@ -187,7 +302,6 @@ XPLM_API int XPLMAcquirePlanes( char ** inAircraft, /* Can be NULL */ XPLMPlanesAvailable_f inCallback, void * inRefcon); - /* * XPLMReleasePlanes * @@ -196,7 +310,6 @@ XPLM_API int XPLMAcquirePlanes( * */ XPLM_API void XPLMReleasePlanes(void); - /* * XPLMSetActiveAircraftCount * @@ -207,7 +320,6 @@ XPLM_API void XPLMReleasePlanes(void); */ XPLM_API void XPLMSetActiveAircraftCount( int inCount); - /* * XPLMSetAircraftModel * @@ -215,12 +327,13 @@ XPLM_API void XPLMSetActiveAircraftCount( * exclusive access to the airplane APIs. Pass in the path of the model with * the .acf extension. The index is zero based, but you may not pass in 0 * (use XPLMSetUsersAircraft to load the user's aircracft). + * + * This API takes a full aircraft path. * */ XPLM_API void XPLMSetAircraftModel( int inIndex, const char * inAircraftPath); - /* * XPLMDisableAIForPlane * @@ -230,7 +343,6 @@ XPLM_API void XPLMSetAircraftModel( */ XPLM_API void XPLMDisableAIForPlane( int inPlaneIndex); - #if defined(XPLM_DEPRECATED) /* * XPLMDrawAircraft @@ -257,7 +369,6 @@ XPLM_API void XPLMDrawAircraft( int inFullDraw, XPLMPlaneDrawState_t * inDrawStateInfo); #endif /* XPLM_DEPRECATED */ - #if defined(XPLM_DEPRECATED) /* * XPLMReinitUsersPlane @@ -279,7 +390,6 @@ XPLM_API void XPLMDrawAircraft( */ XPLM_API void XPLMReinitUsersPlane(void); #endif /* XPLM_DEPRECATED */ - #ifdef __cplusplus } #endif diff --git a/SDK/CHeaders/XPLM/XPLMPlugin.h b/SDK/CHeaders/XPLM/XPLMPlugin.h index da84ac8..663b2bf 100644 --- a/SDK/CHeaders/XPLM/XPLMPlugin.h +++ b/SDK/CHeaders/XPLM/XPLMPlugin.h @@ -2,7 +2,7 @@ #define _XPLMPlugin_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -33,7 +33,6 @@ extern "C" { * */ - /* * XPLMGetMyID * @@ -42,7 +41,6 @@ extern "C" { * */ XPLM_API XPLMPluginID XPLMGetMyID(void); - /* * XPLMCountPlugins * @@ -51,7 +49,6 @@ XPLM_API XPLMPluginID XPLMGetMyID(void); * */ XPLM_API int XPLMCountPlugins(void); - /* * XPLMGetNthPlugin * @@ -62,7 +59,6 @@ XPLM_API int XPLMCountPlugins(void); */ XPLM_API XPLMPluginID XPLMGetNthPlugin( int inIndex); - /* * XPLMFindPluginByPath * @@ -73,7 +69,6 @@ XPLM_API XPLMPluginID XPLMGetNthPlugin( */ XPLM_API XPLMPluginID XPLMFindPluginByPath( const char * inPath); - /* * XPLMFindPluginBySignature * @@ -87,7 +82,6 @@ XPLM_API XPLMPluginID XPLMFindPluginByPath( */ XPLM_API XPLMPluginID XPLMFindPluginBySignature( const char * inSignature); - /* * XPLMGetPluginInfo * @@ -107,7 +101,6 @@ XPLM_API void XPLMGetPluginInfo( char * outFilePath, /* Can be NULL */ char * outSignature, /* Can be NULL */ char * outDescription); /* Can be NULL */ - /*************************************************************************** * ENABLING/DISABLING PLUG-INS ***************************************************************************/ @@ -117,7 +110,6 @@ XPLM_API void XPLMGetPluginInfo( * */ - /* * XPLMIsPluginEnabled * @@ -126,7 +118,6 @@ XPLM_API void XPLMGetPluginInfo( */ XPLM_API int XPLMIsPluginEnabled( XPLMPluginID inPluginID); - /* * XPLMEnablePlugin * @@ -138,16 +129,14 @@ XPLM_API int XPLMIsPluginEnabled( */ XPLM_API int XPLMEnablePlugin( XPLMPluginID inPluginID); - /* * XPLMDisablePlugin * - * This routine disableds an enabled plug-in. + * This routine disables an enabled plug-in. * */ XPLM_API void XPLMDisablePlugin( XPLMPluginID inPluginID); - /* * XPLMReloadPlugins * @@ -159,7 +148,6 @@ XPLM_API void XPLMDisablePlugin( * */ XPLM_API void XPLMReloadPlugins(void); - /*************************************************************************** * INTERPLUGIN MESSAGING ***************************************************************************/ @@ -197,40 +185,32 @@ XPLM_API void XPLMReloadPlugins(void); * */ - /* This message is sent to your plugin whenever the user's plane crashes. The * * parameter is ignored. */ #define XPLM_MSG_PLANE_CRASHED 101 - /* This message is sent to your plugin whenever a new plane is loaded. The * * parameter contains the index number of the plane being loaded; 0 indicates * - * the user's plane. */ + * the user's plane. The parameter is an integer bit-cast to a pointer. */ #define XPLM_MSG_PLANE_LOADED 102 - /* This messages is sent whenever the user's plane is positioned at a new * * airport. The parameter is ignored. */ #define XPLM_MSG_AIRPORT_LOADED 103 - /* This message is sent whenever new scenery is loaded. Use datarefs to * * determine the new scenery files that were loaded. The parameter is ignored.*/ #define XPLM_MSG_SCENERY_LOADED 104 - /* This message is sent whenever the user adjusts the number of X-Plane * * aircraft models. You must use XPLMCountPlanes to find out how many planes * * are now available. This message will only be sent in XP7 and higher * * because in XP6 the number of aircraft is not user-adjustable. The parameter* * is ignored. */ #define XPLM_MSG_AIRPLANE_COUNT_CHANGED 105 - #if defined(XPLM200) /* This message is sent to your plugin whenever a plane is unloaded. The * * parameter contains the index number of the plane being unloaded; 0 * - * indicates the user's plane. The parameter is of type int, passed as the * - * value of the pointer. (That is: the parameter is an int, not a pointer to * - * an int.) */ + * indicates the user's plane. The parameter is of type int, bit-cast to a * + * pointer. */ #define XPLM_MSG_PLANE_UNLOADED 106 #endif /* XPLM200 */ - #if defined(XPLM210) /* This message is sent to your plugin right before X-Plane writes its * * preferences file. You can use this for two purposes: to write your own * @@ -241,29 +221,26 @@ XPLM_API void XPLMReloadPlugins(void); * The parameter is ignored. */ #define XPLM_MSG_WILL_WRITE_PREFS 107 #endif /* XPLM210 */ - #if defined(XPLM210) /* This message is sent to your plugin right after a livery is loaded for an * * airplane. You can use this to check the new livery (via datarefs) and * * react accordingly. The parameter contains the index number of the aircraft* - * whose livery is changing. */ + * whose livery is changing. The parameter is an integer, bit-cast to a * + * pointer. */ #define XPLM_MSG_LIVERY_LOADED 108 #endif /* XPLM210 */ - #if defined(XPLM301) /* Sent to your plugin right before X-Plane enters virtual reality mode (at * * which time any windows that are not positioned in VR mode will no longer be* * visible to the user). The parameter is unused and should be ignored. */ #define XPLM_MSG_ENTERED_VR 109 #endif /* XPLM301 */ - #if defined(XPLM301) /* Sent to your plugin right before X-Plane leaves virtual reality mode (at * * which time you may want to clean up windows that are positioned in VR * * mode). The parameter is unused and should be ignored. */ #define XPLM_MSG_EXITING_VR 110 #endif /* XPLM301 */ - #if defined(XPLM303) /* Sent to your plugin if another plugin wants to take over AI planes. If you * * are a synthetic traffic provider, that probably means a plugin for an * @@ -274,25 +251,23 @@ XPLM_API void XPLMReloadPlugins(void); * plugin ID of the plugin asking for control of the planes now. You can use * * it to find out who is requesting and whether you should yield to them. * * Synthetic traffic providers should always yield to online networks. The * - * parameter is unused and should be ignored. */ + * parameter is unused and should be ignored. Do not send this message * + * directly; always use the XPLMAcquirePlanes() call. */ #define XPLM_MSG_RELEASE_PLANES 111 #endif /* XPLM303 */ - #if defined(XPLM400) /* Sent to your plugin after FMOD sound banks are loaded. The parameter is the* * XPLMBankID enum in XPLMSound.h, 0 for the master bank and 1 for the radio * - * bank. */ + * bank. The bank ID is bit-cast to a pointer. */ #define XPLM_MSG_FMOD_BANK_LOADED 112 #endif /* XPLM400 */ - #if defined(XPLM400) /* Sent to your plugin before FMOD sound banks are unloaded. Any associated * * resources should be cleaned up at this point. The parameter is the * * XPLMBankID enum in XPLMSound.h, 0 for the master bank and 1 for the radio * - * bank. */ + * bank. The bank ID is bit-cast to a pointer. */ #define XPLM_MSG_FMOD_BANK_UNLOADING 113 #endif /* XPLM400 */ - #if defined(XPLM400) /* Sent to your plugin per-frame (at-most) when/if datarefs are added. It will* * include the new data ref total count so that your plugin can keep a local * @@ -300,10 +275,10 @@ XPLM_API void XPLMReloadPlugins(void); * if it cares. * * * * This message is only sent to plugins that enable the * - * XPLM_WANTS_DATAREF_NOTIFICATIONS feature. */ + * XPLM_WANTS_DATAREF_NOTIFICATIONS feature. The parameteter is a pointer to a* + * 32-bit integer containing the new number of datarefs. */ #define XPLM_MSG_DATAREFS_ADDED 114 #endif /* XPLM400 */ - /* * XPLMSendMessageToPlugin * @@ -316,7 +291,6 @@ XPLM_API void XPLMSendMessageToPlugin( XPLMPluginID inPlugin, int inMessage, void * inParam); - #if defined(XPLM200) /*************************************************************************** * Plugin Features API @@ -390,7 +364,6 @@ XPLM_API void XPLMSendMessageToPlugin( * */ - /* * XPLMFeatureEnumerator_f * @@ -402,7 +375,6 @@ XPLM_API void XPLMSendMessageToPlugin( typedef void (* XPLMFeatureEnumerator_f)( const char * inFeature, void * inRef); - /* * XPLMHasFeature * @@ -412,7 +384,6 @@ typedef void (* XPLMFeatureEnumerator_f)( */ XPLM_API int XPLMHasFeature( const char * inFeature); - /* * XPLMIsFeatureEnabled * @@ -423,7 +394,6 @@ XPLM_API int XPLMHasFeature( */ XPLM_API int XPLMIsFeatureEnabled( const char * inFeature); - /* * XPLMEnableFeature * @@ -435,7 +405,6 @@ XPLM_API int XPLMIsFeatureEnabled( XPLM_API void XPLMEnableFeature( const char * inFeature, int inEnable); - /* * XPLMEnumerateFeatures * @@ -447,7 +416,6 @@ XPLM_API void XPLMEnableFeature( XPLM_API void XPLMEnumerateFeatures( XPLMFeatureEnumerator_f inEnumerator, void * inRef); - #endif /* XPLM200 */ #ifdef __cplusplus } diff --git a/SDK/CHeaders/XPLM/XPLMProcessing.h b/SDK/CHeaders/XPLM/XPLMProcessing.h index 247e71e..9939880 100644 --- a/SDK/CHeaders/XPLM/XPLMProcessing.h +++ b/SDK/CHeaders/XPLM/XPLMProcessing.h @@ -2,7 +2,7 @@ #define _XPLMProcessing_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -30,6 +30,13 @@ * callback after the deadline" schedule, e.g. your callbacks will always be * slightly late to ensure that we don't run faster than your deadline. * + * WARNING: Do NOT use the post-flightmodel callback for initialization, + * resource creation, etc. The only recommended use of post-FM callbacks is to + * "patch" the computed values of the flightmodel using dataref read-writes, + * and to compute custom system values by reading the flightmodel. APIs that + * create resources or initialize the sim may issue warnings, crash rhe sim, + * or have unexpected results. + * * WARNING: Do NOT use these callbacks to draw! You cannot draw during flight * loop callbacks. Use the drawing callbacks (see XPLMDisplay for more info) * for graphics or the XPLMInstance functions for aircraft or models. (One @@ -67,7 +74,6 @@ enum { }; typedef int XPLMFlightLoopPhaseType; #endif /* XPLM210 */ - #if defined(XPLM210) /* * XPLMFlightLoopID @@ -79,7 +85,6 @@ typedef int XPLMFlightLoopPhaseType; */ typedef void * XPLMFlightLoopID; #endif /* XPLM210 */ - /* * XPLMFlightLoop_f * @@ -119,7 +124,6 @@ typedef float (* XPLMFlightLoop_f)( float inElapsedTimeSinceLastFlightLoop, int inCounter, void * inRefcon); - #if defined(XPLM210) /* * XPLMCreateFlightLoop_t @@ -136,7 +140,6 @@ typedef struct { void * refcon; } XPLMCreateFlightLoop_t; #endif /* XPLM210 */ - /* * XPLMGetElapsedTime * @@ -150,7 +153,6 @@ typedef struct { * */ XPLM_API float XPLMGetElapsedTime(void); - /* * XPLMGetCycleNumber * @@ -159,7 +161,6 @@ XPLM_API float XPLMGetElapsedTime(void); * */ XPLM_API int XPLMGetCycleNumber(void); - /* * XPLMRegisterFlightLoopCallback * @@ -179,7 +180,6 @@ XPLM_API void XPLMRegisterFlightLoopCallback( XPLMFlightLoop_f inFlightLoop, float inInterval, void * inRefcon); - /* * XPLMUnregisterFlightLoopCallback * @@ -194,7 +194,6 @@ XPLM_API void XPLMRegisterFlightLoopCallback( XPLM_API void XPLMUnregisterFlightLoopCallback( XPLMFlightLoop_f inFlightLoop, void * inRefcon); - /* * XPLMSetFlightLoopCallbackInterval * @@ -214,7 +213,6 @@ XPLM_API void XPLMSetFlightLoopCallbackInterval( float inInterval, int inRelativeToNow, void * inRefcon); - #if defined(XPLM210) /* * XPLMCreateFlightLoop @@ -227,7 +225,6 @@ XPLM_API void XPLMSetFlightLoopCallbackInterval( XPLM_API XPLMFlightLoopID XPLMCreateFlightLoop( XPLMCreateFlightLoop_t * inParams); #endif /* XPLM210 */ - #if defined(XPLM210) /* * XPLMDestroyFlightLoop @@ -239,7 +236,6 @@ XPLM_API XPLMFlightLoopID XPLMCreateFlightLoop( XPLM_API void XPLMDestroyFlightLoop( XPLMFlightLoopID inFlightLoopID); #endif /* XPLM210 */ - #if defined(XPLM210) /* * XPLMScheduleFlightLoop @@ -259,7 +255,6 @@ XPLM_API void XPLMScheduleFlightLoop( float inInterval, int inRelativeToNow); #endif /* XPLM210 */ - #ifdef __cplusplus } #endif diff --git a/SDK/CHeaders/XPLM/XPLMScenery.h b/SDK/CHeaders/XPLM/XPLMScenery.h index d15f83d..f8aabe7 100644 --- a/SDK/CHeaders/XPLM/XPLMScenery.h +++ b/SDK/CHeaders/XPLM/XPLMScenery.h @@ -2,7 +2,7 @@ #define _XPLMScenery_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -56,7 +56,6 @@ extern "C" { * */ - /* * XPLMProbeType * @@ -73,7 +72,6 @@ enum { }; typedef int XPLMProbeType; - /* * XPLMProbeResult * @@ -95,7 +93,6 @@ enum { }; typedef int XPLMProbeResult; - /* * XPLMProbeRef * @@ -104,7 +101,6 @@ typedef int XPLMProbeResult; * */ typedef void * XPLMProbeRef; - /* * XPLMProbeInfo_t * @@ -139,7 +135,6 @@ typedef struct { /* Tells if the surface we hit is water (otherwise it is land). */ int is_wet; } XPLMProbeInfo_t; - /* * XPLMCreateProbe * @@ -148,7 +143,6 @@ typedef struct { */ XPLM_API XPLMProbeRef XPLMCreateProbe( XPLMProbeType inProbeType); - /* * XPLMDestroyProbe * @@ -157,7 +151,6 @@ XPLM_API XPLMProbeRef XPLMCreateProbe( */ XPLM_API void XPLMDestroyProbe( XPLMProbeRef inProbe); - /* * XPLMProbeTerrainXYZ * @@ -173,7 +166,6 @@ XPLM_API XPLMProbeResult XPLMProbeTerrainXYZ( float inY, float inZ, XPLMProbeInfo_t * outInfo); - #endif /* XPLM200 */ #if defined(XPLM300) /*************************************************************************** @@ -193,7 +185,6 @@ XPLM_API XPLMProbeResult XPLMProbeTerrainXYZ( * */ - /* * XPLMGetMagneticVariation * @@ -204,7 +195,6 @@ XPLM_API XPLMProbeResult XPLMProbeTerrainXYZ( XPLM_API float XPLMGetMagneticVariation( double latitude, double longitude); - /* * XPLMDegTrueToDegMagnetic * @@ -214,7 +204,6 @@ XPLM_API float XPLMGetMagneticVariation( */ XPLM_API float XPLMDegTrueToDegMagnetic( float headingDegreesTrue); - /* * XPLMDegMagneticToDegTrue * @@ -224,7 +213,6 @@ XPLM_API float XPLMDegTrueToDegMagnetic( */ XPLM_API float XPLMDegMagneticToDegTrue( float headingDegreesMagnetic); - #endif /* XPLM300 */ /*************************************************************************** * Object Drawing @@ -237,7 +225,6 @@ XPLM_API float XPLMDegMagneticToDegTrue( * */ - #if defined(XPLM200) /* * XPLMObjectRef @@ -248,7 +235,6 @@ XPLM_API float XPLMDegMagneticToDegTrue( */ typedef void * XPLMObjectRef; #endif /* XPLM200 */ - #if defined(XPLM200) /* * XPLMDrawInfo_t @@ -275,7 +261,32 @@ typedef struct { float roll; } XPLMDrawInfo_t; #endif /* XPLM200 */ - +#if defined(XPLM420) +/* + * XPLMDrawInfoDouble_t + * + * The XPLMDrawInfo_t structure contains positioning info for one object that + * is to be drawn. Be sure to set structSize to the size of the structure for + * future expansion. + * + */ +typedef struct { + /* Set this to the size of this structure! */ + int structSize; + /* X location of the object in local coordinates. */ + double x; + /* Y location of the object in local coordinates. */ + double y; + /* Z location of the object in local coordinates. */ + double z; + /* Pitch in degres to rotate the object, positive is up. */ + double pitch; + /* Heading in local coordinates to rotate the object, clockwise. */ + double heading; + /* Roll to rotate the object. */ + double roll; +} XPLMDrawInfoDouble_t; +#endif /* XPLM420 */ #if defined(XPLM210) /* * XPLMObjectLoaded_f @@ -294,7 +305,6 @@ typedef void (* XPLMObjectLoaded_f)( XPLMObjectRef inObject, void * inRefcon); #endif /* XPLM210 */ - #if defined(XPLM200) /* * XPLMLoadObject @@ -322,7 +332,6 @@ typedef void (* XPLMObjectLoaded_f)( XPLM_API XPLMObjectRef XPLMLoadObject( const char * inPath); #endif /* XPLM200 */ - #if defined(XPLM210) /* * XPLMLoadObjectAsync @@ -346,7 +355,6 @@ XPLM_API void XPLMLoadObjectAsync( XPLMObjectLoaded_f inCallback, void * inRefcon); #endif /* XPLM210 */ - #if defined(XPLM_DEPRECATED) /* * XPLMDrawObjects @@ -381,7 +389,6 @@ XPLM_API void XPLMDrawObjects( int lighting, int earth_relative); #endif /* XPLM_DEPRECATED */ - #if defined(XPLM200) /* * XPLMUnloadObject @@ -395,7 +402,6 @@ XPLM_API void XPLMDrawObjects( XPLM_API void XPLMUnloadObject( XPLMObjectRef inObject); #endif /* XPLM200 */ - #if defined(XPLM200) /*************************************************************************** * Library Access @@ -408,7 +414,6 @@ XPLM_API void XPLMUnloadObject( * */ - /* * XPLMLibraryEnumerator_f * @@ -420,7 +425,6 @@ XPLM_API void XPLMUnloadObject( typedef void (* XPLMLibraryEnumerator_f)( const char * inFilePath, void * inRef); - /* * XPLMLookupObjects * @@ -441,7 +445,6 @@ XPLM_API int XPLMLookupObjects( float inLongitude, XPLMLibraryEnumerator_f enumerator, void * ref); - #endif /* XPLM200 */ #ifdef __cplusplus } diff --git a/SDK/CHeaders/XPLM/XPLMSound.h b/SDK/CHeaders/XPLM/XPLMSound.h index 9e89bb6..2ba3f6b 100644 --- a/SDK/CHeaders/XPLM/XPLMSound.h +++ b/SDK/CHeaders/XPLM/XPLMSound.h @@ -2,7 +2,7 @@ #define _XPLMSound_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -73,7 +73,6 @@ enum { }; typedef int XPLMAudioBus; - /* * XPLMBankID * @@ -92,7 +91,6 @@ enum { }; typedef int XPLMBankID; - /* * If you want to get full access to FMOD sound features, you need to include fmod.h or fmod.hpp yourself FIRST. * If you only need the basic wrapper functions which allow 3D placement and playback on a specified channel, there @@ -108,7 +106,6 @@ typedef int XPLMBankID; * with their C++ equivalents. See https://www.fmod.com/docs/2.02/api/white-papers-handle-system.html . */ #if defined(_FMOD_COMMON_H) - /* * XPLMGetFMODStudio * @@ -123,7 +120,6 @@ typedef int XPLMBankID; * */ XPLM_API FMOD_STUDIO_SYSTEM* XPLMGetFMODStudio(void); - /* * XPLMGetFMODChannelGroup * @@ -134,7 +130,6 @@ XPLM_API FMOD_STUDIO_SYSTEM* XPLMGetFMODStudio(void); XPLM_API FMOD_CHANNELGROUP* XPLMGetFMODChannelGroup( XPLMAudioBus audioType); - #else /* * These definitions are enough to play a basic sound without linking to the full FMOD distribution. You can still position it in 3D @@ -157,7 +152,6 @@ typedef struct FMOD_VECTOR } FMOD_VECTOR; typedef void FMOD_CHANNEL; #endif - /* * XPLMPCMComplete_f * @@ -169,7 +163,6 @@ typedef void FMOD_CHANNEL; typedef void (* XPLMPCMComplete_f)( void * inRefcon, FMOD_RESULT status); - /* * XPLMPlayPCMOnBus * @@ -198,7 +191,6 @@ XPLM_API FMOD_CHANNEL* XPLMPlayPCMOnBus( XPLMAudioBus audioType, XPLMPCMComplete_f inCallback, void * inRefcon); /* Can be NULL */ - /* * XPLMStopAudio * @@ -209,7 +201,6 @@ XPLM_API FMOD_CHANNEL* XPLMPlayPCMOnBus( */ XPLM_API FMOD_RESULT XPLMStopAudio( FMOD_CHANNEL* fmod_channel); - /* * XPLMSetAudioPosition * @@ -221,7 +212,6 @@ XPLM_API FMOD_RESULT XPLMSetAudioPosition( FMOD_CHANNEL* fmod_channel, FMOD_VECTOR* position, FMOD_VECTOR* velocity); - /* * XPLMSetAudioFadeDistance * @@ -237,7 +227,6 @@ XPLM_API FMOD_RESULT XPLMSetAudioFadeDistance( FMOD_CHANNEL* fmod_channel, float min_fade_distance, float max_fade_distance); - /* * XPLMSetAudioVolume * @@ -250,7 +239,6 @@ XPLM_API FMOD_RESULT XPLMSetAudioFadeDistance( XPLM_API FMOD_RESULT XPLMSetAudioVolume( FMOD_CHANNEL* fmod_channel, float source_volume); - /* * XPLMSetAudioPitch * @@ -260,7 +248,6 @@ XPLM_API FMOD_RESULT XPLMSetAudioVolume( XPLM_API FMOD_RESULT XPLMSetAudioPitch( FMOD_CHANNEL* fmod_channel, float audio_pitch_hz); - /* * XPLMSetAudioCone * @@ -275,7 +262,6 @@ XPLM_API FMOD_RESULT XPLMSetAudioCone( float outside_angle, float outside_volume, FMOD_VECTOR* orientation); - #endif /* XPLM400 */ #ifdef __cplusplus } diff --git a/SDK/CHeaders/XPLM/XPLMUtilities.h b/SDK/CHeaders/XPLM/XPLMUtilities.h index d2fbf93..b0a6721 100644 --- a/SDK/CHeaders/XPLM/XPLMUtilities.h +++ b/SDK/CHeaders/XPLM/XPLMUtilities.h @@ -2,7 +2,7 @@ #define _XPLMUtilities_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -62,7 +62,6 @@ extern "C" { * */ - #if defined(XPLM200) /* * XPLMDataFileType @@ -83,7 +82,6 @@ enum { }; typedef int XPLMDataFileType; #endif /* XPLM200 */ - /* * XPLMGetSystemPath * @@ -96,7 +94,6 @@ typedef int XPLMDataFileType; */ XPLM_API void XPLMGetSystemPath( char * outSystemPath); - /* * XPLMGetPrefsPath * @@ -111,7 +108,6 @@ XPLM_API void XPLMGetSystemPath( */ XPLM_API void XPLMGetPrefsPath( char * outPrefsPath); - /* * XPLMGetDirectorySeparator * @@ -122,7 +118,6 @@ XPLM_API void XPLMGetPrefsPath( * */ XPLM_API const char * XPLMGetDirectorySeparator(void); - /* * XPLMExtractFileAndPath * @@ -135,7 +130,6 @@ XPLM_API const char * XPLMGetDirectorySeparator(void); */ XPLM_API char * XPLMExtractFileAndPath( char * inFullPath); - /* * XPLMGetDirectoryContents * @@ -187,7 +181,6 @@ XPLM_API int XPLMGetDirectoryContents( int inIndexCount, int * outTotalFiles, /* Can be NULL */ int * outReturnedFiles); /* Can be NULL */ - #if defined(XPLM200) /* * XPLMLoadDataFile @@ -201,7 +194,6 @@ XPLM_API int XPLMLoadDataFile( XPLMDataFileType inFileType, const char * inFilePath); /* Can be NULL */ #endif /* XPLM200 */ - #if defined(XPLM200) /* * XPLMSaveDataFile @@ -214,7 +206,6 @@ XPLM_API int XPLMSaveDataFile( XPLMDataFileType inFileType, const char * inFilePath); #endif /* XPLM200 */ - /*************************************************************************** * X-PLANE MISC ***************************************************************************/ @@ -277,7 +268,6 @@ enum { }; typedef int XPLMHostApplicationID; - /* * XPLMLanguageCode * @@ -325,7 +315,6 @@ enum { }; typedef int XPLMLanguageCode; - #if defined(XPLM200) /* * XPLMError_f @@ -343,7 +332,6 @@ typedef int XPLMLanguageCode; typedef void (* XPLMError_f)( const char * inMessage); #endif /* XPLM200 */ - #if defined(XPLM_DEPRECATED) /* * XPLMInitialized @@ -360,7 +348,6 @@ typedef void (* XPLMError_f)( */ XPLM_API int XPLMInitialized(void); #endif /* XPLM_DEPRECATED */ - /* * XPLMGetVersions * @@ -377,7 +364,6 @@ XPLM_API void XPLMGetVersions( int * outXPlaneVersion, int * outXPLMVersion, XPLMHostApplicationID * outHostID); - /* * XPLMGetLanguage * @@ -385,7 +371,6 @@ XPLM_API void XPLMGetVersions( * */ XPLM_API XPLMLanguageCode XPLMGetLanguage(void); - #if defined(XPLM200) /* * XPLMFindSymbol @@ -418,7 +403,6 @@ XPLM_API XPLMLanguageCode XPLMGetLanguage(void); XPLM_API void * XPLMFindSymbol( const char * inString); #endif /* XPLM200 */ - #if defined(XPLM200) /* * XPLMSetErrorCallback @@ -448,7 +432,6 @@ XPLM_API void * XPLMFindSymbol( XPLM_API void XPLMSetErrorCallback( XPLMError_f inCallback); #endif /* XPLM200 */ - /* * XPLMDebugString * @@ -465,7 +448,6 @@ XPLM_API void XPLMSetErrorCallback( */ XPLM_API void XPLMDebugString( const char * inString); - /* * XPLMSpeakString * @@ -477,7 +459,6 @@ XPLM_API void XPLMDebugString( */ XPLM_API void XPLMSpeakString( const char * inString); - /* * XPLMGetVirtualKeyDescription * @@ -489,7 +470,6 @@ XPLM_API void XPLMSpeakString( */ XPLM_API const char * XPLMGetVirtualKeyDescription( char inVirtualKey); - /* * XPLMReloadScenery * @@ -502,7 +482,6 @@ XPLM_API const char * XPLMGetVirtualKeyDescription( * */ XPLM_API void XPLMReloadScenery(void); - #if defined(XPLM200) /*************************************************************************** * X-PLANE COMMAND MANAGEMENT @@ -547,7 +526,6 @@ XPLM_API void XPLMReloadScenery(void); * */ - /* * XPLMCommandPhase * @@ -567,7 +545,6 @@ enum { }; typedef int XPLMCommandPhase; - /* * XPLMCommandRef * @@ -582,7 +559,6 @@ typedef int XPLMCommandPhase; * */ typedef void * XPLMCommandRef; - /* * XPLMCommandCallback_f * @@ -600,7 +576,6 @@ typedef int (* XPLMCommandCallback_f)( XPLMCommandRef inCommand, XPLMCommandPhase inPhase, void * inRefcon); - /* * XPLMFindCommand * @@ -610,7 +585,6 @@ typedef int (* XPLMCommandCallback_f)( */ XPLM_API XPLMCommandRef XPLMFindCommand( const char * inName); - /* * XPLMCommandBegin * @@ -622,7 +596,6 @@ XPLM_API XPLMCommandRef XPLMFindCommand( */ XPLM_API void XPLMCommandBegin( XPLMCommandRef inCommand); - /* * XPLMCommandEnd * @@ -633,7 +606,6 @@ XPLM_API void XPLMCommandBegin( */ XPLM_API void XPLMCommandEnd( XPLMCommandRef inCommand); - /* * XPLMCommandOnce * @@ -644,7 +616,6 @@ XPLM_API void XPLMCommandEnd( */ XPLM_API void XPLMCommandOnce( XPLMCommandRef inCommand); - /* * XPLMCreateCommand * @@ -657,7 +628,6 @@ XPLM_API void XPLMCommandOnce( XPLM_API XPLMCommandRef XPLMCreateCommand( const char * inName, const char * inDescription); - /* * XPLMRegisterCommandHandler * @@ -676,7 +646,6 @@ XPLM_API void XPLMRegisterCommandHandler( XPLMCommandCallback_f inHandler, int inBefore, void * inRefcon); - /* * XPLMUnregisterCommandHandler * @@ -689,7 +658,6 @@ XPLM_API void XPLMUnregisterCommandHandler( XPLMCommandCallback_f inHandler, int inBefore, void * inRefcon); - #endif /* XPLM200 */ #if defined(XPLM_DEPRECATED) /*************************************************************************** @@ -710,7 +678,6 @@ XPLM_API void XPLMUnregisterCommandHandler( * */ - /* * XPLMCommandKeyID * @@ -817,7 +784,6 @@ enum { xplm_key_max }; typedef int XPLMCommandKeyID; - /* * XPLMCommandButtonID * @@ -925,7 +891,6 @@ enum { xplm_joy_max }; typedef int XPLMCommandButtonID; - /* * XPLMSimulateKeyPress * @@ -940,7 +905,7 @@ typedef int XPLMCommandButtonID; XPLM_API void XPLMSimulateKeyPress( int inKeyType, int inKey); - +#if defined(XPLM_DEPRECATED) /* * XPLMCommandKeyStroke * @@ -954,7 +919,8 @@ XPLM_API void XPLMSimulateKeyPress( */ XPLM_API void XPLMCommandKeyStroke( XPLMCommandKeyID inKey); - +#endif /* XPLM_DEPRECATED */ +#if defined(XPLM_DEPRECATED) /* * XPLMCommandButtonPress * @@ -969,7 +935,8 @@ XPLM_API void XPLMCommandKeyStroke( */ XPLM_API void XPLMCommandButtonPress( XPLMCommandButtonID inButton); - +#endif /* XPLM_DEPRECATED */ +#if defined(XPLM_DEPRECATED) /* * XPLMCommandButtonRelease * @@ -981,7 +948,7 @@ XPLM_API void XPLMCommandButtonPress( */ XPLM_API void XPLMCommandButtonRelease( XPLMCommandButtonID inButton); - +#endif /* XPLM_DEPRECATED */ #endif /* XPLM_DEPRECATED */ #ifdef __cplusplus } diff --git a/SDK/CHeaders/XPLM/XPLMWeather.h b/SDK/CHeaders/XPLM/XPLMWeather.h index 3f1f50f..83df9d0 100644 --- a/SDK/CHeaders/XPLM/XPLMWeather.h +++ b/SDK/CHeaders/XPLM/XPLMWeather.h @@ -2,7 +2,7 @@ #define _XPLMWeather_h_ /* - * Copyright 2005-2022 Laminar Research, Sandy Barbour and Ben Supnik All + * Copyright 2005-2025 Laminar Research, Sandy Barbour and Ben Supnik All * rights reserved. See license.txt for usage. X-Plane SDK Version: 4.0.0 * */ @@ -12,6 +12,13 @@ ***************************************************************************/ /* * This provides access to the X-Plane 12 enhanced weather system. + * + * ALL FUNCTIONS RELATING TO UPDATING THE WEATHER ARE CURRENTLY EXPERIMENTAL, + * FOR EVALUATION. + * + * The API will be kept stable if at all possible during the evaluation + * period. The details of how the data is processed will change over time as + * the weather engine changes, even after the API is stabilised. * */ @@ -21,6 +28,7 @@ extern "C" { #endif +#if defined(XPLM400) /*************************************************************************** * WEATHER ACCESS ***************************************************************************/ @@ -30,20 +38,20 @@ extern "C" { * */ typedef struct { - /* Altitude MSL, meters */ + /* Altitude MSL, meters. */ float alt_msl; - /* Wind speed, meters/sec */ + /* Wind speed, meters/sec. When setting, use a negative value to signify * + * 'undefined'. */ float speed; /* Direction (true) */ float direction; - /* Gust speed, meters/sec */ + /* Gust speed, meters/sec. Total speed, not increase above wind speed. */ float gust_speed; /* Shear arc, degrees i.e. 50% of this arc in either direction from base */ float shear; /* Clear-air turbulence ratio */ float turbulence; } XPLMWeatherInfoWinds_t; - /* * XPLMWeatherInfoClouds_t * @@ -58,37 +66,66 @@ typedef struct { /* Altitude MSL, meters */ float alt_base; } XPLMWeatherInfoClouds_t; - +/* The number of wind layers that are expected in the latest version of * + * XPLMWeatherInfo_t . */ +#define XPLM_NUM_WIND_LAYERS 13 +/* The number of cloud layers that are expected in the latest version of * + * XPLMWeatherInfo_t . */ +#define XPLM_NUM_CLOUD_LAYERS 3 +#if defined(XPLM420) +/* The number of temperature layers that are expected in the latest version of* + * XPLMWeatherInfo_t . */ +#define XPLM_NUM_TEMPERATURE_LAYERS 13 +#endif /* XPLM420 */ +#if defined(XPLM420) +/* Use this value to designate a wind layer as undefined when setting. */ +#define XPLM_WIND_UNDEFINED_LAYER -1 +#endif /* XPLM420 */ +#if defined(XPLM420) +/* Default radius of weather data points set using XPLMSetWeatherAtLocation * + * and XPLMSetWeatherAtAirport. */ +#define XPLM_DEFAULT_WXR_RADIUS_NM 30 +#endif /* XPLM420 */ +#if defined(XPLM420) +/* Default vertical limit of effect of weather data points set using * + * XPLMSetWeatherAtLocation and XPLMSetWeatherAtAirport. */ +#define XPLM_DEFAULT_WXR_LIMIT_MSL_FT 10000 +#endif /* XPLM420 */ /* * XPLMWeatherInfo_t * - * Basic weather conditions at a specific point. + * Basic weather conditions at a specific point. To specify exactly what data + * you intend to send or receive, it is required to set the structSize + * appropriately. + * + * Version 2 data starts at "temp_layers". * */ typedef struct { - /* The size of the struct. */ + /* The size of the struct. Required for both reading and writing. */ int structSize; /* Temperature at the given altitude in Celsius */ float temperature_alt; /* Dewpoint at the given altitude in Celsius */ float dewpoint_alt; - /* Pressure at the given altitude in Pascals */ + /* Pressure at the given altitude in Pascals. Pass 0 when setting to use * + * sea-level pressure instead of QNH. */ float pressure_alt; - /* Precipitation rate at the given altitude */ + /* Precipitation rate at the given altitude. Unused when setting. */ float precip_rate_alt; - /* Wind direction at the given altitude */ + /* Wind direction at the given altitude. Unused when setting. */ float wind_dir_alt; - /* Wind speed at the given altitude, meters/sec */ + /* Wind speed at the given altitude, meters/sec. Unused when setting. */ float wind_spd_alt; - /* Turbulence ratio at the given altitude */ + /* Turbulence ratio at the given altitude. Unused when setting. */ float turbulence_alt; /* Height of water waves in meters */ float wave_height; - /* Length of water waves in meters */ + /* Length of water waves in meters. Unused when setting. */ float wave_length; /* Direction from which water waves are coming */ int wave_dir; - /* Speed of wave advance in meters/sec */ + /* Speed of wave advance in meters/sec. Unused when setting. */ float wave_speed; /* Base visibility at 0 altitude, meters */ float visibility; @@ -96,40 +133,72 @@ typedef struct { float precip_rate; /* Climb rate due to thermals, meters/sec */ float thermal_climb; - /* Pressure at 0 altitude in Pascals */ + /* Pressure at sealevel in Pascals. Used when setting ONLY if pressure_alt * + * (i.e. QNH) is not valid. */ float pressure_sl; /* Defined wind layers. Not all layers are always defined. */ - XPLMWeatherInfoWinds_t wind_layers[13]; + XPLMWeatherInfoWinds_t wind_layers[XPLM_NUM_WIND_LAYERS]; /* Defined cloud layers. Not all layers are always defined. */ - XPLMWeatherInfoClouds_t cloud_layers[3]; + XPLMWeatherInfoClouds_t cloud_layers[XPLM_NUM_CLOUD_LAYERS]; +#if defined(XPLM420) + /* Temperatures at altitude, in degrees C. Layer altitudes are the same * + * globally - see the 'sim/weather/region/atmosphere_alt_levels_m' dataref. */ + float temp_layers[XPLM_NUM_TEMPERATURE_LAYERS]; +#endif /* XPLM420 */ +#if defined(XPLM420) + /* Dewpoints at altitude, in degrees C. Layer altitudes are the same globally * + * - see the 'sim/weather/region/atmosphere_alt_levels_m' dataref. */ + float dewp_layers[XPLM_NUM_TEMPERATURE_LAYERS]; +#endif /* XPLM420 */ +#if defined(XPLM420) + /* The altitude in MSL of the troposphere. */ + float troposphere_alt; +#endif /* XPLM420 */ +#if defined(XPLM420) + /* The temperature in degrees C of the troposphere. */ + float troposphere_temp; +#endif /* XPLM420 */ +#if defined(XPLM420) + /* Age in seconds of this weather report. Age affects how strongly the report * + * affects the resulting weather. */ + float age; +#endif /* XPLM420 */ +#if defined(XPLM420) + /* Horizontal radius of effect of this weather report, nautical miles. */ + float radius_nm; +#endif /* XPLM420 */ +#if defined(XPLM420) + /* Vertical limit of effect of this weather report, feet MSL. */ + float max_altitude_msl_ft; +#endif /* XPLM420 */ } XPLMWeatherInfo_t; - -#if defined(XPLM400) /* * XPLMGetMETARForAirport * * Get the last-downloaded METAR report for an airport by ICAO code. Note that * the actual weather at that airport may have evolved significantly since the * last downloaded METAR. outMETAR must point to a char buffer of at least 150 - * characters. This call is not intended to be used per-frame. This call does - * not return the current weather at the airport, and returns an empty string - * if the system is not in real-weather mode. + * characters. THIS CALL DOES NOT RETURN THE CURRENT WEATHER AT THE AIRPORT, + * and returns an empty string if the system is not in real-weather mode. + * + * This call is not intended to be used per-frame. It should be called only + * during the pre-flight loop callback. * */ XPLM_API void XPLMGetMETARForAirport( const char * airport_id, XPLMFixedString150_t * outMETAR); -#endif /* XPLM400 */ - -#if defined(XPLM400) /* * XPLMGetWeatherAtLocation * * Get the current weather conditions at a given location. Note that this does * not work world-wide, only within the surrounding region. Return 1 if * detailed weather (i.e. an airport-specific METAR) was found, 0 if not. In - * both cases, the structure will contain the best data available. This call - * is not intended to be used per-frame. + * both cases, the structure will contain the best data available. The passed + * in altitude is used to sample wind data vertically. + * + * This call is not intended to be used per-frame. It should be called only + * during the pre-flight loop callback. * */ XPLM_API int XPLMGetWeatherAtLocation( @@ -137,8 +206,163 @@ XPLM_API int XPLMGetWeatherAtLocation( double longitude, double altitude_m, XPLMWeatherInfo_t * out_info); +#if defined(XPLM420) +/* + * XPLMBeginWeatherUpdate + * + * Inform the simulator that you are starting a batch update of weather + * information. If you are providing multiple weather updates, using this call + * may improve performance by telling the simulator not to update weather + * until you are done. + * + * This call is not intended to be used per-frame. It should be called only + * during the pre-flight loop callback. You must call XPLMEndWeatherUpdate + * before you return from the callback; XPLMBeginWeatherUpdate in one callback + * and XPLMEndWeatherUpdate in a later callback, even within the same frame, + * is not permitted. + * + */ +XPLM_API void XPLMBeginWeatherUpdate(void); +#endif /* XPLM420 */ +#if defined(XPLM420) +/* + * XPLMEndWeatherUpdate + * + * Inform the simulator that you are ending a batch update of weather + * information. If you have called XPLMBeginWeatherUpdate, you MUST call + * XPLMEndWeatherUpdate before exiting your callback otherwise any accumulated + * weather data will be discarded. + * + * When using incremental mode, any changes made are applied to your existing + * data. This makes it possible to only update a fraction of your weather data + * at any one time. When not using incremental mode, ALL reports previously + * passed by your plugin are erased before applying new data. + * + * When using any of these 'weather set' APIs, the normal mode of operation is + * that you are setting the weather in the near future. Currently this is + * somewhere between one and two minutes but do not rely on this remaining the + * same. + * + * Setting future weather ensures that there is no sudden jump in weather + * conditions when you make a change mid-cycle. In some situations, notably + * for an initial setup, you may want to ensure that the weather is changed + * instantly. To do this, set 'updateImmediately' as true. + * + * isIncremental : If true, append or modify existing records created by + * your plugin. If false, clear any existing records. updateImmediately : If + * true, immediately reset and recalculate the weather. If false, your new + * data will be used when the weather next recalculates. + * + * This call is not intended to be used per-frame. It should be called only + * during the pre-flight loop callback. + * + */ +XPLM_API void XPLMEndWeatherUpdate( + int isIncremental, + int updateImmediately); +#endif /* XPLM420 */ +#if defined(XPLM420) +/* + * XPLMSetWeatherAtLocation + * + * Set the current weather conditions at a given location on the ground and + * above it.. Please see the notes on individual fields in + * XPLMSetWeatherAtAirport, and notes on timing in XPLMEndWeatherUpdate. + * + * The ground altitude passed into this function call does not set the area of + * influence of this weather vertically; the weather takes effect from 0 MSL + * ground up to the passed in max_altitude_msl_ft The ground altitude passed + * in is the elevation of the reporting station to calibrate QNH. + * + * This call is not intended to be used per-frame. It should be called only + * during the pre-flight loop callback. + * + */ +XPLM_API void XPLMSetWeatherAtLocation( + double latitude, + double longitude, + double ground_altitude_msl, + XPLMWeatherInfo_t * in_info); +#endif /* XPLM420 */ +#if defined(XPLM420) +/* + * XPLMEraseWeatherAtLocation + * + * Erase weather conditions set by your plugin at a given location. You must + * give exactly the same coordinates that you used to create a weather record + * at this point. It does NOT mean 'create clear weather at this location'. + * + * This call is not intended to be used per-frame. It should be called only + * during the pre-flight loop callback. + * + */ +XPLM_API void XPLMEraseWeatherAtLocation( + double latitude, + double longitude); +#endif /* XPLM420 */ +#if defined(XPLM420) +/* + * XPLMSetWeatherAtAirport + * + * Set the current weather conditions at a given airport. Unlike + * XPLMSetWeatherAtLocation, this call will replace any existing weather + * records for that airport from other sources (i.e. downloaded METARs) + * instead of being used as just another weather sample. + * + * Some notes on individual fields: + * - pressure_alt should be QNH as reported by a station at the specified + * airport, or 0 if you are passing sealevel pressure in 'pressure_sl' + * instead. + * - pressure_sl is ignored if pressure_alt is given. + * - wind_dir_alt, wind_spd_alt, turbulence_alt, wave_speed, wave_length are + * derived from other data and are UNUSED when setting weather. + * - Temperatures can be given either as a single temperature at the ground + * altitude (temperature_alt) OR, if the struct is V2 or higher, as an + * array of temperatures aloft (temp_layers). If you pass a value for + * temperature_alt higher than -273.15 (absolute zero), that will be used + * with the altitude value to calculate an offset from ISA temperature at + * all altitudes. Any layer in temp_layers for which you set the + * temperature higher than -273.15 (absolute zero) will use that + * temperature and all others will use the existing value for the + * location, or the calculated values from temperature_alt if you also + * passed that. It is advised to use a lower value than exactly -273.15 to + * avoid floating-point precision errors. These calculated temperatures + * during a read are also affected by the troposphere altitude and + * temperature, and the vertical radius of effect. Do not expect to get + * the exact values you set. + * - The same rules apply to dewpoint temperatures; either a single value at + * ground level in 'dewpoint_alt', or per-layer values in 'dewp_layers'. + * - The troposphere altitude and temperature will be derived from existing + * data if you pass 0 or lower for troposphere_alt. Both altitude and + * temperature may be clamped to internally-defined ranges. + * - When setting both temperature and dewpoint from a single value + * (temperature_alt/dewpoint_alt), the rest of the atmosphere will be + * graded to fit between the given values and the troposphere. + * + * This call is not intended to be used per-frame. It should be called only + * during the pre-flight loop callback. + * + */ +XPLM_API void XPLMSetWeatherAtAirport( + const char * airport_id, + XPLMWeatherInfo_t * in_info); +#endif /* XPLM420 */ +#if defined(XPLM420) +/* + * XPLMEraseWeatherAtAirport + * + * Erase the current weather conditions set by your plugin at a given airport, + * allowing records from other sources to be used. It does NOT mean 'create + * clear weather at this airport'. + * + * This call is not intended to be used per-frame. It should be called only + * during the pre-flight loop callback. + * + */ +XPLM_API void XPLMEraseWeatherAtAirport( + const char * airport_id); +#endif /* XPLM420 */ #endif /* XPLM400 */ - #ifdef __cplusplus } #endif diff --git a/SDK/Libraries/Lin/XPLM_64.so b/SDK/Libraries/Lin/XPLM_64.so new file mode 100755 index 0000000..d086fd5 Binary files /dev/null and b/SDK/Libraries/Lin/XPLM_64.so differ diff --git a/SDK/Libraries/Lin/XPWidgets_64.so b/SDK/Libraries/Lin/XPWidgets_64.so new file mode 100755 index 0000000..b84d13b Binary files /dev/null and b/SDK/Libraries/Lin/XPWidgets_64.so differ diff --git a/SDK/Libraries/Mac/XPLM.framework/Resources b/SDK/Libraries/Mac/XPLM.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/SDK/Libraries/Mac/XPLM.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/SDK/Libraries/Mac/XPLM.framework/Resources/Info.plist b/SDK/Libraries/Mac/XPLM.framework/Resources/Info.plist deleted file mode 100644 index 53b5610..0000000 --- a/SDK/Libraries/Mac/XPLM.framework/Resources/Info.plist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - BuildMachineOSBuild - 22C65 - CFBundleDevelopmentRegion - English - CFBundleExecutable - XPLM - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - FMWK - CFBundleSignature - ???? - CFBundleSupportedPlatforms - - MacOSX - - CSResourcesFileMapped - - DTCompiler - com.apple.compilers.llvm.clang.1_0 - DTPlatformBuild - 14C18 - DTPlatformName - macosx - DTPlatformVersion - 13.1 - DTSDKBuild - 22C55 - DTSDKName - macosx13.1 - DTXcode - 1420 - DTXcodeBuild - 14C18 - LSMinimumSystemVersion - 10.15 - - diff --git a/SDK/Libraries/Mac/XPLM.framework/Versions/C/Resources/Info.plist b/SDK/Libraries/Mac/XPLM.framework/Versions/C/Resources/Info.plist index 53b5610..322ccd8 100644 --- a/SDK/Libraries/Mac/XPLM.framework/Versions/C/Resources/Info.plist +++ b/SDK/Libraries/Mac/XPLM.framework/Versions/C/Resources/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 22C65 + 22G313 CFBundleDevelopmentRegion English CFBundleExecutable diff --git a/SDK/Libraries/Mac/XPLM.framework/Versions/C/XPLM b/SDK/Libraries/Mac/XPLM.framework/Versions/C/XPLM index 1ea059f..f1d456d 100755 Binary files a/SDK/Libraries/Mac/XPLM.framework/Versions/C/XPLM and b/SDK/Libraries/Mac/XPLM.framework/Versions/C/XPLM differ diff --git a/SDK/Libraries/Mac/XPLM.framework/Versions/C/_CodeSignature/CodeResources b/SDK/Libraries/Mac/XPLM.framework/Versions/C/_CodeSignature/CodeResources index 1e37a64..14d4a60 100644 --- a/SDK/Libraries/Mac/XPLM.framework/Versions/C/_CodeSignature/CodeResources +++ b/SDK/Libraries/Mac/XPLM.framework/Versions/C/_CodeSignature/CodeResources @@ -6,7 +6,7 @@ Resources/Info.plist - voAQ/IDgQqHZqcOEgtUnY+ZQ4Vo= + RyZ+rg/H3cLq281FLYEnVSKuwL0= files2 @@ -15,7 +15,7 @@ hash2 - cbolIMR2jzM1jeru8QBpXnyfepv6PMzWJfroq2E2Coo= + SYG87x/kiE0V2ECkam7vTO0Wgi6AWZr6szuPpYzm+kc= diff --git a/SDK/Libraries/Mac/XPLM.framework/Versions/Current b/SDK/Libraries/Mac/XPLM.framework/Versions/Current new file mode 120000 index 0000000..96d80cd --- /dev/null +++ b/SDK/Libraries/Mac/XPLM.framework/Versions/Current @@ -0,0 +1 @@ +C \ No newline at end of file diff --git a/SDK/Libraries/Mac/XPLM.framework/Versions/Current/Resources/Info.plist b/SDK/Libraries/Mac/XPLM.framework/Versions/Current/Resources/Info.plist deleted file mode 100644 index 53b5610..0000000 --- a/SDK/Libraries/Mac/XPLM.framework/Versions/Current/Resources/Info.plist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - BuildMachineOSBuild - 22C65 - CFBundleDevelopmentRegion - English - CFBundleExecutable - XPLM - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - FMWK - CFBundleSignature - ???? - CFBundleSupportedPlatforms - - MacOSX - - CSResourcesFileMapped - - DTCompiler - com.apple.compilers.llvm.clang.1_0 - DTPlatformBuild - 14C18 - DTPlatformName - macosx - DTPlatformVersion - 13.1 - DTSDKBuild - 22C55 - DTSDKName - macosx13.1 - DTXcode - 1420 - DTXcodeBuild - 14C18 - LSMinimumSystemVersion - 10.15 - - diff --git a/SDK/Libraries/Mac/XPLM.framework/Versions/Current/XPLM b/SDK/Libraries/Mac/XPLM.framework/Versions/Current/XPLM deleted file mode 100755 index 1ea059f..0000000 Binary files a/SDK/Libraries/Mac/XPLM.framework/Versions/Current/XPLM and /dev/null differ diff --git a/SDK/Libraries/Mac/XPLM.framework/Versions/Current/_CodeSignature/CodeResources b/SDK/Libraries/Mac/XPLM.framework/Versions/Current/_CodeSignature/CodeResources deleted file mode 100644 index 1e37a64..0000000 --- a/SDK/Libraries/Mac/XPLM.framework/Versions/Current/_CodeSignature/CodeResources +++ /dev/null @@ -1,128 +0,0 @@ - - - - - files - - Resources/Info.plist - - voAQ/IDgQqHZqcOEgtUnY+ZQ4Vo= - - - files2 - - Resources/Info.plist - - hash2 - - cbolIMR2jzM1jeru8QBpXnyfepv6PMzWJfroq2E2Coo= - - - - rules - - ^Resources/ - - ^Resources/.*\.lproj/ - - optional - - weight - 1000 - - ^Resources/.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Resources/Base\.lproj/ - - weight - 1010 - - ^version.plist$ - - - rules2 - - .*\.dSYM($|/) - - weight - 11 - - ^(.*/)?\.DS_Store$ - - omit - - weight - 2000 - - ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ - - nested - - weight - 10 - - ^.* - - ^Info\.plist$ - - omit - - weight - 20 - - ^PkgInfo$ - - omit - - weight - 20 - - ^Resources/ - - weight - 20 - - ^Resources/.*\.lproj/ - - optional - - weight - 1000 - - ^Resources/.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Resources/Base\.lproj/ - - weight - 1010 - - ^[^/]+$ - - nested - - weight - 10 - - ^embedded\.provisionprofile$ - - weight - 20 - - ^version\.plist$ - - weight - 20 - - - - diff --git a/SDK/Libraries/Mac/XPWidgets.framework/Resources b/SDK/Libraries/Mac/XPWidgets.framework/Resources new file mode 120000 index 0000000..953ee36 --- /dev/null +++ b/SDK/Libraries/Mac/XPWidgets.framework/Resources @@ -0,0 +1 @@ +Versions/Current/Resources \ No newline at end of file diff --git a/SDK/Libraries/Mac/XPWidgets.framework/Resources/Info.plist b/SDK/Libraries/Mac/XPWidgets.framework/Resources/Info.plist deleted file mode 100644 index 60487dd..0000000 --- a/SDK/Libraries/Mac/XPWidgets.framework/Resources/Info.plist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - BuildMachineOSBuild - 22C65 - CFBundleDevelopmentRegion - English - CFBundleExecutable - XPWidgets - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - FMWK - CFBundleSignature - ???? - CFBundleSupportedPlatforms - - MacOSX - - CSResourcesFileMapped - - DTCompiler - com.apple.compilers.llvm.clang.1_0 - DTPlatformBuild - 14C18 - DTPlatformName - macosx - DTPlatformVersion - 13.1 - DTSDKBuild - 22C55 - DTSDKName - macosx13.1 - DTXcode - 1420 - DTXcodeBuild - 14C18 - LSMinimumSystemVersion - 10.15 - - diff --git a/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/Resources/Info.plist b/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/Resources/Info.plist index 60487dd..dd47b8e 100644 --- a/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/Resources/Info.plist +++ b/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/Resources/Info.plist @@ -3,7 +3,7 @@ BuildMachineOSBuild - 22C65 + 22G313 CFBundleDevelopmentRegion English CFBundleExecutable diff --git a/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/XPWidgets b/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/XPWidgets index c996c4a..5a65876 100755 Binary files a/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/XPWidgets and b/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/XPWidgets differ diff --git a/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/_CodeSignature/CodeResources b/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/_CodeSignature/CodeResources index cf0809d..33e5872 100644 --- a/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/_CodeSignature/CodeResources +++ b/SDK/Libraries/Mac/XPWidgets.framework/Versions/C/_CodeSignature/CodeResources @@ -6,7 +6,7 @@ Resources/Info.plist - SngFRYyYZvFDvj7WlMImI0nWjNQ= + GXCSpvIgRebJW8ZI2X22j02EYzs= files2 @@ -15,7 +15,7 @@ hash2 - cyPpU9uTChX7rFyoW42moNimK/DK8zmtQ8Wih5q0fz4= + JLk6VDsnze4DAeGo9INd/4yBI+sLI2ZLidTS7nQRI34= diff --git a/SDK/Libraries/Mac/XPWidgets.framework/Versions/Current b/SDK/Libraries/Mac/XPWidgets.framework/Versions/Current new file mode 120000 index 0000000..96d80cd --- /dev/null +++ b/SDK/Libraries/Mac/XPWidgets.framework/Versions/Current @@ -0,0 +1 @@ +C \ No newline at end of file diff --git a/SDK/Libraries/Mac/XPWidgets.framework/Versions/Current/Resources/Info.plist b/SDK/Libraries/Mac/XPWidgets.framework/Versions/Current/Resources/Info.plist deleted file mode 100644 index 60487dd..0000000 --- a/SDK/Libraries/Mac/XPWidgets.framework/Versions/Current/Resources/Info.plist +++ /dev/null @@ -1,42 +0,0 @@ - - - - - BuildMachineOSBuild - 22C65 - CFBundleDevelopmentRegion - English - CFBundleExecutable - XPWidgets - CFBundleInfoDictionaryVersion - 6.0 - CFBundlePackageType - FMWK - CFBundleSignature - ???? - CFBundleSupportedPlatforms - - MacOSX - - CSResourcesFileMapped - - DTCompiler - com.apple.compilers.llvm.clang.1_0 - DTPlatformBuild - 14C18 - DTPlatformName - macosx - DTPlatformVersion - 13.1 - DTSDKBuild - 22C55 - DTSDKName - macosx13.1 - DTXcode - 1420 - DTXcodeBuild - 14C18 - LSMinimumSystemVersion - 10.15 - - diff --git a/SDK/Libraries/Mac/XPWidgets.framework/Versions/Current/XPWidgets b/SDK/Libraries/Mac/XPWidgets.framework/Versions/Current/XPWidgets deleted file mode 100755 index c996c4a..0000000 Binary files a/SDK/Libraries/Mac/XPWidgets.framework/Versions/Current/XPWidgets and /dev/null differ diff --git a/SDK/Libraries/Mac/XPWidgets.framework/Versions/Current/_CodeSignature/CodeResources b/SDK/Libraries/Mac/XPWidgets.framework/Versions/Current/_CodeSignature/CodeResources deleted file mode 100644 index cf0809d..0000000 --- a/SDK/Libraries/Mac/XPWidgets.framework/Versions/Current/_CodeSignature/CodeResources +++ /dev/null @@ -1,128 +0,0 @@ - - - - - files - - Resources/Info.plist - - SngFRYyYZvFDvj7WlMImI0nWjNQ= - - - files2 - - Resources/Info.plist - - hash2 - - cyPpU9uTChX7rFyoW42moNimK/DK8zmtQ8Wih5q0fz4= - - - - rules - - ^Resources/ - - ^Resources/.*\.lproj/ - - optional - - weight - 1000 - - ^Resources/.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Resources/Base\.lproj/ - - weight - 1010 - - ^version.plist$ - - - rules2 - - .*\.dSYM($|/) - - weight - 11 - - ^(.*/)?\.DS_Store$ - - omit - - weight - 2000 - - ^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/ - - nested - - weight - 10 - - ^.* - - ^Info\.plist$ - - omit - - weight - 20 - - ^PkgInfo$ - - omit - - weight - 20 - - ^Resources/ - - weight - 20 - - ^Resources/.*\.lproj/ - - optional - - weight - 1000 - - ^Resources/.*\.lproj/locversion.plist$ - - omit - - weight - 1100 - - ^Resources/Base\.lproj/ - - weight - 1010 - - ^[^/]+$ - - nested - - weight - 10 - - ^embedded\.provisionprofile$ - - weight - 20 - - ^version\.plist$ - - weight - 20 - - - - diff --git a/SDK/Libraries/Win/XPLM.lib b/SDK/Libraries/Win/XPLM.lib deleted file mode 100755 index 2e78249..0000000 Binary files a/SDK/Libraries/Win/XPLM.lib and /dev/null differ diff --git a/SDK/Libraries/Win/XPLM_64.lib b/SDK/Libraries/Win/XPLM_64.lib index 090ed41..bb5dbf2 100644 Binary files a/SDK/Libraries/Win/XPLM_64.lib and b/SDK/Libraries/Win/XPLM_64.lib differ diff --git a/SDK/Libraries/Win/XPWidgets.lib b/SDK/Libraries/Win/XPWidgets.lib deleted file mode 100755 index 60e4fec..0000000 Binary files a/SDK/Libraries/Win/XPWidgets.lib and /dev/null differ diff --git a/SDK/README.txt b/SDK/README.txt index 122e3df..2cd419c 100644 --- a/SDK/README.txt +++ b/SDK/README.txt @@ -32,6 +32,49 @@ SDK website explains this process in more detail. This section contains per-release notes for the history of the X-Plane SDK. +X-Plane SDK Release 4.3.0 2/21/2026 + +The 4.3.0 SDK includes new API functionality: + + - The new XPLMInitFlight and XPLMUpdateFlight APIs in XPLMPlanes provide + complete control over creating and editing how the user's flight starts. + + These APIs supercede and expose deeper functinality than the previous + XPLMPlaceUserAtAirport and XPLMPlaceUserAtLocation APIs. + + - The third MDCU is exposed in the avionics API. + +This version of the SDK requires X-Pane 12.4.0 or newer. + + Erata note: the 4.3.0 SDK incorrectly identifies itself as version "421" + in the version includeded in X-Plane 12.4.0. Despite this, all entry points + are present. The version number is corrected to 430 to match published docs + as of X-Plane 12.4.1. + +X-Plane SDK Release 4.2.0 10/31/2025 + +The 4.2.0 SDK includes new API functionality: + + - New weather APIs allow plugins to specify weather at multiple points for + custom weather that varies spatially. + + - The weather info structure is extended to support new data fields. + + - Extended texture ID enumerations to access the radar return texture for + avionics drawing callbacks. + + - Instances can be located using double precision coordinates, and can be + set to automatically move to match scenery coordinate shifts. + + - Extended cursor enumerations for display and avionic cursor callbacks. + +This version of the SDK requires X-Plane 12.3.0 or newer. This version of the +SDK is compiled against FMOD 2.0.2. + +X-Plane SDK Release 4.1.2 1/6/2025 + +Internal changes to support 'safe mode' in the simulator. + X-Plane SDK Release 4.1.1 10/10/2024 This is a bug fix to the SDK itself; the dylib link paths on the included diff --git a/build.rs b/build.rs index 9e57cd8..c678c43 100644 --- a/build.rs +++ b/build.rs @@ -1,4 +1,4 @@ -use std::{env, path::PathBuf, path::Path}; +use std::{env, path::Path, path::PathBuf}; fn main() { println!("cargo:rerun-if-changed=NULL"); // forces the build script to run even when no file changed and a previous build is existent. @@ -61,7 +61,8 @@ fn use_bindgen() { .clang_arg("-DXPLM301") .clang_arg("-DXPLM303") .clang_arg("-DXPLM400") - .clang_arg("-DXPLM410") + .clang_arg("-DXPLM411") + .clang_arg("-DXPLM420") .parse_callbacks(Box::new(bindgen::CargoCallbacks::new())) .generate() .expect("Unable to generate bindings");