From 4512fafc57d2ad95b83c8476781ce105a2cdc4e5 Mon Sep 17 00:00:00 2001 From: kartofen Date: Sun, 29 Oct 2023 13:06:40 +0200 Subject: index buffer and staging --- src/main.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/main.c') diff --git a/src/main.c b/src/main.c index cc6c3d5..4b5685d 100644 --- a/src/main.c +++ b/src/main.c @@ -11,9 +11,14 @@ graphics_t graphics; int _create_surface(VkInstance instance, VkSurfaceKHR *surface); vertex_t vertices[] = { - {{0.0f, -0.5f}, {1.0f, 0.0f, 0.0f}}, - {{0.5f, 0.5f}, {0.0f, 1.0f, 0.0f}}, - {{-0.5f, 0.5f}, {0.0f, 0.0f, 1.0f}} + {{-0.5f, -0.5f}, {1.0f, 0.0f, 0.0f}}, + {{0.5f, -0.5f}, {0.0f, 1.0f, 0.0f}}, + {{0.5f, 0.5f}, {0.0f, 0.0f, 1.0f}}, + {{-0.5f, 0.5f}, {1.0f, 1.0f, 1.0f}} +}; + +u32 indices[] = { + 0, 1, 2, 2, 3, 0 }; int main(void) @@ -56,6 +61,8 @@ int main(void) grph_info.vertices = vertices; grph_info.nvertices = ARR_SIZE(vertices); + grph_info.indices = indices; + grph_info.nindices = ARR_SIZE(indices); grph_info.surface_func = _create_surface; -- cgit v1.2.3