diff options
author | kartofen <mladenovnasko0@gmail.com> | 2023-10-28 00:16:54 +0300 |
---|---|---|
committer | kartofen <mladenovnasko0@gmail.com> | 2023-10-28 00:16:54 +0300 |
commit | ff5bf11c5f319f9c90de7a59eb4f8f338a74a38f (patch) | |
tree | e58ef28897986cb32f85d741ab4cc2efdf9622e4 /src/graphics.h | |
parent | e9bd321c8bd6bdb6aa7305c6da8b33e8cac462f7 (diff) |
added vertex buffers
Diffstat (limited to 'src/graphics.h')
-rw-r--r-- | src/graphics.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/graphics.h b/src/graphics.h index 52e511e..470ea9b 100644 --- a/src/graphics.h +++ b/src/graphics.h @@ -3,6 +3,7 @@ #include <stdint.h> #include <stdbool.h> +#include <cglm/cglm.h> #include <vulkan/vulkan.h> #include "common.h" @@ -13,6 +14,16 @@ typedef uint32_t u32; +typedef struct vertex { + vec2 pos; + vec3 color; +} vertex_t; + +typedef struct buffer { + VkBuffer buffer; + VkDeviceMemory memory; +} buffer_t; + typedef struct graphics { VkInstance instance; VkDebugUtilsMessengerEXT debug_messenger; @@ -54,6 +65,9 @@ typedef struct graphics { VkFence fence_inflight; } sync; + buffer_t vertex_buffer; + buffer_t staging_buffer; + } * graphics_t; struct graphics_info { @@ -63,6 +77,9 @@ struct graphics_info { const char* const* extensions; u32 ext_count; + vertex_t *vertices; + size_t nvertices; + int (*surface_func)(VkInstance instance, VkSurfaceKHR *surface); }; |