openMSX
Public Types | Public Member Functions | Protected Member Functions | Friends | List of all members
openmsx::Layer Class Referenceabstract

Interface for display layers. More...

#include <Layer.hh>

Inheritance diagram for openmsx::Layer:
Inheritance graph
[legend]

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...
 
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
 

Detailed Description

Interface for display layers.

Definition at line 11 of file Layer.hh.

Member Enumeration Documentation

◆ Coverage

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.

Definition at line 29 of file Layer.hh.

◆ ZIndex

Determines stacking order of layers: layers with higher Z-indices are closer to the viewer.

Enumerator
Z_DUMMY 
Z_BACKGROUND 
Z_MSX_PASSIVE 
Z_MSX_ACTIVE 
Z_OSDGUI 
Z_CONSOLE 

Definition at line 17 of file Layer.hh.

Constructor & Destructor Documentation

◆ ~Layer()

virtual openmsx::Layer::~Layer ( )
virtualdefault

◆ Layer()

openmsx::Layer::Layer ( Coverage  coverage_ = COVER_NONE,
ZIndex  z_ = Z_DUMMY 
)
inlineexplicitprotected

Construct a layer.

Definition at line 63 of file Layer.hh.

Member Function Documentation

◆ getCoverage()

Coverage openmsx::Layer::getCoverage ( ) const
inline

Query the coverage of this layer.

Definition at line 54 of file Layer.hh.

◆ getZ()

ZIndex openmsx::Layer::getZ ( ) const
inline

Query the Z-index of this layer.

Definition at line 50 of file Layer.hh.

Referenced by openmsx::Display::addLayer().

◆ paint()

virtual void openmsx::Layer::paint ( OutputSurface output)
pure virtual

◆ setCoverage()

void openmsx::Layer::setCoverage ( Coverage  coverage_)
inlineprotected

◆ setDisplay()

void openmsx::Layer::setDisplay ( LayerListener display_)
inline

Store pointer to Display.

Will be called by Display::addLayer().

Definition at line 59 of file Layer.hh.

Referenced by openmsx::Display::addLayer().

◆ setZ()

void openmsx::Layer::setZ ( ZIndex  z)
protected

Changes the current Z-index of this layer.

Definition at line 6 of file Layer.cc.

References openmsx::LayerListener::updateZ().

Referenced by setCoverage(), and openmsx::VideoLayer::update().

Friends And Related Function Documentation

◆ ScopedLayerHider

friend class ScopedLayerHider
friend

Definition at line 88 of file Layer.hh.


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