Raven Engine v0.1
A modern 3D Game Engine
Loading...
Searching...
No Matches
Raven::Swapchain Class Referenceabstract

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

#include <Swapchain.h>

Inherits Raven::RefCounted.

Inherited by 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 BeginFrame ()=0
virtual void Recreate (u32 width, u32 height, bool enabled)=0
 Recreates the swapchain buffers to the specified dimensions.
virtual float GetAspectRatio () const =0
 Returns the aspect ratio (width / height) of the swapchain.
virtual void * GetFence () const =0
virtual void * GetFence (const u32 frame) const =0
Public Member Functions inherited from Raven::RefCounted
 RefCounted ()
virtual ~RefCounted ()
void IncRefCount ()
void DecRefCount ()
u32 GetRefCount () const

Static Public Member Functions

static Ref< 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

◆ BeginFrame()

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

Implemented in Raven::VulkanSwapchain.

◆ Create()

Ref< 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
Ref<Swapchain> Ref-counted 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() [1/2]

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

Implemented in Raven::VulkanSwapchain.

◆ GetFence() [2/2]

virtual void * Raven::Swapchain::GetFence ( const u32 frame) 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.

◆ Recreate()

virtual void Raven::Swapchain::Recreate ( u32 width,
u32 height,
bool enabled )
pure virtual

Recreates 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.
enabledEnables/Disables VSync

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: