Beatmup
Beatmup::DRM::GBMSurface Class Reference

#include <drm.hpp>

Public Member Functions

 GBMSurface ()
 
 GBMSurface (GBMDevice &gbmDevice, const ModeConnector &connector)
 
 ~GBMSurface ()
 
GBMSurfaceoperator= (GBMSurface &&other)
 
struct gbm_surface * getPointer ()
 

Static Public Attributes

static const int FORMAT = GBM_FORMAT_XRGB8888
 

Private Member Functions

 GBMSurface (const GBMSurface &)=delete
 

Private Attributes

struct gbm_surface * surface
 

Detailed Description

Definition at line 226 of file drm.hpp.

Constructor & Destructor Documentation

◆ GBMSurface() [1/3]

Beatmup::DRM::GBMSurface::GBMSurface ( const GBMSurface )
privatedelete

◆ GBMSurface() [2/3]

Beatmup::DRM::GBMSurface::GBMSurface ( )
inline

Definition at line 233 of file drm.hpp.

233 : surface(nullptr) {}
struct gbm_surface * surface
Definition: drm.hpp:229

◆ GBMSurface() [3/3]

Beatmup::DRM::GBMSurface::GBMSurface ( GBMDevice gbmDevice,
const ModeConnector connector 
)
inline

Definition at line 235 of file drm.hpp.

235  : surface(nullptr) {
236  const auto& mode = connector.getMode(0);
237 
238  surface = gbm_surface_create(
239  gbmDevice.getPointer(),
240  mode.hdisplay,
241  mode.vdisplay,
242  FORMAT,
243  GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING
244  );
245  if (!surface)
246  throw DRMError("Cannot create GBM surface");
247  }
static const int FORMAT
Definition: drm.hpp:231
JNIEnv jlong jint mode

◆ ~GBMSurface()

Beatmup::DRM::GBMSurface::~GBMSurface ( )
inline

Definition at line 249 of file drm.hpp.

249  {
250  if (surface)
251  gbm_surface_destroy(surface);
252  }

Member Function Documentation

◆ operator=()

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

Definition at line 254 of file drm.hpp.

254  {
255  surface = other.surface;
256  other.surface = nullptr;
257  return *this;
258  }

◆ getPointer()

struct gbm_surface* Beatmup::DRM::GBMSurface::getPointer ( )
inline

Definition at line 260 of file drm.hpp.

260  {
261  return surface;
262  }

Member Data Documentation

◆ surface

struct gbm_surface* Beatmup::DRM::GBMSurface::surface
private

Definition at line 229 of file drm.hpp.

◆ FORMAT

const int Beatmup::DRM::GBMSurface::FORMAT = GBM_FORMAT_XRGB8888
static

Definition at line 231 of file drm.hpp.


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