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

Abstract base class representing a rendering swapchain. More...

#include <RSwapchain.h>

+ Inheritance diagram for RSwapchain:

Public Member Functions

 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.
 

Detailed Description

Abstract base class representing a rendering swapchain.

A swapchain manages a set of images that can be acquired, rendered into, and then presented to the display. This class provides an interface for acquiring images, presenting rendered content, and handling resize events.

Constructor & Destructor Documentation

◆ RSwapchain()

RSwapchain ( SkISize  size)
inlinenoexcept

Construct a swapchain with the given image size.

Member Function Documentation

◆ size()

SkISize size ( ) const
inlinenoexcept

The size of swapchain images in pixels.

◆ acquire()

virtual std::optional< const RSwapchainImage > acquire ( )
pure virtualnoexcept

Acquire the next available swapchain image.

Returns
A new swapchain image on success, or nullopt on failure.

Implemented in RGLSwapchainWL, RRSSwapchainWL, and RVKSwapchainWL.

◆ present()

virtual bool present ( const RSwapchainImage image,
SkRegion *  damage = nullptr 
)
pure virtualnoexcept

Present a previously acquired image to the display.

Parameters
imageThe image to be presented.
damageRegion of the image that has changed since the last frame.
  • Specified in buffer coordinates, relative to the top-left corner.
  • May extend beyond the image bounds.
  • Passing nullptr indicates full damage.
  • Passing an empty region indicates no damage.
Returns
true if the presentation succeeded, otherwise false.

Implemented in RGLSwapchainWL, RRSSwapchainWL, and RVKSwapchainWL.

◆ resize()

virtual bool resize ( SkISize  size)
pure virtualnoexcept

Request a resize of future swapchain images.

This affects only newly acquired images, currently acquired images remain at the previous size until released.

Parameters
sizeThe new desired image size in pixels.
Returns
true if the resize request was accepted, otherwise false.

Implemented in RGLSwapchainWL, RRSSwapchainWL, and RVKSwapchainWL.