In Rust SDL2 I need to create a texture. The way to do this is to get a TextureCreator
from a Window
and then use
TextureCreator
to create the textures. The TextureCreator
lives independently from its Window
.
However the Texture
must not outlive the TextureCreator
. I don't know how to encapsulate this in a struct so that
the compiler knows that.
The code in main.rs
gives error [E0597]