equal
deleted
inserted
replaced
11 }, |
11 }, |
12 }; |
12 }; |
13 |
13 |
14 use std::num::NonZeroU32; |
14 use std::num::NonZeroU32; |
15 |
15 |
16 // TODO: temp |
|
17 const VERTEX_SHADER: &'static str = r#" |
16 const VERTEX_SHADER: &'static str = r#" |
18 #version 150 |
17 #version 150 |
19 |
18 |
20 in vec2 Position; |
19 in vec2 Position; |
21 in vec3 Uv; |
20 in vec3 Uv; |
46 { |
45 { |
47 Target = texture2D(Texture, a_Uv.xy); |
46 Target = texture2D(Texture, a_Uv.xy); |
48 } |
47 } |
49 "#; |
48 "#; |
50 |
49 |
51 pub struct MapTile { |
50 struct MapTile { |
52 // either index into GL texture array or emulated [Texture; N] |
51 // either index into GL texture array or emulated [Texture; N] |
53 texture_index: u32, |
52 texture_index: u32, |
54 |
53 |
55 width: u32, |
54 width: u32, |
56 height: u32, |
55 height: u32, |
57 } |
56 } |
58 |
57 |
59 #[repr(C)] |
58 #[repr(C)] |
60 #[derive(Copy, Clone)] |
59 #[derive(Copy, Clone)] |
61 pub struct TileVertex { |
60 struct TileVertex { |
62 pos: [f32; 2], |
61 pos: [f32; 2], |
63 // doesn't hurt to include another float, just in case.. |
62 // doesn't hurt to include another float, just in case.. |
64 uv: [f32; 3], |
63 uv: [f32; 3], |
65 } |
64 } |
66 |
65 |
67 pub struct DrawTile { |
66 struct DrawTile { |
68 texture_index: u32, |
67 texture_index: u32, |
69 index_len: u32, |
68 index_len: u32, |
70 } |
69 } |
71 |
70 |
72 pub struct MapRenderer { |
71 pub struct MapRenderer { |