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

Method draw_rect

native/shared/src/renderer/mod.rs:11847–11859  ·  view source on GitHub ↗
(&mut self, x: f64, y: f64, w: f64, h: f64, r: f64, g: f64, b: f64, a: f64)

Source from the content-addressed store, hash-verified

11845 // ============================================================
11846
11847 pub fn draw_rect(&mut self, x: f64, y: f64, w: f64, h: f64, r: f64, g: f64, b: f64, a: f64) {
11848 self.ensure_draw_state(0);
11849 let color = Self::color_to_f32(r, g, b, a);
11850 let base = self.vertices_2d.len() as u32;
11851 let (x, y, w, h) = (x as f32, y as f32, w as f32, h as f32);
11852
11853 self.vertices_2d.push(Vertex2D { position: [x, y], uv: [0.0, 0.0], color });
11854 self.vertices_2d.push(Vertex2D { position: [x + w, y], uv: [0.0, 0.0], color });
11855 self.vertices_2d.push(Vertex2D { position: [x + w, y + h], uv: [0.0, 0.0], color });
11856 self.vertices_2d.push(Vertex2D { position: [x, y + h], uv: [0.0, 0.0], color });
11857
11858 self.indices_2d.extend_from_slice(&[base, base + 1, base + 2, base, base + 2, base + 3]);
11859 }
11860
11861 pub fn draw_rect_lines(&mut self, x: f64, y: f64, w: f64, h: f64, thickness: f64, r: f64, g: f64, b: f64, a: f64) {
11862 let t = thickness;

Callers 8

bloom_draw_rectFunction · 0.80
bloom_draw_rectFunction · 0.80
bloom_draw_rectFunction · 0.80
bloom_draw_rectFunction · 0.80
draw_rect_linesMethod · 0.80
bloom_draw_rectFunction · 0.80
bloom_draw_rectFunction · 0.80
bloom_draw_rectFunction · 0.80

Calls 2

ensure_draw_stateMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected