From 677b697eb18b9abb252eacff320aa48314075a0e Mon Sep 17 00:00:00 2001 From: Irene Knapp Date: Sun, 9 Aug 2026 18:19:13 -0700 Subject: change the interface to load_obj() now it matches load_png() in a sort of abstract, high-level way this is meant to make it easier to abstract over assets Force-Push: yes Change-Id: Icddc6180e0c78c29bebbd47d84bb381c4fd0c3ca --- src/files/obj.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/files/obj.rs') diff --git a/src/files/obj.rs b/src/files/obj.rs index c45ffbf..af2ce03 100644 --- a/src/files/obj.rs +++ b/src/files/obj.rs @@ -1,5 +1,6 @@ #![forbid(unsafe_code)] use crate::error::*; +use crate::graphics::{ Permanent, Model }; use crate::linear_algebra::{ Vec2, Vec3 }; use crate::shader_data::Vertex; @@ -8,7 +9,7 @@ use std::io::Cursor; use tobj::{ load_obj_buf, LoadOptions }; -pub fn load_obj() -> Result<(Vec>, Vec)> { +pub fn load_obj(permanent: &Permanent) -> Result { let obj = include_bytes!("../../models/teapot.obj"); let load_options = LoadOptions { @@ -39,6 +40,6 @@ pub fn load_obj() -> Result<(Vec>, Vec)> { } } - Ok((vertices, indices)) + Model::new(vertices, indices, permanent) } -- cgit 1.4.1