pub trait Surface {
type Uniforms;
type CoordinateSpace: CoordinateSpace;
type Pixel;
// Required methods
fn set_shader<T: Shader<Self::Uniforms, Self::CoordinateSpace, Self::Pixel> + 'static>(
&mut self,
shader: T,
);
fn clear_shader(&mut self);
fn set_rect(&mut self, rect: Rectangle<Self::CoordinateSpace>);
fn set_opacity(&mut self, opacity: Fract8);
fn set_visible(&mut self, visible: bool);
fn set_offset(&mut self, offset: Coordinates<Self::CoordinateSpace>);
}Expand description
A rectangular set of pixels that can be drawn on with a Shader
Required Associated Types§
Sourcetype CoordinateSpace: CoordinateSpace
type CoordinateSpace: CoordinateSpace
The coordiante space over which this shader can operate
Required Methods§
Sourcefn set_shader<T: Shader<Self::Uniforms, Self::CoordinateSpace, Self::Pixel> + 'static>(
&mut self,
shader: T,
)
fn set_shader<T: Shader<Self::Uniforms, Self::CoordinateSpace, Self::Pixel> + 'static>( &mut self, shader: T, )
Sets the shader for this surface
Sourcefn clear_shader(&mut self)
fn clear_shader(&mut self)
Clears the shader
Sourcefn set_rect(&mut self, rect: Rectangle<Self::CoordinateSpace>)
fn set_rect(&mut self, rect: Rectangle<Self::CoordinateSpace>)
Changes the size of the surface
Sourcefn set_opacity(&mut self, opacity: Fract8)
fn set_opacity(&mut self, opacity: Fract8)
Sets the opacity of this surface, where 0 is completely transparent and 255 is completely opaque
Sourcefn set_visible(&mut self, visible: bool)
fn set_visible(&mut self, visible: bool)
Sets the visibility of the surface without adjusting the stored opacity
Sourcefn set_offset(&mut self, offset: Coordinates<Self::CoordinateSpace>)
fn set_offset(&mut self, offset: Coordinates<Self::CoordinateSpace>)
Sets the scroll offset of the surface without adjusting shader coordinates
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".