pub fn create_or_resize_texture(&mut self, c: &mut Canvas<Window>, size: Size) {
        if self.store.is_none() || self.size.w != size.w || self.size.h != size.h {
            self.size.w = size.w;
            self.size.h = size.h;
            self.store = Some(c.create_texture_target(None, size.w, size.h).unwrap());

            eprintln!(
                "[create_or_resize_texture] Created texture: size={}x{} (memory={})",
                size.w,
                size.h,
                size.get_memory_size()
            );

            self.set_invalidated(true);
        }
    }
/// This is used to create a new `Texture` object that can be drawn against.  If the `Widget` is
/// ever redrawn, this function will automatically generate a new `Texture` to draw against, and
/// destroy the previously stored `Texture`.  If any changes are observed when calling this
/// function (ie. the width changes, height changes, or the store is lost), it is regenerated.
This is used to create a new `Texture` object that can be drawn against.
This is used to create a new ` Texture ` object that can be drawn against .
pub fn create_or_resize_texture(&mut self, c: &mut Canvas<Window>, size: Size) {
        if self.store.is_none() || self.size.w != size.w || self.size.h != size.h {
            self.size.w = size.w;
            self.size.h = size.h;
            self.store = Some(c.create_texture_target(None, size.w, size.h).unwrap());
            eprintln!(
                "[create_or_resize_texture] Created texture: size={}x{} (memory={})",
                size.w,
                size.h,
                size.get_memory_size()
            );
            self.set_invalidated(true);
        }
    }
pub fn create_or_resize_texture ( & mut self , c : & mut Canvas < Window > , size : Size ) { if self . store . is_none ( ) || self . size . w != size . w || self . size . h != size . h { self . size . w = size . w ; self . size . h = size . h ; self . store = Some ( c . create_texture_target ( None , size . w , size . h ) . unwrap ( ) ) ; eprintln ! ( " " size w size h size get_memory_size ( ) ) ; self . set_invalidated ( true ) ; } }
This is used to create a new `Texture` object that can be drawn against.
This is used to create a new ` Texture ` object that can be drawn against .
&mut self
c
&mut Canvas<Window>
size
Size
&mut self
c
&mut Canvas<Window>
size
Size