After compiling the following code:
use std::rc::Rc;
use piston_window::*;
use sprite::*;
fn tester(chesspiece: Sprite<Texture<Resources>>) {
print!("Worked");
}
fn main() {
let mut texture_context: TextureContext<Factory, ..., ...> = TextureContext {
factory: window.factory.clone(),
encoder: window.factory.create_command_buffer().into(),
};
let br_tex: Rc<Texture<Resources>> = Rc::new(
Texture::from_path(
&mut texture_context,
assets.join("BlackRook.png"),
Flip::None,
&TextureSettings::new(),
) Result<Texture<Resources>, ...>
.unwrap(),
);
let mut br_sprite: Sprite<Texture<Resources>> = Sprite::from_texture(texture: br_tex.clone());
}
I get the following error:
error[E0412]: cannot find type `Resources` in this scope
--> src/main.rs:16:38
|
16 | fn tester(chesspiece: Sprite<Texture<Resources>>) {
| - ^^^^^^^^^ not found in this scope
| |
| help: you might be missing a type parameter: `<Resources>`
...which is great info, but I don't see how to supply
<Resources>
How do I do this?
squint