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 class  ZIndex {
  BACKGROUND , MSX_PASSIVE , MSX_ACTIVE , OSDGUI ,
  IMGUI
}
 Determines stacking order of layers: layers with higher Z-indices are closer to the viewer. More...
 
enum class  Coverage { FULL , PARTIAL , 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 (Display &display_)
 Store pointer to Display.
 

Protected Member Functions

 Layer (Coverage coverage_, ZIndex z_)
 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
 
auto operator<=> (ZIndex x, ZIndex y)
 

Detailed Description

Interface for display layers.

Definition at line 13 of file Layer.hh.

Member Enumeration Documentation

◆ Coverage

enum class openmsx::Layer::Coverage
strong

Describes how much of the screen is currently covered by a particular layer.

Enumerator
FULL 

Layer fully covers the screen: any underlying layers are invisible.

PARTIAL 

Layer partially covers the screen: it may cover only part of the screen area, or it may be (semi-)transparent in places.

NONE 

Layer is not visible, that is completely transparent.

Definition at line 31 of file Layer.hh.

◆ ZIndex

enum class openmsx::Layer::ZIndex
strong

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

Enumerator
BACKGROUND 
MSX_PASSIVE 
MSX_ACTIVE 
OSDGUI 
IMGUI 

Definition at line 19 of file Layer.hh.

Constructor & Destructor Documentation

◆ ~Layer()

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

◆ Layer()

openmsx::Layer::Layer ( Coverage  coverage_,
ZIndex  z_ 
)
inlineexplicitprotected

Construct a layer.

Definition at line 66 of file Layer.hh.

Member Function Documentation

◆ getCoverage()

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

Query the coverage of this layer.

Definition at line 57 of file Layer.hh.

◆ getZ()

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

Query the Z-index of this layer.

Definition at line 52 of file Layer.hh.

Referenced by openmsx::Display::addLayer(), isActive(), and openmsx::Display::updateZ().

◆ isActive()

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

Definition at line 53 of file Layer.hh.

References getZ(), and 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 73 of file Layer.hh.

Referenced by openmsx::ScopedLayerHider::ScopedLayerHider(), and openmsx::ScopedLayerHider::~ScopedLayerHider().

◆ setDisplay()

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

Store pointer to Display.

Will be called by Display::addLayer().

Definition at line 62 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 7 of file Layer.cc.

References openmsx::Display::updateZ().

Friends And Related Symbol Documentation

◆ operator<=>

auto operator<=> ( ZIndex  x,
ZIndex  y 
)
friend

Definition at line 26 of file Layer.hh.

◆ ScopedLayerHider

friend class ScopedLayerHider
friend

Definition at line 91 of file Layer.hh.


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