ddawson
Resource contributor
- Messages
- 862
- Country
I thought I would extricate us from the other thread...
I think you will find the best example available is the Cabin Comfort module in the SDK. This one is not a gauge, but a module loaded through dll.xml.
The FS gauge structure is so heavily based on macros that for simple gauges, an OOP approach will be of little benefit.
Where it starts to become your friend is when you want to create a gauge that is going to do more than just put bitmaps on the screen. It is certainly an excellent way to organize code you're going to use again. I've created classes to handle SimVars, LVars, sound, GPS interaction, game controllers, reading the FS config files, and SimConnect metar strings. I'm working on one for SimConnect itself.
Doug
Well, there is a pretty straightforward example packaged with the SDK.
After that, I would start with this:
http://library.avsim.net/download.php?DLID=178435
A blunt force search of the Avsim library for the phrase "source code" produces five pages of hits, admittedly not all for FS gauge code.
Bill Leaming posted a bunch of stuff on the flightsim.com forum:
http://www.flightsim.com/vbfs/forumdisplay.php?24-Panel-amp-Gauge-Design
There is help out there.
The source code for my fuel dump gauges is on my website.
Doug
Eventually, I might figure out which examples from your references use OOP techniques and which are more like 'C using classic procedural programming', but I have to start some place.
I think you will find the best example available is the Cabin Comfort module in the SDK. This one is not a gauge, but a module loaded through dll.xml.
The FS gauge structure is so heavily based on macros that for simple gauges, an OOP approach will be of little benefit.
Where it starts to become your friend is when you want to create a gauge that is going to do more than just put bitmaps on the screen. It is certainly an excellent way to organize code you're going to use again. I've created classes to handle SimVars, LVars, sound, GPS interaction, game controllers, reading the FS config files, and SimConnect metar strings. I'm working on one for SimConnect itself.
Doug