CeresEngine 0.2.0
A game development framework
Loading...
Searching...
No Matches
CeresEngine::VKSwapchain Class Reference

#include <CeresEngine/RenderAPI/Vulkan/VKSwapchain.hpp>

Inheritance diagram for CeresEngine::VKSwapchain:
CeresEngine::GPUSwapchain CeresEngine::VKDeviceObject< VKSwapchain, GPUSwapchain > CeresEngine::TDeviceObject< GPUSwapchainDescriptor > CeresEngine::VKObject< ChildTypeName, ParentType > CeresEngine::VKDeviceObjectBase CeresEngine::GPUDeviceObject CeresEngine::VKObjectBase CeresEngine::GPUObject

Public Member Functions

 VKSwapchain (VKDevice &device, const GPUSwapchainDescriptor &descriptor, VkSurfaceKHR surface)
 Creates a new VKSwapchain for the given device
 
 ~VKSwapchain () override
 Destroys the VKSwapchain object.
 
GPUImagePtr nextRenderImage () override
 
void present () override
 Presents a image from the getSwapchain. The command buffer that signals.
 
VkSemaphore getImageAvailableSemaphore () const
 
VkSemaphore getRenderFinishedSemaphore () const
 
- Public Member Functions inherited from CeresEngine::GPUSwapchain
 GPUSwapchain (const GPUSwapchain &)=delete
 Deleted copy constructor.
 
GPUSwapchainoperator= (const GPUSwapchain &)=delete
 
 GPUSwapchain (GPUSwapchain &&)=delete
 Deleted move constructor.
 
GPUSwapchainoperator= (GPUSwapchain &&)=delete
 
 TDeviceObject (GPUDevice &device, const Descriptor &descriptor)
 Inherited constructors.
 
 TDeviceObject (const TDeviceObject &)=delete
 Inherited constructors.
 
 TDeviceObject (TDeviceObject &&)=delete
 Inherited constructors.
 
- Public Member Functions inherited from CeresEngine::TDeviceObject< GPUSwapchainDescriptor >
 TDeviceObject (GPUDevice &device, const Descriptor &descriptor)
 Initializes a new RenderAPI device object instance.
 
 TDeviceObject (const TDeviceObject &)=delete
 
 TDeviceObject (TDeviceObject &&)=delete
 
 ~TDeviceObject () override=default
 
TDeviceObjectoperator= (const TDeviceObject &)=delete
 
TDeviceObjectoperator= (TDeviceObject &&)=delete
 
- Public Member Functions inherited from CeresEngine::GPUDeviceObject
 GPUDeviceObject (GPUDevice &device)
 
 ~GPUDeviceObject () override
 
- Public Member Functions inherited from CeresEngine::GPUObject
 GPUObject ()=default
 
virtual ~GPUObject ()=default
 
 GPUObject (const GPUObject &)=delete
 
GPUObjectoperator= (const GPUObject &)=delete
 
 GPUObject (GPUObject &&)=delete
 
GPUObjectoperator= (GPUObject &&)=delete
 
void retain () noexcept
 Retains the object by increment it's reference count by one.
 
bool release () noexcept
 Releases the object by decrementing it's reference count by one.
 
- Public Member Functions inherited from CeresEngine::VKDeviceObjectBase
 VKDeviceObjectBase (VKDevice &device) noexcept
 Creates a new VKDeviceObjectBase from the given device.
 
 ~VKDeviceObjectBase () noexcept
 Destroys the VKDeviceObjectBase.
 

Protected Attributes

VkSurfaceKHR mSurface = VK_NULL_HANDLE
 The Vulkan surface object.
 
VkSwapchainKHR mSwapchain = VK_NULL_HANDLE
 The Vulkan swapchain object.
 
Vector< VKImagePtr, VKAllocatormRenderImages {gVKAllocator()}
 The Vulkan framebuffer object.
 
VKCommandQueuePtr mPresentQueue
 The Vulkan presentation queue.
 
UInt32 mCurrentRenderImageIndex = 0
 The currently active swapchain index.
 
SmallVector< VkSemaphore, 3 > mImageAvailableSemaphore
 The Vulkan available semaphore.
 
SmallVector< VkSemaphore, 3 > mRenderFinishedSemaphore
 The Vulkan render finished semaphore.
 
GPUSwapchainDescriptor mDescriptor
 The swapchain descriptor.
 
size_t mCurrentFrame = 0
 

Private Member Functions

void recreate ()
 Recrreates the Vulkan swapchain.
 

Additional Inherited Members

- Public Types inherited from CeresEngine::TDeviceObject< GPUSwapchainDescriptor >
using Descriptor = GPUSwapchainDescriptor
 An type-alias to the descriptor struct type.
 
