From 5e910c7e41d18dab95e34ceb6e620a8958197ae6 Mon Sep 17 00:00:00 2001 From: kartofen Date: Mon, 16 Oct 2023 23:46:15 +0300 Subject: things done --- src/device.h | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/device.h (limited to 'src/device.h') diff --git a/src/device.h b/src/device.h new file mode 100644 index 0000000..d6768e1 --- /dev/null +++ b/src/device.h @@ -0,0 +1,33 @@ +#ifndef DEVICE_H +#define DEVICE_H + +#include +#include "common.h" + +typedef struct device { + VkInstance instance; + VkDebugUtilsMessengerEXT debug_messenger; + + VkPhysicalDevice physical_device; + VkDevice logical_device; + VkQueue graphics_queue; + + VkSurfaceKHR surface; +} * device_t; + +typedef int (*surface_func_t)(VkInstance instance, VkSurfaceKHR *surface); + +struct device_info { + char *name; + uint32_t version; + + const char* const* extensions; + uint32_t ext_count; + + surface_func_t surface_func; +}; + +device_t device_create(struct device_info *info); +void device_destroy(device_t device); + +#endif -- cgit v1.2.3