From 7c4f089f2eb89fc433eba77c02edf8e7a7db1814 Mon Sep 17 00:00:00 2001 From: Seth Hamilton Date: Sat, 6 Sep 2025 10:52:19 -0500 Subject: [PATCH] should refer to faces array directly (not pointer to pointer) --- src/body.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/body.cpp b/src/body.cpp index 03521d0..e4c4db4 100644 --- a/src/body.cpp +++ b/src/body.cpp @@ -52,7 +52,7 @@ bool load_body(Body* out_body, const char* obj_filepath) { glBufferData(GL_ARRAY_BUFFER, data.verts_len * sizeof(float), data.verts, GL_STATIC_DRAW); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, ebo); - glBufferData(GL_ELEMENT_ARRAY_BUFFER, data.faces_len * sizeof(int), &data.faces, GL_STATIC_DRAW); + glBufferData(GL_ELEMENT_ARRAY_BUFFER, data.faces_len * sizeof(int), data.faces, GL_STATIC_DRAW); glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 3 * sizeof(float), (void*)0); glEnableVertexAttribArray(0); @@ -69,7 +69,7 @@ void draw_body(const Body& b) { glDrawElements(GL_TRIANGLES, b.data.faces_len, GL_UNSIGNED_INT, 0); } -void create_new_sphere(Body* b, float scale) { +void create_new_sphere(Body* b, float scale) { assert(load_body(b, "Icosphere.obj")); b->scale = scale; }