26 lines
782 B
Plaintext
26 lines
782 B
Plaintext
interface asset {
|
|
use ecs.{ecs-world, ecs-resource};
|
|
|
|
resource asset-handle {
|
|
version: func() -> u64;
|
|
uuid: func() -> string;
|
|
path: func() -> option<string>;
|
|
is-watched: func() -> bool;
|
|
is-loaded: func() -> bool;
|
|
wait-for-load: func();
|
|
wait-recurse-dependencies-load: func();
|
|
}
|
|
|
|
resource image-handle {
|
|
from-raw-handle: static func(raw-handle: borrow<asset-handle>) -> option<image-handle>;
|
|
|
|
height: func() -> option<u32>;
|
|
width: func() -> option<u32>;
|
|
get-bytes: func() -> option<list<u8>>;
|
|
}
|
|
|
|
resource asset-manager {
|
|
from-ecs-resource: static func(w: borrow<ecs-resource>) -> option<asset-manager>;
|
|
request: func(path: string) -> asset-handle;
|
|
}
|
|
} |