1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use {crate::topology::TriangleList, std::marker::PhantomData};
#[derive(Clone, Copy)]
pub struct LayerHandle<V, T = TriangleList>(u32, PhantomData<(V, T)>);
impl<V, T> LayerHandle<V, T> {
pub(crate) fn new(id: u32) -> Self {
Self(id, PhantomData)
}
pub(crate) fn id(self) -> u32 {
self.0
}
}
#[derive(Clone, Copy)]
pub struct TextureHandle(pub(crate) u32);
#[derive(Clone, Copy)]
pub struct InstanceHandle(pub(crate) u32);
#[derive(Clone, Copy)]
pub struct MeshHandle<V, T = TriangleList>(u32, PhantomData<(V, T)>);
impl<V, T> MeshHandle<V, T> {
pub(crate) fn new(id: u32) -> Self {
Self(id, PhantomData)
}
pub(crate) fn id(self) -> u32 {
self.0
}
}
#[derive(Clone, Copy)]
pub struct ViewHandle(pub(crate) u32);