pub fn update_index_buffer(&mut self, indicies: Vec<u16>, buffer: &mut IndexBuffer) -> Option<IndexBuffer> {
        // Check if the index buffer is big enough to fit the indicies
        if indicies.len() <= buffer.size as usize {
            log::info!("Updating index buffer >> Current size: {} || Updated size: {}", buffer.size, indicies.len());
            self.device.update_index_buffer(indicies, buffer);
            None
        } else {
            log::info!("Creating new index buffer >> Current size: {} || Updated size: {}", buffer.size, indicies.len());
            if let Some(name) = buffer.name.clone() {
                Some(self.index_buffer(indicies.as_slice(), Some(name.as_str())))
            } else {
                Some(self.index_buffer(indicies.as_slice(), None))
            }
        }
    }
/// Updates an index buffer or, if too big, creates a new one big enough to fit the new data
Updates an index buffer or, if too big, creates a new one big enough to fit the new data
Updates an index buffer or if too big creates a new one big enough to fit the new data
pub fn update_index_buffer(&mut self, indicies: Vec<u16>, buffer: &mut IndexBuffer) -> Option<IndexBuffer> {
        // Check if the index buffer is big enough to fit the indicies
        if indicies.len() <= buffer.size as usize {
            log::info!("Updating index buffer >> Current size: {} || Updated size: {}", buffer.size, indicies.len());
            self.device.update_index_buffer(indicies, buffer);
            None
        } else {
            log::info!("Creating new index buffer >> Current size: {} || Updated size: {}", buffer.size, indicies.len());
            if let Some(name) = buffer.name.clone() {
                Some(self.index_buffer(indicies.as_slice(), Some(name.as_str())))
            } else {
                Some(self.index_buffer(indicies.as_slice(), None))
            }
        }
    }
pub fn update_index_buffer ( & mut self , indicies : Vec < u16 > , buffer : & mut IndexBuffer ) -> Option < IndexBuffer > { // Check if the index buffer is big enough to fit the indicies if indicies . len ( ) <= buffer . size as usize { log :: info ! ( " " buffer size indicies len ( ) ) ; self . device . update_index_buffer ( indicies , buffer ) ; None } else { log :: info ! ( " " buffer size indicies len ( ) ) ; if let Some ( name ) = buffer . name . clone ( ) { Some ( self . index_buffer ( indicies . as_slice ( ) , Some ( name . as_str ( ) ) ) ) } else { Some ( self . index_buffer ( indicies . as_slice ( ) , None ) ) } } }
Updates an index buffer or, if too big, creates a new one big enough to fit the new data
Updates an index buffer or if too big creates a new one big enough to fit the new data
&mut self
indicies
Vec<u16>
buffer
&mut IndexBuffer