All Classes Functions
Public Member Functions | List of all members
EnjoLib::IDrawsHUD Class Reference

Interface for a class that is supposed to draw on HUD. More...

#include <IDrawsHUD.hpp>

Public Member Functions

 IDrawsHUD ()
 Ctor.
virtual ~IDrawsHUD ()
 Dtor.
virtual bool ShouldDrawHUD () const =0
 Should the MFD draw on HUD now?
virtual void DrawHUD (int mode, const HUDPAINTSPEC *hps, oapi::Sketchpad *skp)=0
 Provides drawing context for the MFD.
virtual void DrawHUD (int mode, const HUDPAINTSPEC *hps, HDC hDC)
 Only for backward compatibility (Orbiter 2006), therefore may be left unimplemented.
virtual const char * GetModuleName () const =0
 Should return unique module's name.

Detailed Description

Interface for a class that is supposed to draw on HUD.

Make this a base class of your module or MFD to receive the HUD drawing context. For example:

#include <Orbitersdk.h>
#include <EnjoLib/IDrawsHUD.hpp>
class MyMFD : public MFD2, public EnjoLib::IDrawsHUD
{
public:
// ...
// your MFD definition
// ...
// EnjoLib::IDrawsHUD methods:
void DrawHUD(int mode, const HUDPAINTSPEC *hps, oapi::Sketchpad * skp);
bool ShouldDrawHUD() const;
const char * GetModuleName() const;
protected:
private:
};

Take note, that the child class doesn't neccessarily need to be an MFD.

Member Function Documentation

virtual void EnjoLib::IDrawsHUD::DrawHUD ( int  mode,
const HUDPAINTSPEC *  hps,
HDC  hDC 
)
inlinevirtual

Only for backward compatibility (Orbiter 2006), therefore may be left unimplemented.

If you need to provide backward compatibility, the code executed by this method should be equal to the second drawing method.

virtual const char* EnjoLib::IDrawsHUD::GetModuleName ( ) const
pure virtual

Should return unique module's name.

It's required so that the module can be disabled globally with HUDDrawer MFD.

virtual bool EnjoLib::IDrawsHUD::ShouldDrawHUD ( ) const
pure virtual

Should the MFD draw on HUD now?

Could return false, for example when the user switched drawing on HUD through an MFD button.


The documentation for this class was generated from the following files: