• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

FSX C gauges ¡very confused!

Messages
85
Country
spain
hey Palacio802

I am very much in the same boat as you, I have experience in c++ plus i prefer C++ to XML its a personal choice :). you can use visual studio 2015 Community edition with out much issues. I myself am using VS2012 express whilst i learn the fundamentals of c++ gauge development and will move on to 2015 when I am ready to port my model over to 64bit. with regards to Kalong the setup is much the same but i will give it a whack to see if i can help.

first off load your IDE, ill do it with 2015 to make things easier. Start off by clicking new project and click the drop down for visual C++ (I am assuming 32bit for now) and select WIN32, This will allow you to select WIN32 console application.
http://prntscr.com/gk6wpg

Give your project a name and click ok. This will start the wizard for you, click next to go to the next page/window. Here you want to select DLL and empty project (see screenshot)
http://prntscr.com/gk6xti

After that click finish and you have a empty project ready to go.
http://prntscr.com/gk6yeb

Now we still have some set up to do. Again I am not sure on the set up for 64bit so this is all still 32bit.

Right click on the folder 'source' to add your first .cpp file this will be your main .cpp file that will include your #include header files as well as including the other .cpp files you will have. Once this file is generated you right click your project again to go to the properties.
http://prntscr.com/gk729k

you will be created by the properties window
http://prntscr.com/gk72ns

From here you will follow the link that Kalong gave you, they will be the same.

the next bit which is excluding files from your build is actually the bit I am about to mess around with now to do a test compile of my own c++ gauge, When I am successful i will post below to let you know exactly what has to be done.

if you want to as any questions just PM me ill be avaible for the next four hours then my 8month daughter will be home from her visit from grannies lol

regards

Daniel

Thank you very much, Daniel. I'll try to follow your instructions. Personally I prefer XML but I think C++ is more powerful and flexible. I can't imagine why P3D don't implement string variable capability. It would be great if we could write:
'LEZL' (>S:Scratchpad) or if we had the posibility to read/write files without the use of third party modules...
 
Last edited:
Messages
2,077
Country
us-ohio
Strings (aka data buffer) are the #1 method of finding a way to crash into the secure side of a server/OS. Of course XML for the sim was designed to eliminate the ability to get around the OS security.
 
Messages
1,564
Country
thailand
My screens are writen in XML and they are ok but text with transparent background looks "blurry"...
Sounds like an anti-aliasing problem. Is the problem similar to the issue shown in this thread ? Pls read reply #13 and #14.

Including an appropriate background color or use of a raster font (ms sans serif, leros or yamaha*) should mitigate the problem.

Bob

* leros and yamaha are monospace raster, or bitmap, fonts that I found on the web.
 

n4gix

Resource contributor
Messages
11,674
Country
unitedstates
What puzzles me is that having some knowledge about FSX and programming, I can't understand exactly how to build a sample gauge in the SDK. Yeah, I get the general
idea. But I only get error messages when I try to compile the gauge. There's a gap between xml programming (here you have a lot of tutorials) and c++ programming
(with a total lack of updated and clear information). I hope that with your help I can
cover that gap.

BTW: what method do you think is better to obtain sharp graphics (to simulate a PFD, for instance)? My screens are writen in XML and they are ok but text with
transparent background looks "blurry"...

Regards (and sorry for my poor English...).
Your English is just fine my friend. Actually it is better than that of a lot of folks who's native language is English! :rotfl:

My formal education in programming is very dated, and even so involved COBOL, SNOBOL, Fortran IV, and RPG (yes, I know it's not technically a "language"). My major focus however was in "Systems Analysis and Design" which doesn't really help much with C++/GDI+ programming!

Many years ago Marcel and his brother released a payware program they named EasyGauge. My dirty little secret is that I used that expensive ($350 IIRC) program to gain a solid foundation in how FS gauges are constructed. I hinted at this in my ancient tutorial but didn't make a big deal out of it. Sadly, that program was abandoned, along with the ability to even install it on any other computers. I still have a really antique P4 computer with EasyGauge installed and can at least use it to whip out sub-gauge code rather quickly and copy/paste to my current development computer for massaging and compiling!

As for crisp and nice looking "glass gauges" I use GDI+, but I'm sure that Jon will insist that I'm behind the times and should use D3D instead. Since I've mostly taken up modeling now and don't do much (if any) gauge coding, I'm not all that interested in devoting the time I'd need to become proficient. Well, that and turning sixty-nine next January, I really don't anticipate having time... :oops:

EDIT: Just for giggles, I performed some "googlefu" and found this archived link to the EasyGauge website. The "Demo" version is still available for download/installation, but it is rather useless since the "Demo" version will not save the "raw" C files for examination.
http://web.archive.org/web/20071220234814/www.easygauge.net/main.htm
 
Last edited:
Messages
26
Country
unitedkingdom
'And it contains some errors (a few days ago, flying the mission "baltic sea rescue" I couldn't find Barth NDB...)'

It might not be an error. The Navaids update is "real world", so if a Navaid is no longer active in RW it is removed by the update.
 
Messages
85
Country
spain
'And it contains some errors (a few days ago, flying the mission "baltic sea rescue" I couldn't find Barth NDB...)'

It might not be an error. The Navaids update is "real world", so if a Navaid is no longer active in RW it is removed by the update.


Yes, in this case you are right. I have checked it with Navigraph data and it seems that BTH NDB in Germany is not operative. But in the area I'm used to fly (Spain)
I have updated charts and I have detected many errors. Believe me. :) Next time I go to Baltic Sea I will create a user waypoint with Barth NDB coordinates...
 
