• 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.

P3D v4 D2D Multi Threaded Template to GDI+

Messages
43
Country
unitedkingdom
Hello all,

After a couple of days of endless recreations of the template, I’m reaching out so somebody can point me in the right direction

I can add my sources later, but essentially I have added in the GDI mGraphics as an unique_ptr, replaced the binding to the D2D render target with

C++:
mGraphics.reset(new GDIPlus::Graphics(element->hdc));

On the DrawThread I’m just trying to use the Clear function to make the gauge red.

It compiled and loads in sim, but it’s just black from the background bitmap.

I just ran out of time to load it in the debugger with some breakpoints so will report back, when I get home in a couple of hours or so.

Thanks!
 
What is mGraphics.reset??? mGraphics should be a pointer to a Graphics object. Using a . instead of a -> on a pointer doesn't work and the GDI+ Graphics class has no reset function. So... what is mGraphics?
 
I got it working as a gauge by adjusting the EXT WND template, but not as the exe version as the HDC is coming up as unused and the mGraphics object as empty.

For reference it is a std::unique_ptr, exactly as setup in the ESP example.
 
I think at this point... after reading everything you've posted (zero actual code detail, several statements that don't line up with the original code at all)... and the fact that you're apparently totally rewriting code that already works very well (for no apparent reason, nor need)... and bow out. Good luck.
 
Last edited:
I would recommend starting with the MSDN GDI+ example, and just copying over the multithread related code from the D2D multi thread example.

And as WarpD said, you can't do gauges as exes. Dll only. If you want to make an external app, then using the gauge code examples is not the way to go.
 
Related to the exe stuff how can I make like an emulator for gauges


Sent from my iPhone using Tapatalk
 
Start from scratch and figure out how it all works.... no one here is likely to offer up code that can do that.
 
There are a number of online tutorials for Win32 GDI+ setups. If you want to retrieve info from the sim, include the SimConnect library, and a UI to connect to the sim.

That said, you may also wish to play around with D3D/D2D and C# for emulators.
 
Back
Top