added new for texture id

This commit is contained in:
Jonathan Spira 2020-12-05 00:12:15 -08:00 committed by Thom Chiovoloni
parent 767e8058fb
commit 6e54cb39d4

View File

@ -6,6 +6,12 @@ use std::collections::HashMap;
pub struct TextureId(usize);
impl TextureId {
/// Creates a new texture id with the given identifier.
pub fn new(id: usize) -> Self {
Self(id)
}
/// Returns the id of the TextureId.
pub fn id(self) -> usize {
self.0
}