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_IMGUI = 60
}
 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.
 
ZIndex getZ () const
 Query the Z-index of this layer.
 
bool isActive () const
 
Coverage getCoverage () const
 Query the coverage of this layer.
 
void setDisplay (LayerListener &display_)
 Store pointer to Display.
 

Protected Member Functions

 Layer (Coverage coverage_=COVER_NONE, ZIndex z_=Z_DUMMY)
 Construct a layer.
 
void setCoverage (Coverage coverage_)
 Changes the current coverage of this layer.
 
void setZ (ZIndex z)
 Changes the current Z-index of this layer.
 

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_IMGUI 

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 64 of file Layer.hh.

Member Function Documentation

◆ getCoverage()

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

Query the coverage of this layer.

Definition at line 55 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(), and isActive().

◆ isActive()

bool openmsx::Layer::isActive ( ) const
inline

Definition at line 51 of file Layer.hh.

References getZ(), and Z_MSX_ACTIVE.

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

◆ paint()

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

◆ setCoverage()

void openmsx::Layer::setCoverage ( Coverage  coverage_)
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().

◆ setDisplay()

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

Store pointer to Display.

Will be called by Display::addLayer().

Definition at line 60 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().

Friends And Related Symbol Documentation

◆ ScopedLayerHider

friend class ScopedLayerHider
friend

Definition at line 89 of file Layer.hh.


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