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

OpenGL backend implementation of RWLSwapchain. More...

#include <RGLSwapchainWL.h>

+ Inheritance diagram for RGLSwapchainWL:

Public Member Functions

 ~RGLSwapchainWL () noexcept
 Destroys the EGL surface and the wl_egl_window.
 
std::optional< const RSwapchainImageacquire () noexcept override
 Acquires the swapchain image to render the next frame into.
 
bool present (const RSwapchainImage &image, SkRegion *damage=nullptr) noexcept override
 Presents a previously acquired image to the Wayland surface.
 
bool resize (SkISize size) noexcept override
 Resizes the swapchain (and the underlying wl_egl_window).
 
- Public Member Functions inherited from RWLSwapchain
wl_surface * surface () const noexcept
 Returns the Wayland surface this swapchain presents to.
 
- Public Member Functions inherited from RSwapchain
 RSwapchain (SkISize size) noexcept
 Construct a swapchain with the given image size.
 
SkISize size () const noexcept
 The size of swapchain images in pixels.
 
- Public Member Functions inherited from RObject
 RObject ()=default
 Constructs a default RObject.
 

Additional Inherited Members

- Static Public Member Functions inherited from RWLSwapchain
static std::shared_ptr< RWLSwapchainMake (wl_surface *surface, SkISize size) noexcept
 Creates a Wayland swapchain for the given surface.
 

Detailed Description

OpenGL backend implementation of RWLSwapchain.

Presents to a Wayland surface via EGL. It creates a wl_egl_window and an EGLSurface for the given wl_surface, wraps that surface as an RGLImage, and drives presentation with eglSwapBuffers (using eglSwapBuffersWithDamageKHR when damage and the extension are available). Created via RWLSwapchain::Make().

Constructor & Destructor Documentation

◆ ~RGLSwapchainWL()

~RGLSwapchainWL ( )
noexcept

Destroys the EGL surface and the wl_egl_window.

Member Function Documentation

◆ acquire()

std::optional< const RSwapchainImage > acquire ( )
overridevirtualnoexcept

Acquires the swapchain image to render the next frame into.

Returns
The swapchain image (with its buffer age), or std::nullopt if an image is already acquired and not yet presented.

Implements RSwapchain.

◆ present()

bool present ( const RSwapchainImage image,
SkRegion *  damage = nullptr 
)
overridevirtualnoexcept

Presents a previously acquired image to the Wayland surface.

Parameters
imageThe image returned by acquire().
damageOptional damage region (in image coordinates); enables damage-aware swapping when supported, otherwise the whole surface is swapped.
Returns
true on success, false if the image does not match or was not acquired.

Implements RSwapchain.

◆ resize()

bool resize ( SkISize  size)
overridevirtualnoexcept

Resizes the swapchain (and the underlying wl_egl_window).

Parameters
sizeThe new size in pixels. Must be non-empty.
Returns
true on success (including when the size is unchanged), false if the size is invalid.

Implements RSwapchain.