diff --git a/citro3d/examples/cube.rs b/citro3d/examples/cube.rs index b8ff063..69d9f80 100644 --- a/citro3d/examples/cube.rs +++ b/citro3d/examples/cube.rs @@ -9,7 +9,7 @@ use citro3d::math::{ }; use citro3d::render::ClearFlags; use citro3d::{attrib, buffer, render, shader}; -use citro3d::{texenv, DrawingIndices}; +use citro3d::{texenv, IndexType}; use ctru::prelude::*; use ctru::services::gfx::{RawFrameBuffer, Screen, TopScreen3D}; @@ -170,7 +170,7 @@ fn main() { instance.draw_elements( buffer::Primitive::Triangles, &buf_info, - DrawingIndices::U16(&indecies), + IndexType::U16(&indecies), ); } diff --git a/citro3d/src/lib.rs b/citro3d/src/lib.rs index 88636ee..7117a85 100644 --- a/citro3d/src/lib.rs +++ b/citro3d/src/lib.rs @@ -177,13 +177,13 @@ impl Instance { &mut self, primitive: buffer::Primitive, buf: &buffer::Info, - indices: impl Into>, + indices: impl Into>, ) { self.set_buffer_info(buf); - let indices: DrawingIndices<'a> = indices.into(); + let indices: IndexType<'a> = indices.into(); let elements = match indices { - DrawingIndices::U16(v) => v.as_ptr() as *const _, - DrawingIndices::U8(v) => v.as_ptr() as *const _, + IndexType::U16(v) => v.as_ptr() as *const _, + IndexType::U8(v) => v.as_ptr() as *const _, }; assert!( is_linear_ptr(elements), @@ -194,8 +194,8 @@ impl Instance { indices.len() as i32, // flag bit for short or byte match indices { - DrawingIndices::U16(_) => citro3d_sys::C3D_UNSIGNED_SHORT, - DrawingIndices::U8(_) => citro3d_sys::C3D_UNSIGNED_BYTE, + IndexType::U16(_) => citro3d_sys::C3D_UNSIGNED_SHORT, + IndexType::U8(_) => citro3d_sys::C3D_UNSIGNED_BYTE, } as i32, elements, ); @@ -277,26 +277,26 @@ impl Drop for Instance { } } -pub enum DrawingIndices<'a> { +pub enum IndexType<'a> { U16(&'a [u16]), U8(&'a [u8]), } -impl DrawingIndices<'_> { +impl IndexType<'_> { fn len(&self) -> usize { match self { - DrawingIndices::U16(a) => a.len(), - DrawingIndices::U8(a) => a.len(), + IndexType::U16(a) => a.len(), + IndexType::U8(a) => a.len(), } } } -impl<'a> From<&'a [u8]> for DrawingIndices<'a> { +impl<'a> From<&'a [u8]> for IndexType<'a> { fn from(v: &'a [u8]) -> Self { Self::U8(v) } } -impl<'a> From<&'a [u16]> for DrawingIndices<'a> { +impl<'a> From<&'a [u16]> for IndexType<'a> { fn from(v: &'a [u16]) -> Self { Self::U16(v) }