openMSX
|
Interface for display layers. More...
#include <Layer.hh>
Public Types | |
enum | ZIndex { Z_DUMMY = -1 , Z_BACKGROUND = 0 , Z_MSX_PASSIVE = 30 , Z_MSX_ACTIVE = 40 , Z_OSDGUI = 50 , Z_CONSOLE = 100 } |
Determines stacking order of layers: layers with higher Z-indices are closer to the viewer. More... | |
enum | Coverage { COVER_FULL , COVER_PARTIAL , COVER_NONE } |
Describes how much of the screen is currently covered by a particular layer. More... | |
Public Member Functions | |
virtual | ~Layer ()=default |
virtual void | paint (OutputSurface &output)=0 |
Paint this layer. More... | |
ZIndex | getZ () const |
Query the Z-index of this layer. More... | |
bool | isActive () const |
Coverage | getCoverage () const |
Query the coverage of this layer. More... | |
void | setDisplay (LayerListener &display_) |
Store pointer to Display. More... | |
Protected Member Functions | |
Layer (Coverage coverage_=COVER_NONE, ZIndex z_=Z_DUMMY) | |
Construct a layer. More... | |
void | setCoverage (Coverage coverage_) |
Changes the current coverage of this layer. More... | |
void | setZ (ZIndex z) |
Changes the current Z-index of this layer. More... | |
Friends | |
class | ScopedLayerHider |
Describes how much of the screen is currently covered by a particular layer.
Enumerator | |
---|---|
COVER_FULL | Layer fully covers the screen: any underlying layers are invisible. |
COVER_PARTIAL | Layer partially covers the screen: it may cover only part of the screen area, or it may be (semi-)transparent in places. |
COVER_NONE | Layer is not visible, that is completely transparent. |
|
virtualdefault |
|
inlineexplicitprotected |
|
inline |
|
inline |
Query the Z-index of this layer.
Definition at line 50 of file Layer.hh.
Referenced by openmsx::Display::addLayer(), and isActive().
|
inline |
Definition at line 51 of file Layer.hh.
References getZ(), and Z_MSX_ACTIVE.
Referenced by openmsx::Display::findActiveLayer().
|
pure virtual |
Paint this layer.
Implemented in openmsx::SDLOSDGUILayer, openmsx::GLOSDGUILayer, openmsx::DummyRenderer, openmsx::FBPostProcessor< Pixel >, openmsx::GLPostProcessor, openmsx::GLSnow, and openmsx::SDLSnow< Pixel >.
|
inlineprotected |
Changes the current coverage of this layer.
Definition at line 71 of file Layer.hh.
Referenced by openmsx::ScopedLayerHider::ScopedLayerHider(), and openmsx::ScopedLayerHider::~ScopedLayerHider().
|
inline |
Store pointer to Display.
Will be called by Display::addLayer().
Definition at line 60 of file Layer.hh.
Referenced by openmsx::Display::addLayer().
|
protected |
Changes the current Z-index of this layer.
Definition at line 6 of file Layer.cc.
References openmsx::LayerListener::updateZ().
|
friend |