- Static Public Member Functions inherited from CeresEngine::VKObject< ChildTypeName, ParentType >
static RC< ChildTypeNamecast (const RC< ParentType > &ptr)
 Casts a RC containing a ParentType pointer to a pointer to a pointer to a ChildTypeName.
 
static ChildTypeNamecast (ParentType &object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const ChildTypeNamecast (const ParentType &object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static ChildTypeNamecast (ParentType *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
static const ChildTypeNamecast (const ParentType *object)
 Casts a object of type ParentType to a object of type ChildTypeName.
 
- Static Public Member Functions inherited from CeresEngine::VKObjectBase
static voidoperator new (size_t size) noexcept
 
static void operator delete (void *p, std::size_t sz) noexcept
 
- Public Attributes inherited from CeresEngine::TDeviceObject< GPUSwapchainDescriptor >
const Descriptordescriptor
 A structure that describes the object and it's properties.
 
- Public Attributes inherited from CeresEngine::GPUDeviceObject
GPUDevicedevice
 The owning device this object was created from.
 
- Public Attributes inherited from CeresEngine::VKDeviceObjectBase
VKDevicedeviceVK
 The owning VKDevice instance.
 
- Protected Member Functions inherited from CeresEngine::GPUObject
virtual void destroy () noexcept
 A internal method called by the system when the object reference count reaches zero.
 
- Protected Member Functions inherited from CeresEngine::VKDeviceObject< VKSwapchain, GPUSwapchain >
 VKDeviceObject (VKDevice &device) noexcept
 Creates a new VKDeviceObject from the given device.
 

Constructor & Destructor Documentation

◆ VKSwapchain()

CeresEngine::VKSwapchain::VKSwapchain ( VKDevice device,
const GPUSwapchainDescriptor descriptor,
VkSurfaceKHR  surface 
)
explicit

Creates a new VKSwapchain for the given device

Parameters
deviceThe device to create a swapchain for
descriptorThe swapchain descriptor
surfaceThe Vulkan surface

◆ ~VKSwapchain()

CeresEngine::VKSwapchain::~VKSwapchain ( )
override

Destroys the VKSwapchain object.

Member Function Documentation

◆ getImageAvailableSemaphore()

VkSemaphore CeresEngine::VKSwapchain::getImageAvailableSemaphore ( ) const

◆ getRenderFinishedSemaphore()

VkSemaphore CeresEngine::VKSwapchain::getRenderFinishedSemaphore ( ) const

◆ nextRenderImage()

GPUImagePtr CeresEngine::VKSwapchain::nextRenderImage ( )
overridevirtual

Returns
The next render image in the getSwapchain

Implements CeresEngine::GPUSwapchain.

◆ present()

void CeresEngine::VKSwapchain::present ( )
overridevirtual

Presents a image from the getSwapchain. The command buffer that signals.

Implements CeresEngine::GPUSwapchain.

◆ recreate()

void CeresEngine::VKSwapchain::recreate ( )
private

Recrreates the Vulkan swapchain.

Member Data Documentation

◆ mCurrentFrame

size_t CeresEngine::VKSwapchain::mCurrentFrame = 0
protected

◆ mCurrentRenderImageIndex

UInt32 CeresEngine::VKSwapchain::mCurrentRenderImageIndex = 0
protected

The currently active swapchain index.

◆ mDescriptor

GPUSwapchainDescriptor CeresEngine::VKSwapchain::mDescriptor
protected

The swapchain descriptor.

◆ mImageAvailableSemaphore

SmallVector<VkSemaphore, 3> CeresEngine::VKSwapchain::mImageAvailableSemaphore
protected

The Vulkan available semaphore.

◆ mPresentQueue

VKCommandQueuePtr CeresEngine::VKSwapchain::mPresentQueue
protected

The Vulkan presentation queue.

◆ mRenderFinishedSemaphore

SmallVector<VkSemaphore, 3> CeresEngine::VKSwapchain::mRenderFinishedSemaphore
protected

The Vulkan render finished semaphore.

◆ mRenderImages

Vector<VKImagePtr, VKAllocator> CeresEngine::VKSwapchain::mRenderImages {gVKAllocator()}
protected

The Vulkan framebuffer object.

◆ mSurface

VkSurfaceKHR CeresEngine::VKSwapchain::mSurface = VK_NULL_HANDLE
protected

The Vulkan surface object.

◆ mSwapchain

VkSwapchainKHR CeresEngine::VKSwapchain::mSwapchain = VK_NULL_HANDLE
protected

The Vulkan swapchain object.


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