Messages
85
Country
spain
Sounds like an anti-aliasing problem. Is the problem similar to the issue shown in this thread ? Pls read reply #13 and #14.

Including an appropriate background color or use of a raster font (ms sans serif, leros or yamaha*) should mitigate the problem.

Bob

* leros and yamaha are monospace raster, or bitmap, fonts that I found on the web.

Yes, it's the same problem. This is a screen capture of the pfd and mfd. I made needles and CDI in the pfd with vectors, and they look fine. The heading bug
is also a polygon. This is useful because the color of these elements change depending if the nav source is just selected (blue) or the ap mode is engaged (magenta).
It was tricky to do the discontinuous CDI needle in a single element using a line width of 0. It draws clean. So I draw with vectors every element I can. But I
can't say the same about gauge text. Many times the background color is given (you can't change it) and I don't like the result (FMS in the MFD is almost illegible
while HDG is right because of the blue color of the sea).

screens.jpg
 
Last edited:
Messages
85
Country
spain
Well, after HOURS of trials and errors I have managed to build some gauges from SDK with visual studio 2015. I used P3Dv3 SDK, I don't know if this
helped. The SDK sample is a multi-gauge and I have been able to "trim" it to a single gauge (first attitude and after that temperature indicator). Now I
can say I have a working template to start my adventure with C++.

One question: what is the difference between .gau and .dll gauges? What I'm creating (at first by mistake) is .dll gauges and they seem to work well.
 

ddawson

Resource contributor
Messages
862
Country
canada
...
One question: what is the difference between .gau and .dll gauges? What I'm creating (at first by mistake) is .dll gauges and they seem to work well.

Compiled gauges are windows dll's. Always have been. In FSX, the capability of loading files named with the dll extension was added.
I follow the convention of naming anything that is expected to work in FS9 or earlier with the gau extension, while anything that will only work in FSX or later I name with the dll extension.

Doug
 

JB3DG

Resource contributor
Messages
1,325
Country
southafrica
As for crisp and nice looking "glass gauges" I use GDI+, but I'm sure that Jon will insist that I'm behind the times and should use D3D instead.

Not quite accurate :).

GDI+ isn't as performance killing as I thought, especially when the gauge is properly threaded. I use a bit of a hybrid depending on the need. GDI+ for all vector graphics and D3D for raster and things like map displays.
 
Messages
85
Country
spain
Hi guys. I keep trying and trying. I'm able to compile the SDK sample with VS2015 and I can make some changes. But
if I try to start a new gauge following the step-by-step guide of Bill I get dozens of errors. I have even copied the text
of Bill's files, so I think the code is right. The errors are almost all crazy sintax errors, such as NULL identifier not
declared (from a make static). It is like if the compiler couldn't read the gauges.h file, but I have checked the include
and it is there. I have tried even with the full path, but nothing changes.

What can I be missiong?? :banghead:
 

ddawson

Resource contributor
Messages
862
Country
canada
If you're getting dozens of errors, it's because you are including the individual sub-gauge cpp files in the build. They should be excluded from the build (right click on the file in Solution Explorer, select Properties)
Each of these files is #included in the main cpp file for the project.
 
Messages
85
Country
spain
Thankyou, I had already done it, as this is one step in Bill's tutorial. But I have realised that the method of Bill
doesn't work in my project (perhpas VS2105?) so I have used the "exclude from the project" command. The
sub-gauge cpp is not anymore in the listing window. This has solved most of the problems. With only two
errors I could spot a missing comma and voila. It compiles. Now I can say I have created my first C++
gauge. Just a background image but this is only the beginning.

Thank you very much for your time.
 
Messages
70
Country
unitedkingdom
Congrats palacio802 I myself have successfully created my first gauge last night with the help of ddawson. No the task of writing more begins to get a complete working panel :)

Sent from my SM-G955F using Tapatalk
 

ddawson

Resource contributor
Messages
862
Country
canada
I will check those samples.
And now, a silly question: can the gauges be compiled with other IDEs such as DevC++? Why not?

They can be, yes. I'm going to go out on a limb here and suggest that the consensus is that it just isn't worth the effort to use another IDE.
The header file gauges.h invokes windows.h and compiled gauges will be dependent on the Windows OS dll's kernel32.dll and user32.dll.
You have to set up Dev C++ to support this. I'm sure in today's day and age that there is a tutorial out there somewhere that explains how to do so, but really, why bother if VS will do it out of box?
 
Messages
85
Country
spain
Just guessing. These unswers and questions help me to get the full picture. I'm more used to Dev C++. And I do not like
visual studio because it's windows philosophy. Just imagine. I wanted the compiler warnings in English to transcribe them
here. So I went to international settings, get language set. I clicked 'English' and ok. One hour after that, the download
and installation proccesses ended. "Installation success BUT you have to restart the system". Ok, I restarted. Another
hour (I guess it downloaded zillions of updates as well, and you know, why not installing all that stuff without user
permission. Perhaps he/she is in a rush. In a presentation in front of 1000 people. But, who cares!).

Three days after that I have repeated the proccess several times BUT still I do not have the English warnings. Still in
Spanish. All I got is a strange behaviour in my keyboard. Windows people seem to convert simple things into very
complicated issues.
 
Messages
70
Country
unitedkingdom
I could be wrong but I have read elsewhere on the internet that windows 10 uses your OS language as default for program language . In theory changing a programs settings to use English should do the trick but does not always do so with out changing your OS to use English as well.
 
Messages
85
Country
spain
Sorry for the silly question but... what is the best way to declare a string variable in c++ gauges in order
to change its content, concatenate it with others, get its length, etc...??
 
Top