Started work on a Garmin G5 panel to work with X-Plane 11.
It took a while to create a 3D Panel. The documentation for the X-Plane, although long, doesn't exactly specify what is needed. Trying to capture it here:
I created a DLL according to an example. Inside, it has these 5 functions which must be implemented:
PLUGIN_API int XPluginStart( char * outName, char * outSig, char * outDesc) PLUGIN_API void XPluginStop(void) PLUGIN_API void XPluginDisable(void) { } PLUGIN_API int XPluginEnable(void) { return 1; } PLUGIN_API void XPluginReceiveMessage(XPLMPluginID inFrom, int inMsg, void * inParam) { }
Within XPluginStart is this initialization: XPLMCreateWindow_t params;
params is a struct with various pointers, mostly to mouse, clicks, keyboard listening functions which must be implemented, even with nothing.
Then I call this:
XPLMRegisterDrawCallback(&callbackContent, xplm_Phase_Gauges, 1, &callbackLineRefCon);
where callbackContent is a pointer to a function to be called for every draw. This calls my Garmin G5 drawing code.
However, it doesn't call this unless
Cockpit Region selection affects this.