Ream v0.1.0-1
C++ graphics library for Linux
Loading...
Searching...
No Matches
Public Member Functions | List of all members
RGLDevice Class Reference

OpenGL backend implementation of RDevice. More...

#include <RGLDevice.h>

+ Inheritance diagram for RGLDevice:

Public Member Functions

RGLCorecore () noexcept
 Returns the owning core as an RGLCore.
 
EGLDisplay eglDisplay () const noexcept
 Returns the EGL display associated with this device.
 
EGLContext eglContext () const noexcept
 Returns the EGL context for the calling thread.
 
EGLDeviceEXT eglDevice () const noexcept
 Returns the EGLDeviceEXT backing this device, if any.
 
sk_sp< GrDirectContext > skContext () const noexcept
 Returns the Skia GrDirectContext for the calling thread.
 
const REGLDisplayProcseglDisplayProcs () const noexcept
 Returns the display-level EGL function pointers for this device.
 
const REGLDisplayExtensionseglDisplayExtensions () const noexcept
 Returns the display-level EGL extensions supported by this device.
 
const REGLDeviceExtensionseglDeviceExtensions () const noexcept
 Returns the device-level EGL extensions supported by this device.
 
const RGLExtensionsglExtensions () const noexcept
 Returns the OpenGL ES extensions supported by this device's context.
 
void wait () noexcept override
 Blocks until all GL commands submitted on this device's context have completed.
 
- Public Member Functions inherited from RDevice
 ~RDevice () noexcept
 Destructor.
 
int drmFd () const noexcept
 Returns the primary DRM file descriptor.
 
int drmFdReadOnly () const noexcept
 Returns the read-only DRM file descriptor.
 
void * drmUserData () const noexcept
 Returns the user data associated with the DRM device.
 
dev_t id () const noexcept
 Returns the device id (dev_t) of the DRM node.
 
const std::string & drmNode () const noexcept
 Returns the path of the DRM node.
 
const std::string & drmDriverName () const noexcept
 Returns the DRM driver name.
 
RDriver drmDriver () const noexcept
 Returns the detected DRM driver.
 
RCorecore () const noexcept
 Returns the RCore instance that owns this device.
 
RGLDeviceasGL () noexcept
 Attempts to cast this device to an RGLDevice.
 
RRSDeviceasRS () noexcept
 Attempts to cast this device to an RRSDevice.
 
RVKDeviceasVK () noexcept
 Attempts to cast this device to an RVKDevice.
 
const Capscaps () const noexcept
 Returns the capabilities of this device.
 
- Public Member Functions inherited from RObject
 RObject ()=default
 Constructs a default RObject.
 

Additional Inherited Members

- Public Attributes inherited from RDevice
CZLogger log { RLog }
 Logger for messages related to this device.
 

Detailed Description

OpenGL backend implementation of RDevice.

Represents a single GPU driven through EGL and OpenGL ES. It owns the device's EGL display, the main-thread EGL context and Skia GrDirectContext, and the associated EGL/GL extension tables. Because contexts are per-thread, eglContext() and skContext() return the objects bound to the calling thread (lazily created as shared contexts on non-main threads).

Obtain it from an RDevice via RDevice::asGL().

Member Function Documentation

◆ core()

RGLCore & core ( )
inlinenoexcept

Returns the owning core as an RGLCore.

◆ eglDisplay()

EGLDisplay eglDisplay ( ) const
inlinenoexcept

Returns the EGL display associated with this device.

◆ eglContext()

EGLContext eglContext ( ) const
noexcept

Returns the EGL context for the calling thread.

On the main thread this is the device's primary context; on other threads a shared context is created on first use. Returns EGL_NO_CONTEXT if none could be obtained.

◆ eglDevice()

EGLDeviceEXT eglDevice ( ) const
inlinenoexcept

Returns the EGLDeviceEXT backing this device, if any.

◆ skContext()

sk_sp< GrDirectContext > skContext ( ) const
noexcept

Returns the Skia GrDirectContext for the calling thread.

Like eglContext(), this is per-thread: the main-thread context on the main thread, or a thread-local context created alongside the shared EGL context otherwise.

◆ eglDisplayProcs()

const REGLDisplayProcs & eglDisplayProcs ( ) const
inlinenoexcept

Returns the display-level EGL function pointers for this device.

◆ eglDisplayExtensions()

const REGLDisplayExtensions & eglDisplayExtensions ( ) const
inlinenoexcept

Returns the display-level EGL extensions supported by this device.

◆ eglDeviceExtensions()

const REGLDeviceExtensions & eglDeviceExtensions ( ) const
inlinenoexcept

Returns the device-level EGL extensions supported by this device.

◆ glExtensions()

const RGLExtensions & glExtensions ( ) const
inlinenoexcept

Returns the OpenGL ES extensions supported by this device's context.

◆ wait()

void wait ( )
overridevirtualnoexcept

Blocks until all GL commands submitted on this device's context have completed.

Makes the device's context current and issues a glFinish().

Implements RDevice.