Skip to content

finite_render_init

The finite_render_init function creates a Vulkan instance and surface using the provided shell and configuration data.

FiniteRender *finite_render_init(FiniteShell *shell, char **extensions, char **layers, uint32_t _exts, uint32_t _layers);
TypeDescription
FiniteShell *shellShell that holds the surface and display needed for surface creation.
char **extensionsOptional array of Vulkan instance extensions to enable.
char **layersOptional array of Vulkan validation layers to enable.
uint32_t _extsNumber of Vulkan instance extensions in the extensions array.
uint32_t _layersNumber of Vulkan validation layers in the layers array.
#include <finite/log.h>
#include <finite/render.h>
FiniteShell *shell = finite_shell_init("wayland-0");
char *extensions[] = {
VK_KHR_SURFACE_EXTENSION_NAME,
VK_EXT_DEBUG_UTILS_EXTENSION_NAME,
VK_KHR_WAYLAND_SURFACE_EXTENSION_NAME
};
char *layers[] = {
"VK_LAYER_KHRONOS_validation"
};
FiniteRender *render = finite_render_init(shell, extensions, layers, 3, 1);

This function must have a valid FiniteShell.

Call this function after creating a shell. It sets up the Vulkan instance and prepares a surface for rendering.