(&mut self, texture_idx: u32)
| 11822 | // ============================================================ |
| 11823 | |
| 11824 | fn ensure_draw_state(&mut self, texture_idx: u32) { |
| 11825 | let needs_new = self.draw_calls_2d.is_empty() |
| 11826 | || { |
| 11827 | let last = self.draw_calls_2d.last().unwrap(); |
| 11828 | last.texture_idx != texture_idx || last.uniform_idx != self.current_uniform_idx |
| 11829 | }; |
| 11830 | if needs_new { |
| 11831 | self.draw_calls_2d.push(DrawCall2D { |
| 11832 | texture_idx, |
| 11833 | uniform_idx: self.current_uniform_idx, |
| 11834 | index_start: self.indices_2d.len() as u32, |
| 11835 | }); |
| 11836 | } |
| 11837 | } |
| 11838 | |
| 11839 | fn color_to_f32(r: f64, g: f64, b: f64, a: f64) -> [f32; 4] { |
| 11840 | [(r / 255.0) as f32, (g / 255.0) as f32, (b / 255.0) as f32, (a / 255.0) as f32] |
no test coverage detected