From ff5bf11c5f319f9c90de7a59eb4f8f338a74a38f Mon Sep 17 00:00:00 2001 From: kartofen Date: Sat, 28 Oct 2023 00:16:54 +0300 Subject: added vertex buffers --- src/graphics.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'src/graphics.h') 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 #include +#include #include #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); }; -- cgit v1.2.3