Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "xplm-sys"
version = "0.5.1"
version = "0.5.2"
authors = ["Sam Crow <samcrow@uw.edu>"]
description = "Low-level bindings for the X-Plane plugin SDK"
repository = "https://github.com/samcrow/xplm-sys"
Expand Down
109 changes: 107 additions & 2 deletions SDK/CHeaders/XPLM/XPLMDefs.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,8 @@ typedef int XPLMPluginID;
/* 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.2.1 (421). */
#define kXPLM_Version (421)

/*
* XPLMKeyFlags
Expand Down Expand Up @@ -538,6 +538,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;
Expand Down
16 changes: 13 additions & 3 deletions SDK/CHeaders/XPLM/XPLMGraphics.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,18 @@ 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;
Expand Down Expand Up @@ -177,18 +189,16 @@ 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
Expand Down
39 changes: 39 additions & 0 deletions SDK/CHeaders/XPLM/XPLMInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,22 @@ 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
*
Expand Down Expand Up @@ -129,6 +145,29 @@ XPLM_API void XPLMInstanceSetPosition(
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
Expand Down
27 changes: 27 additions & 0 deletions SDK/CHeaders/XPLM/XPLMScenery.h
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,33 @@ typedef struct {
} 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
Expand Down
Loading