User Tools

Site Tools


pc:software:xplane11:garming5:start

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

pc:software:xplane11:garming5:start [2019/03/06 18:44]
dwheele created
pc:software:xplane11:garming5:start [2019/03/07 02:41] (current)
dwheele
Line 4: Line 4:
  
 Started work on a Garmin G5 panel to work with X-Plane 11.  Started work on a Garmin G5 panel to work with X-Plane 11. 
 +
 +===== Creating a 3D Panel =====
 +
 +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:
 +
 +==== C++ Impacts ====
 +
 +I created a DLL according to an example. Inside, it has these 5 functions which must be implemented:
 +
 +<code c++>
 +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) { }
 +</code>
 +
 +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:
 +
 +<code c++>
 +XPLMRegisterDrawCallback(&callbackContent, xplm_Phase_Gauges, 1, &callbackLineRefCon);
 +</code>
 +where ''callbackContent'' is a pointer to a function to be called for every draw. This calls my Garmin G5 drawing code.
 +
 +==== Requirements to draw and make a 3D Instruments ====
 +
 +However, it doesn't call this unless
 +
 +  * the Panel_Fighter.png file is the texture file for the Cockpit Object.
 +  * The Cockpit Object is indicated as **Int Cockpit** in Plane Maker
 +  * There is something (for me, the G5 screen) that is mapped to a texture connected to that Panel_Fighter.png
 +  * The Checkbox "Part Of Cockpit Panel" needs to be checked in Texture -> XPlane -> Cockpit Panel -> Part Of Cockpit Panel. Not sure how the ''Cockpit Region selection'' affects this.
  
  
pc/software/xplane11/garming5/start.1551897859.txt.gz · Last modified: 2019/03/06 18:44 by dwheele