Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- struct TextureTable<'a> {
- table: [[Option<Texture<'a>>; 6]; 2],
- }
- impl<'a> TextureTable<'a> {
- fn new(creator: &'a TextureCreator<WindowContext>) -> Result<TextureTable<'a>, String> {
- let mut table = TextureTable { table: [[Option::None; 6]; 2] };
- table.table[0][3] = Option::Some(creator.load_texture("/path/to/image")?);
- Result::Ok(table)
- }
- }
- fn main() {
- // -- SNIP --
- let mut texture_table = TextureTable::new(&texture_creator);
- // -- SNIP --
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement