use byteorder::{ByteOrder, LittleEndian}; use std::convert::TryInto; use std::ffi::c_void; use crate::gpu_buffers::*; // Takes ownership of mesh stuff in an opaque way that's abstract // from the IQM model. IQM is zero-copy, but this is not. // Since it's opaque, I can drop in a VBO/IBO setup when I'm not lazy. pub struct RenderableMesh { first_triangle: usize, num_triangles: i32, pub name: Vec , } pub struct RenderableModel { num_pos: usize, num_uv: usize, vertexes: VertexBuffer, indexes: IndexBuffer, pub meshes: Vec , } unsafe fn vertex_attrib_pointer (id: Option , num_coords: i32, float_offset: usize) { const FALSE_U8: u8 = 0; const FLOAT_SIZE: i32 = 4; if let Some (id) = id { gl::VertexAttribPointer (id, num_coords, gl::FLOAT, FALSE_U8, FLOAT_SIZE * num_coords, (float_offset * 4) as *const u8 as *const c_void); } } pub type AttrMap = Vec