MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / ensure_draw_state

Method ensure_draw_state

native/shared/src/renderer/mod.rs:11824–11837  ·  view source on GitHub ↗
(&mut self, texture_idx: u32)

Source from the content-addressed store, hash-verified

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]

Callers 7

draw_rectMethod · 0.80
draw_lineMethod · 0.80
draw_circleMethod · 0.80
draw_triangleMethod · 0.80
draw_polyMethod · 0.80
draw_textured_quadMethod · 0.80
draw_texture_proMethod · 0.80

Calls 1

pushMethod · 0.45

Tested by

no test coverage detected