core::ivk::swapchain class

describes a framebuffer that is specially handled and created by the driver

swpachains can be considered special core::ivk::framebuffer_t's, with some special pecularities. For example, unlike framebuffer's, you have to request the next image from the driver for a swapchain, and there are many more restrictions on both format and size imposed on swapchains.

member-functions

next
public
present
public
size
returns the amount of images in the swapchain
const public noexcept
renderpass
const public noexcept
width
const public noexcept
height
const public noexcept
framebuffers
const public noexcept
images
const public noexcept
views
const public noexcept
clear_color
const public noexcept
clear_depth
const public noexcept
has_depth
const public noexcept
clear_color
sets the clear color
public noexcept
is_ready
const public noexcept

Function documentation

bool core::ivk::swapchain::next(vk::Semaphore presentComplete, uint32_t& out_image_index)

Details

when invoking this method it will request the next image in the swapchain, and return. the semaphore will be flaged once the resource is ready on the GPU. (and so should be used as a sync point before using the image in the swapchain.

Parameters
presentComplete in/out the semaphore to flag once ready.
out_image_index out the image index of the next image in the swapchain.
Returns true in case it managed to get the next image in the swapchain from the driver.

vk::Result core::ivk::swapchain::present(vk::Semaphore wait)

Parameters
wait in the semaphore to wait on when presenting.
Returns success in case presenting went well.

vk::RenderPass core::ivk::swapchain::renderpass() const noexcept

Returns the renderpass associated with the swapchain.

uint32_t core::ivk::swapchain::width() const noexcept

Returns the width of the swapchain image

uint32_t core::ivk::swapchain::height() const noexcept

Returns the height of the swapchainimage.

const std::vector<vk::Framebuffer>& core::ivk::swapchain::framebuffers() const noexcept

Returns the vulkan framebuffers for the swapchain (one for each buffer).

const std::vector<vk::Image>& core::ivk::swapchain::images() const noexcept

Returns the images for the swapchain (one for each buffer).

const std::vector<vk::ImageView>& core::ivk::swapchain::views() const noexcept

Returns the image views for the swapchain (one for each buffer).

const vk::ClearColorValue core::ivk::swapchain::clear_color() const noexcept

Returns the clear color value assigned to the swapchain.

const vk::ClearDepthStencilValue core::ivk::swapchain::clear_depth() const noexcept

Details

Returns the clear depth color of the swapchain

bool core::ivk::swapchain::has_depth() const noexcept

Returns if the swapchain uses a depth texture or not.

void core::ivk::swapchain::clear_color(vk::ClearColorValue color) noexcept

Brief

sets the clear color

Parameters
color in the new clear color value to use

bool core::ivk::swapchain::is_ready() const noexcept

Details

Returns false in case the window might be resizing.