A password will be e-mailed to you.

Welcome Guest 

Show/Hide Header

Welcome Guest, posting in this forum requires registration.

Pages: [1]
Author Topic: IGaugeCDrawable?
Naruto-kun
New User
Posts: 16
Send Message
Post IGaugeCDrawable?
on: September 26, 2012, 07:13

Hi
I would like to make a CustomDraw dll for a weather map but I cannot find anything on how to use it. Can someone please explain the flow of things (purpose of IGaugeCDrawableCreateParameters class, and the virt AddRef ()/Release ()/GetFlags ()/Update () /Show (bool on)/Draw (IGaugeCDrawableDrawParameters* pParameters, PIXPOINT size, HDC hdc, PIMAGE pImage)/SetupDraw (PIXPOINT size, HDC hdc, PIMAGE pImage)/GetDraw (IGaugeCDrawableDrawParameters* pParameters) functions) and when/how to use them?

Thanks
JB

Milviz
New User
Posts: 7
Send Message
Post Re: IGaugeCDrawable?
on: September 28, 2012, 08:19

Hi guys... Just to find out whether or not it is your (the P3D team) (or anyone else for that matter) intent to answer this question?...

Jon works for me (Milviz) and we would really like to know how this (and other stuff) works.

I am now the owner of two dev licenses one of which Jon here is using.

Any assistance on this would be welcome.

(yes, this product is for P3D should that be an issue...)

Thanks.

Colin

FSMP
Professional
Posts: 638
Send Message
Post Re: IGaugeCDrawable?
on: September 28, 2012, 10:29

Does this example help any ?

http://code.google.com/p/mcdu-a306/source/browse/trunk/MCDU_A306/inc/gauges.h?r=3

Geoff

bhollis
Lockheed Martin
Posts: 403
Send Message
bhollis
Post Re: IGaugeCDrawable?
on: September 28, 2012, 10:31

I worked with the custom draw good briefly a couple years back when adding SIDs and STARs support to the gps gauge, but only making small tweaks to the existing gps gauges custom draw implementation. That gauge hooked directly into the core rather than using the sdk wrappers, though, so I'm not sure if it even used the same interface provided for external use. Unfortunately, I've got too much on my plate right now to go digging through that system and documenting how to use it. If you need to use CustomDraw, I would suggest doing some searches on the Avsim forums as the interface haven't changed since the FSX/ESP days and some users have successfully implemented it.

You may want to consider drawing your map directly using either GDI+ or D3D9. There is an old MS/ESP example that shows how to draw into a gauge using GDI. We've used this technique as the bases for a few internal projects that pipe in visuals from legacy systems.

http://msdn.microsoft.com/en-us/library/dd262188.aspx

Your other option would be creating a DirectX Gauge (there is an example in the sdk).

In either of those two options, you can use C-variables to push and pull data back and forth between you dll and xml gauges. That way you set up the interface yourself rather than having your hands tied by CustomDraw system. The only caveat I would mention about using d3d9 gauges is that you'll have to eventually update the rendering to d3d11 to support 2.0.

Thanks,
Beau

Prepar3D Software Engineer

Milviz
New User
Posts: 7
Send Message
Post Re: IGaugeCDrawable?
on: September 28, 2012, 13:03

And will version 2. have this documented? I have to ask because at this point, we're not sure where else to look or who to ask...

bhollis
Lockheed Martin
Posts: 403
Send Message
bhollis
Post Re: IGaugeCDrawable?
on: October 1, 2012, 16:57

Any interface changes we make will be documented (such as changes required to update a directx gauge to v2). If we find missing or inaccurate documentation of a system while working on that system, we will likely go ahead and fix the documentation. (eg we realize when looking at the code that a SimVar is read only but the SDK claims it can be set). For subsystems that we aren't actively developing in, the documentation is unlikely to change.

Beau

Prepar3D Software Engineer

Pages: [1]
Mingle Forum by cartpauj
Version: 1.0.31 ; Page loaded in: 0.112 seconds.