summaryrefslogtreecommitdiff
path: root/src/device.h
blob: d6768e1777ec1af25f680b173c117bc39989a15e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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