User Tools

Site Tools


Sidebar

Dan's Wiki

DokuWiki Instructions (local) DokuWiki Manual
Site Checker (Orphans Wanted)

Edit Sidebar

pc:software:xplane11:garming5:start

Garmin G5 Emulation, for X-Plane 11 Simulator

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:

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.

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.txt · Last modified: 2019/03/07 02:41 by dwheele