#ifndef DEVICE_H #define DEVICE_H #include #include #include #include "common.h" // from vulkan source #define MAKE_VERSION(major, minor, patch) \ ((((u32)(major)) << 22U) | (((u32)(minor)) << 12U) | ((u32)(patch))) typedef uint32_t u32; typedef struct device { VkInstance instance; VkDebugUtilsMessengerEXT debug_messenger; VkPhysicalDevice physical_device; VkDevice logical_device; VkQueue graphics_queue; VkQueue present_queue; VkSwapchainKHR swap_chain; VkSurfaceKHR surface; VkImage *swap_chain_images; u32 nimages; } * device_t; struct device_info { char *name; u32 version; const char* const* extensions; u32 ext_count; int (*surface_func)(VkInstance instance, VkSurfaceKHR *surface); }; device_t device_create(struct device_info *info); void device_destroy(device_t device); #endif