Vireo  0.0
Vireo 3D Rendering Hardware Interface
SwapChain Class Referenceabstract

Detailed Description

A swapchain object

Manual page : Swap Chains

Public Member Functions

const ExtentgetExtent () const
 
auto getAspectRatio () const
 
auto getCurrentFrameIndex () const
 
auto getFramesInFlight () const
 
auto getFormat () const
 
virtual void nextFrameIndex () = 0
 
virtual bool acquire (const std::shared_ptr< Fence > &fence) = 0
 
virtual void present () = 0
 
virtual void recreate () = 0
 
virtual void waitIdle () = 0
 
virtual ~SwapChain () = default
 
 SwapChain (SwapChain &) = delete
 
SwapChain & operator= (const SwapChain &) = delete
 

Protected Member Functions

 SwapChain (const ImageFormat format, const PresentMode presentMode, const uint32_t framesInFlight)
 

Protected Attributes

const PresentMode presentMode
 
const ImageFormat format
 
uint32_t framesInFlight
 
Extent extent {}
 
float aspectRatio {}
 
uint32_t currentFrameIndex {0}
 

Constructor & Destructor Documentation

virtual ~SwapChain ( )
virtualdefault
SwapChain ( SwapChain &  )
delete
SwapChain ( const ImageFormat  format,
const PresentMode  presentMode,
const uint32_t  framesInFlight 
)
inlineprotected

Member Function Documentation

virtual bool acquire ( const std::shared_ptr< Fence > &  fence)
pure virtual

Acquires the next frame buffer.

Returns
false if the operation failed.
auto getAspectRatio ( ) const
inline

Returns the swap chain with/height ratio

auto getCurrentFrameIndex ( ) const
inline

Returns the current frame index. Note that frame indexes are not necessarily incremental

const Extent& getExtent ( ) const
inline

Returns the swap chain extent

auto getFormat ( ) const
inline

Returns the pixel format of the frame buffers

auto getFramesInFlight ( ) const
inline

Returns the number of frame/back buffers in the swap chain

virtual void nextFrameIndex ( )
pure virtual

Get the next frame index

SwapChain& operator= ( const SwapChain &  )
delete
virtual void present ( )
pure virtual

Presents the current frame buffer into the surface

virtual void recreate ( )
pure virtual

Recreates the swap chain if the extent changed (in case of a window resizing)

virtual void waitIdle ( )
pure virtual

Waits for the last present operation to end

Member Data Documentation

float aspectRatio {}
protected
uint32_t currentFrameIndex {0}
protected
Extent extent {}
protected
const ImageFormat format
protected
uint32_t framesInFlight
protected
const PresentMode presentMode
protected