Raven Engine v0.1
Loading...
Searching...
No Matches
Raven::Swapchain Class Referenceabstract

Abstract interface for the platform-specific swapchain. More...

#include <Swapchain.h>

Inheritance diagram for Raven::Swapchain:
Raven::VulkanSwapchain

Public Member Functions

virtual ~Swapchain ()=default
virtual void Shutdown ()=0
 Cleans up and releases all resources associated with the swapchain.
virtual void Present ()=0
 Presents the current backbuffer to the display.
virtual void Resize (u32 width, u32 height)=0
 Resizes the swapchain buffers to the specified dimensions.
virtual void SetVSync (bool enabled)=0
 Enables or disables vertical synchronization (VSync).
virtual float GetAspectRatio () const =0
 Returns the aspect ratio (width / height) of the swapchain.
virtual void * GetFence () const =0

Static Public Member Functions

static Scope< SwapchainCreate (u32 *width, u32 *height, bool vsync)
 Factory method to create a platform-specific swapchain instance.

Detailed Description

Abstract interface for the platform-specific swapchain.

Responsible for presenting rendered images to the display, managing the swapchain buffers, handling resizing events, and controlling VSync behavior.

Constructor & Destructor Documentation

◆ ~Swapchain()

virtual Raven::Swapchain::~Swapchain ( )
virtualdefault

Member Function Documentation

◆ Create()

Scope< Swapchain > Raven::Swapchain::Create ( u32 * width,
u32 * height,
bool vsync )
static

Factory method to create a platform-specific swapchain instance.

Parameters
widthPointer to initial width; updated if swapchain decides to override.
heightPointer to initial height; updated if swapchain decides to override.
vsyncInitial VSync enabled/disabled state.
Returns
Scope<Swapchain> Scoped pointer to the created swapchain.

◆ GetAspectRatio()

virtual float Raven::Swapchain::GetAspectRatio ( ) const
pure virtual

Returns the aspect ratio (width / height) of the swapchain.

Useful for configuring projection matrices and viewport settings.

Returns
float Aspect ratio.

Implemented in Raven::VulkanSwapchain.

◆ GetFence()

virtual void * Raven::Swapchain::GetFence ( ) const
pure virtual

Implemented in Raven::VulkanSwapchain.

◆ Present()

virtual void Raven::Swapchain::Present ( )
pure virtual

Presents the current backbuffer to the display.

Synchronizes with the display refresh rate depending on VSync settings.

Implemented in Raven::VulkanSwapchain.

◆ Resize()

virtual void Raven::Swapchain::Resize ( u32 width,
u32 height )
pure virtual

Resizes the swapchain buffers to the specified dimensions.

Typically called when the window size changes.

Parameters
widthNew width of the swapchain.
heightNew height of the swapchain.

Implemented in Raven::VulkanSwapchain.

◆ SetVSync()

virtual void Raven::Swapchain::SetVSync ( bool enabled)
pure virtual

Enables or disables vertical synchronization (VSync).

Parameters
enabledTrue to enable VSync, false to disable.

Implemented in Raven::VulkanSwapchain.

◆ Shutdown()

virtual void Raven::Swapchain::Shutdown ( )
pure virtual

Cleans up and releases all resources associated with the swapchain.

Implemented in Raven::VulkanSwapchain.


The documentation for this class was generated from the following files: