Kohi Game Engine
vulkan_swapchain.h File Reference

The Vulkan swapchain, which works with the framebuffer/attachments and the surface to present an image to the screen. More...

#include "vulkan_types.h"

Go to the source code of this file.

Functions

void vulkan_swapchain_create (vulkan_context *context, u32 width, u32 height, renderer_config_flags flags, vulkan_swapchain *out_swapchain)
 Creates a new swapchain. More...
 
void vulkan_swapchain_recreate (vulkan_context *context, u32 width, u32 height, vulkan_swapchain *swapchain)
 Recreates the given swapchain with the given width and height, replacing the internal swapchain with the newly-created one. More...
 
void vulkan_swapchain_destroy (vulkan_context *context, vulkan_swapchain *swapchain)
 Destroys the given swapchain. More...
 

Detailed Description

The Vulkan swapchain, which works with the framebuffer/attachments and the surface to present an image to the screen.

Author
Travis Vroman (travi.nosp@m.s@ko.nosp@m.hieng.nosp@m.ine..nosp@m.com)
Version
1.0
Date
2022-01-11

Function Documentation

◆ vulkan_swapchain_create()

void vulkan_swapchain_create ( vulkan_context context,
u32  width,
u32  height,
renderer_config_flags  flags,
vulkan_swapchain out_swapchain 
)

Creates a new swapchain.

Parameters
contextA pointer to the Vulkan context.
widthThe initial width of the surface area.
heightThe initial height of the surface area.
vsyncIndicates if the swapchain should use vsync.
out_swapchainA pointer to the newly-created swapchain.

◆ vulkan_swapchain_destroy()

void vulkan_swapchain_destroy ( vulkan_context context,
vulkan_swapchain swapchain 
)

Destroys the given swapchain.

Parameters
contextA pointer to the Vulkan context.
swapchainA pointer to the swapchain to be destroyed.

◆ vulkan_swapchain_recreate()

void vulkan_swapchain_recreate ( vulkan_context context,
u32  width,
u32  height,
vulkan_swapchain swapchain 
)

Recreates the given swapchain with the given width and height, replacing the internal swapchain with the newly-created one.

Parameters
contextA pointer to the Vulkan context.
widthThe new width of the surface area.
heightThe new width of the surface area.
swapchainA pointer to the swapchain to be recreated.