• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

P3D v2 C++ complex gauge multi screen

#1
first of all i'm beginners modeler, programmer.
i build gauge C++ from Dai Griffiths gauge tutorials,
use example from dai, SDK, and some examples or advice can I use from this thread ( i find and read till page 29- sorry not to read all thread) to build my gauge. till now working good

i need help for make multi-screen gauge ( each screen have complex gauge tree)!
how to change 1 screen to another screen, 1 screen active another screen hiding.

in XML i just use <visibility> in the top of tree and sub tree below it will be follow.

how about in C++?
i have 4 screen in 1 gauge, PFD, NAV, FUEL, EICAS

:pushpin:i can use ( have not tried yet)
from bill, using the twin macros from gauges.h, SHOW_IMAGE and HIDE_IMAGE

if ( HSIpower == 1 ) { SHOW_IMAGE(pelement) ; } else { HIDE_IMAGE(pelement) ; }
sprintf(pelement->string,"HDG %03.0f",rwert);

if i use complex macros, this will be much should i do (each element)
simple way is great ( sometimes simple not easy) :scratchch

thanks.
 
#3
some people suggest to use GDI+/D2D, why i not using that? because there no tutorial and example available ( i'm still beginner, need guidance ).
in C++, i still trying to figure out.
GDI+/D2D seems quite promising, some tutorial will be great to start.

this my project gauges i was working on. 1 screen done, another screen waiting.
 

Attachments

JB3DG

Resource contributor
#4
You got Skype? It takes a little more than a tutorial....I would be happy to walk you through the basics.
 
#5
I'm afraid can not use skype, my bandwidth very limited.

but it is an interesting offer, possibly with a step by step video tutorial is pretty good.
so I can repeat again and again if the project is carried out there is a problem.
 

JB3DG

Resource contributor
#6
You should be able to. No need to do actual voice calls. Use the Skype text chat. My bandwidth is also low but I can manage.
 
#7
I would strongly recommend you attempt the direct2d tutorials before attempting a full scale gauge.

This is coming from someone who used D2D for a complex gauge.
 

JB3DG

Resource contributor
#9
I was actually thinking start with GDI+ as it is easier to understand and you can use it in that example I posted. Do get hold of Skype though. There is nothing like personal one on one real time help.
 
#11
wow,this very good offer.
I'm not holding back, I just need a clear path, where I will be heading

but,the first thing I'm going to find out about the GDI+ / D2D! or you can explain (short explain) why using GDI+ rather than C++.
in C++ i'm still in the dark, moreover GDI+/D2D.

Using C++ in my gauge (MV-22B/ CV-22B) there many features, Camera view, map, IR radar. from your experience whether it would be easier to using GDI+.
I put all the gauge is in VC.
i start building from simple one, just only one, then slowly increasing to the complex one (Bill Leaming advice).
could you please give a sample, short sample and simple, just need *.h, *.cpp

from your template, there many file to "include" for creating just simple one( maybe just "make static"), and just for check its working or not.
or this GDI+ just like C++, i dont know ........

some searching on web, so with this GDI no need image ( make fps drop). so where i start drawing. X, Y, Z.
 
Last edited:

JB3DG

Resource contributor
#12
Ok first of all, GDI+ is just a graphics library that was built using C++.
Second, GDI+ allows far more freedom in what you can draw using vectors (lines, rectangles, polygons, ellipses, and other primitive shapes) and in many ways makes things easier (fewer lines of code thanks to using loops and such) than the purely bitmap based approach of the fsx gauge macros.

There is only 1 MAKE_STATIC macro used for each gauge and it covers the whole surface of the gauge. It provides the surface which GDI+ can be used to procedurally draw on.

The template I sent doesn't have any rendering code in it (its just a blank template) but it does show how to set up a separate thread for your rendering which will effectively eliminate fps drop. Get Skype and we can walk you through the steps.
 
#15
correct, done. so where to start

naruto-kun there so many name on skype.
cheangjc just only one, hope it correct person
 
Last edited:
#17
SLOW BUT SURE
thanks to Naruto-kun
many modification has been done. this GDI+ better graphics than native C ++ ( from FSX SDK tutorials). The hard one is there no much tutorials and sample creating gauge in GDI+ available on the net, so always ask to Naruto-Kun.

Left gauge is GDI+
Right gauge still using native C++


edit : added attachment file
 

Attachments

Last edited:
#20
80 % for PFD all rewrite to GDI+
map using modified b737 gauge

see the different smooth graphics



from my earlier issue i had solved that problem and i had 5 working menu on my gauge, with GDI+ output size also smaller than i build gauge for the first time using C++.
 
Last edited: