XPLMCreateAvionics_t

The XPLMCreateAvionics_t structure defines all of the parameters used to generate your own glass cockpit device by using XPLMCreateAvionicsEx(). The structure will be expanded in future SDK APIs to include more features. Always set the structSize member to the size of your struct in bytes!

typedef struct {
     // Used to inform XPLMCreateAvionicsEx() of the SDK version you compiled against; should always be set to sizeof(XPLMCreateAvionics_t)
     int                       structSize;
     // Width of the device's screen in pixels.
     int                       screenWidth;
     // Height of the device's screen in pixels.
     int                       screenHeight;
     // Width of the bezel around your device's screen for 2D pop-ups.
     int                       bezelWidth;
     // Height of the bezel around your device's screen for 2D pop-ups.
     int                       bezelHeight;
     // The screen's lateral offset into the bezel for 2D pop-ups.
     int                       screenOffsetX;
     // The screen's vertical offset into the bezel for 2D pop-ups.
     int                       screenOffsetY;
     // If set to true (1), X-Plane won't call your plugin to re-render the device's screen every frame. Instead, you should tell X-Plane you want to refresh your screen with XPLMAvionicsNeedsDrawing(), and X-Plane will call you before rendering the next simulator frame.
     int                       drawOnDemand;
     // The draw callback you will use to draw the 2D-popup bezel. This is called only when the popup window is visible, and X-Plane is about to draw the bezel in it.
     XPLMAvionicsBezelCallback_f bezelDrawCallback;
     // The draw callback you will be using to draw into the device's screen framebuffer.
     XPLMAvionicsScreenCallback_f drawCallback;
     // The mouse click callback that is called when the user clicks onto your bezel.
     XPLMAvionicsMouse_f       bezelClickCallback;
     // The mouse click callback that is called when the user clicks onto your bezel.
     XPLMAvionicsMouse_f       bezelRightClickCallback;
     // The callback that is called when the users uses the scroll wheel over your avionics' bezel.
     XPLMAvionicsMouseWheel_f  bezelScrollCallback;
     // The callback that lets you determine what cursor should be shown when the mouse is over your device's bezel.
     XPLMAvionicsCursor_f      bezelCursorCallback;
     // The mouse click callback that is called when the user clicks onto your screen.
     XPLMAvionicsMouse_f       screenTouchCallback;
     // The right mouse click callback that is called when the user clicks onto your screen.
     XPLMAvionicsMouse_f       screenRightTouchCallback;
     // The callback that is called when the users uses the scroll wheel over your avionics' screen.
     XPLMAvionicsMouseWheel_f  screenScrollCallback;
     // The callback that lets you determine what cursor should be shown when the mouse is over your device's screen.
     XPLMAvionicsCursor_f      screenCursorCallback;
     // The key callback that is called when the user types in your popup.
     XPLMAvionicsKeyboard_f    keyboardCallback;
     // The callback that is called to determine the absolute brightness of the device's screen. Set to NULL to use X-Plane's default behaviour.
     XPLMAvionicsBrightness_f  brightnessCallback;
     // A null-terminated string of maximum 64 characters to uniquely identify your cockpit device. This must be unique (you cannot re-use an ID that X-Plane or another plugin provides), and it must not contain spaces. This is the string the OBJ file must reference when marking polygons with ATTR_cockpit_device. The string is copied when you call XPLMCreateAvionicsEx, so you don't need to hold this string in memory after the call.
     char *                    deviceID;
     // A null-terminated string to give a user-readable name to your device, which can be presented in UI dialogs.
     char *                    deviceName;
     // A reference which will be passed into your draw and mouse callbacks. Use this to pass information to yourself as needed.
     void *                    refcon;
} XPLMCreateAvionics_t;