(
&mut self,
x: f32, y: f32, w: f32, h: f32,
u0: f32, v0: f32, u1: f32, v1: f32,
color: [f32; 4],
texture_idx: u32,
)
| 11963 | // ============================================================ |
| 11964 | |
| 11965 | pub fn draw_textured_quad( |
| 11966 | &mut self, |
| 11967 | x: f32, y: f32, w: f32, h: f32, |
| 11968 | u0: f32, v0: f32, u1: f32, v1: f32, |
| 11969 | color: [f32; 4], |
| 11970 | texture_idx: u32, |
| 11971 | ) { |
| 11972 | self.ensure_draw_state(texture_idx); |
| 11973 | let base = self.vertices_2d.len() as u32; |
| 11974 | self.vertices_2d.push(Vertex2D { position: [x, y], uv: [u0, v0], color }); |
| 11975 | self.vertices_2d.push(Vertex2D { position: [x + w, y], uv: [u1, v0], color }); |
| 11976 | self.vertices_2d.push(Vertex2D { position: [x + w, y + h], uv: [u1, v1], color }); |
| 11977 | self.vertices_2d.push(Vertex2D { position: [x, y + h], uv: [u0, v1], color }); |
| 11978 | self.indices_2d.extend_from_slice(&[base, base + 1, base + 2, base, base + 2, base + 3]); |
| 11979 | } |
| 11980 | |
| 11981 | pub fn draw_texture(&mut self, bind_group_idx: u32, x: f64, y: f64, tint_r: f64, tint_g: f64, tint_b: f64, tint_a: f64) { |
| 11982 | let (tw, th) = self.texture_sizes.get(bind_group_idx as usize).copied().unwrap_or((0, 0)); |
no test coverage detected