Struct kas_core::draw::SharedState
source · pub struct SharedState<DS: DrawSharedImpl> {
pub draw: DS,
}
Expand description
Shared draw state
A single SharedState
instance is shared by all windows and draw contexts.
This struct is built over a [DrawSharedImpl
] object provided by the shell,
which may be accessed directly for a lower-level API (though most methods
are available through SharedState
directly).
Note: all functionality is implemented through the DrawShared
trait to
allow usage where the DS
type parameter is unknown. Some functionality is
also implemented directly to avoid the need for downcasting.
Fields§
§draw: DS
The shell’s [DrawSharedImpl
] object
Trait Implementations§
source§fn image_alloc(&mut self, size: (u32, u32)) -> Result<ImageHandle, AllocError>
fn image_alloc(&mut self, size: (u32, u32)) -> Result<ImageHandle, AllocError>
Allocate an image Read more
source§fn image_upload(&mut self, handle: &ImageHandle, data: &[u8], format: ImageFormat)
fn image_upload(&mut self, handle: &ImageHandle, data: &[u8], format: ImageFormat)
Upload an image to the GPU Read more
source§fn image_free(&mut self, handle: ImageHandle)
fn image_free(&mut self, handle: ImageHandle)
Potentially free an image Read more
source§fn image_size(&self, handle: &ImageHandle) -> Option<Size>
fn image_size(&self, handle: &ImageHandle) -> Option<Size>
Get the size of an image
Auto Trait Implementations§
Blanket Implementations§
source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Cast to integer, truncating Read more
source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Cast to the nearest integer Read more
source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
Cast the floor to an integer Read more