SDK Question intercepting the default hud mode

fred18

Addon Developer
Addon Developer
Donator
Joined
Feb 2, 2012
Messages
1,667
Reaction score
115
Points
78
Hi all,

is there any way to "intercept" the default hud mode drawing and draw a custom one?

hud mode identifiers are only hud_none, hud_surface, hud_docking and hud_orbit, there is no "hud_user" or something. If I choose hud_non I can't draw on that, and if I choose one of the standard I get the standard together with what I want to draw on the hud. Is there a way to avoid the standard hud to be drawn?

Thanks in advance

Fred:tiphat:
 
Yes indeed - Enjo's HUDDrawer SDK 0.4 for Orbiter 2010 or HUDDrawer SDK 0.4 for Orbiter 2016. Sample usage in LaunchMFD or RV Orientation, if you want to see worked examples.
 
is there any way to "intercept" the default hud mode drawing and draw a custom one?

hud mode identifiers are only hud_none, hud_surface, hud_docking and hud_orbit, there is no "hud_user" or something. If I choose hud_non I can't draw on that, and if I choose one of the standard I get the standard together with what I want to draw on the hud. Is there a way to avoid the standard hud to be drawn?

The vessel itself can do this with overwriting clbkDrawHUD and clbkRenderHUD, as per Martin's note in the APIReference document, p. 576:
This function is only called in glass cockpit or 2-D panel mode, not in VC (virtual cockpit mode). In glass cockpit or 2-D panel mode, the programmer has a choice of using clbkRenderHUD or clbkDrawHUD to display vessel-specific HUD elements. The use of clbkRenderHUD is preferred, because it provides smoother animation, better performance and is better supported by external render engines. To disable all default HUD display, a derived vessel class should overload both clbkRenderHUD and clbkDrawHUD.
To render custom HUD elements, the oapiRenderHUD function should be called from within this callback function.

From outside of the vessel, though, you have to use vtable hacks, like what I think Enjo's lib is resembling.

Do you need it for Multistage2015? If so, I guess you are inside the vessel code, so it should suffice to use the API.
 
Thanks guys!

The vessel itself can do this with overwriting clbkDrawHUD and clbkRenderHUD, as per Martin's note in the APIReference document, p. 576:


From outside of the vessel, though, you have to use vtable hacks, like what I think Enjo's lib is resembling.

Do you need it for Multistage2015? If so, I guess you are inside the vessel code, so it should suffice to use the API.

That did exactly the trick, I couldn't find at the first run on the oapis, sorry.

Thanks!!! :tiphat:
 
Back
Top