4 #ifndef SWIFT_SIM_XSWIFTBUS_DRAWABLE_H
5 #define SWIFT_SIM_XSWIFTBUS_DRAWABLE_H
9 #include <XPLMDisplay.h>
21 CDrawable(XPLMDrawingPhase phase,
bool before) : m_phase(phase), m_before(before) {}
32 if (m_visible) {
return; }
34 XPLMRegisterDrawCallback(callback, m_phase, m_before,
static_cast<void *
>(
this));
40 if (!m_visible) {
return; }
42 XPLMUnregisterDrawCallback(callback, m_phase, m_before,
static_cast<void *
>(
this));
50 static int callback(XPLMDrawingPhase,
int,
void *refcon)
56 XPLMDrawingPhase m_phase;
57 bool m_before =
false;
58 bool m_visible =
false;
Class-based interface to X-Plane's drawing callback API.
void show()
Register the draw callback.
virtual ~CDrawable()
Destructor.
virtual void draw()=0
Callback to draw the thing.
void hide()
Unregister the draw callback.
CDrawable(XPLMDrawingPhase phase, bool before)
Constructor.
bool isVisible() const
Is currently shown.
Plugin loaded by X-Plane which publishes a DBus service.