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

Abstract swapchain that presents to a Wayland client surface. More...

#include <RWLSwapchain.h>

+ Inheritance diagram for RWLSwapchain:

Public Member Functions

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.
 
virtual std::optional< const RSwapchainImageacquire () noexcept=0
 Acquire the next available swapchain image.
 
virtual bool present (const RSwapchainImage &image, SkRegion *damage=nullptr) noexcept=0
 Present a previously acquired image to the display.
 
virtual bool resize (SkISize size) noexcept=0
 Request a resize of future swapchain images.
 
- Public Member Functions inherited from RObject
 RObject ()=default
 Constructs a default RObject.
 

Static Public Member Functions

static std::shared_ptr< RWLSwapchainMake (wl_surface *surface, SkISize size) noexcept
 Creates a Wayland swapchain for the given surface.
 

Detailed Description

Abstract swapchain that presents to a Wayland client surface.

RWLSwapchain specializes RSwapchain for the Wayland platform, associating the swapchain with a client wl_surface to which acquired images are presented. The concrete implementation is chosen by the active graphics API (Raster, OpenGL or Vulkan) at construction time.

Member Function Documentation

◆ Make()

static std::shared_ptr< RWLSwapchain > Make ( wl_surface *  surface,
SkISize  size 
)
staticnoexcept

Creates a Wayland swapchain for the given surface.

Dispatches to the concrete backend matching the active graphics API.

Parameters
surfaceThe target wl_surface. Must not be null.
sizeInitial image size in pixels. Must not be empty.
Returns
A valid swapchain on success, nullptr on failure.

◆ surface()

wl_surface * surface ( ) const
inlinenoexcept

Returns the Wayland surface this swapchain presents to.