implemented Vulkan surface creation

This commit is contained in:
Lorenzo Torres 2025-11-05 22:04:39 +01:00
parent fa2a4887df
commit b6b0c5091b
13 changed files with 128 additions and 18 deletions

23
rendering/vk/surface.c Normal file
View file

@ -0,0 +1,23 @@
#include "surface.h"
#include "../../core/log.h"
/*
* This function is defined in rgfw.h
*/
VkResult RGFW_window_createSurface_Vulkan(RGFW_window * win, VkInstance instance, VkSurfaceKHR * surface);
/*
* RGFW exposes a platform independent function to
* create a Vulkan surface.
*/
void vk_surface_init(struct renderer_context *context)
{
if (RGFW_window_createSurface_Vulkan(context->window, context->instance, &context->surface) != VK_SUCCESS) {
fatal("Can't create Vulkan surface.\n");
}
}
void vk_surface_deinit(struct renderer_context *context)
{
vkDestroySurfaceKHR(context->instance, context->surface, NULL);
}