From c25500a0b9ccf7d5932cf4f21b796e7c557fe23c Mon Sep 17 00:00:00 2001 From: Brett Laptop Date: Wed, 10 Jan 2024 12:38:51 -0500 Subject: [PATCH] obj --- tests/src/main.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/src/main.cpp b/tests/src/main.cpp index 51ee673..0e07efb 100644 --- a/tests/src/main.cpp +++ b/tests/src/main.cpp @@ -15,7 +15,7 @@ blt::gfx::resource_manager resources; blt::gfx::batch_renderer_2d renderer_2d(resources); blt::gfx::first_person_camera camera; -blt::gfx::vertex_array** vao; +std::vector vao; float x = 0, y = 0, z = 0; float bx = 500, by = 500; @@ -59,8 +59,14 @@ void init() auto object = blt::gfx::quick_load("../resources/models/complex_cube.obj"); vbo_t vertices_vbo; + vertices_vbo.allocate(static_cast(object.vertex_data().size() * sizeof(blt::gfx::constructed_vertex_t)), object.vertex_data().data()); - vertices_vbo.allocate(static_cast(object.vertex_data().size() * sizeof(blt::gfx::constructed_vertex_t))); + for (auto obj : object.objects()) + { + vbo_t indices_vbo; + indices_vbo.allocate(static_cast(obj.indices.size() * sizeof(blt::gfx::triangle_t)), obj.indices.data()); + + } global_matrices.create_internals(); resources.load_resources();