Beatmup
Beatmup::DRM::ModeCrtc Class Reference

#include <drm.hpp>

Public Member Functions

 ModeCrtc ()
 
 ModeCrtc (Device &device, ModeEncoder &encoder, ModeConnector &connector)
 
 ~ModeCrtc ()
 
ModeCrtcoperator= (ModeCrtc &&other)
 

Private Member Functions

 ModeCrtc (const ModeCrtc &)=delete
 

Private Attributes

int device
 
uint32_t connector
 
drmModeCrtc * crtc
 

Detailed Description

Definition at line 161 of file drm.hpp.

Constructor & Destructor Documentation

◆ ModeCrtc() [1/3]

Beatmup::DRM::ModeCrtc::ModeCrtc ( const ModeCrtc )
privatedelete

◆ ModeCrtc() [2/3]

Beatmup::DRM::ModeCrtc::ModeCrtc ( )
inline

Definition at line 168 of file drm.hpp.

168 : crtc(nullptr) {}
drmModeCrtc * crtc
Definition: drm.hpp:166

◆ ModeCrtc() [3/3]

Beatmup::DRM::ModeCrtc::ModeCrtc ( Device device,
ModeEncoder encoder,
ModeConnector connector 
)
inline

Definition at line 170 of file drm.hpp.

170  :
171  device(device.getHandle()),
172  connector(connector.getPointer()->connector_id),
173  crtc(drmModeGetCrtc(this->device, encoder.getPointer()->crtc_id))
174  {
175  if (!crtc)
176  throw DRMError("Cannot get DRM crtc");
177  }
uint32_t connector
Definition: drm.hpp:165

◆ ~ModeCrtc()

Beatmup::DRM::ModeCrtc::~ModeCrtc ( )
inline

Definition at line 179 of file drm.hpp.

179  {
180  if (crtc) {
181  drmModeSetCrtc(device, crtc->crtc_id, crtc->buffer_id, crtc->x, crtc->y, &connector, 1, &crtc->mode);
182  drmModeFreeCrtc(crtc);
183  }
184  }

Member Function Documentation

◆ operator=()

ModeCrtc& Beatmup::DRM::ModeCrtc::operator= ( ModeCrtc &&  other)
inline

Definition at line 186 of file drm.hpp.

186  {
187  device = other.device;
188  connector = other.connector;
189  crtc = other.crtc;
190  other.crtc = nullptr;
191  return *this;
192  }

Member Data Documentation

◆ device

int Beatmup::DRM::ModeCrtc::device
private

Definition at line 164 of file drm.hpp.

◆ connector

uint32_t Beatmup::DRM::ModeCrtc::connector
private

Definition at line 165 of file drm.hpp.

◆ crtc

drmModeCrtc* Beatmup::DRM::ModeCrtc::crtc
private

Definition at line 166 of file drm.hpp.


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