Checkpoint
This commit is contained in:
parent
dcaf4c905f
commit
12ba10bc2c
6 changed files with 196 additions and 24 deletions
|
@ -180,14 +180,30 @@ pub trait PlatformTextSystem: Send + Sync {
|
|||
) -> Vec<usize>;
|
||||
}
|
||||
|
||||
pub trait PlatformSpriteSystem<Key> {
|
||||
pub trait PlatformAtlas<Key> {
|
||||
fn get_or_insert_with(
|
||||
&self,
|
||||
key: Key,
|
||||
build: impl FnOnce() -> (Size<DevicePixels>, Vec<u8>),
|
||||
) -> MonochromeSprite;
|
||||
) -> AtlasTile;
|
||||
|
||||
fn clear(&self);
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[repr(C)]
|
||||
pub struct AtlasTile {
|
||||
pub(crate) texture_id: AtlasTextureId,
|
||||
pub(crate) tile_id: TileId,
|
||||
pub(crate) bounds_in_atlas: Bounds<DevicePixels>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy, Debug)]
|
||||
#[repr(C)]
|
||||
pub(crate) struct AtlasTextureId(pub(crate) usize);
|
||||
|
||||
pub(crate) type TileId = etagere::AllocId;
|
||||
|
||||
pub trait PlatformInputHandler {
|
||||
fn selected_text_range(&self) -> Option<Range<usize>>;
|
||||
fn marked_text_range(&self) -> Option<Range<usize>>;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue