diff options
Diffstat (limited to 'src/device.h')
-rw-r--r-- | src/device.h | 33 |
1 files changed, 33 insertions, 0 deletions
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 <vulkan/vulkan.h> +#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 |