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

Method draw_triangle

native/shared/src/renderer/mod.rs:11925–11935  ·  view source on GitHub ↗
(&mut self, x1: f64, y1: f64, x2: f64, y2: f64, x3: f64, y3: f64, r: f64, g: f64, b: f64, a: f64)

Source from the content-addressed store, hash-verified

11923 }
11924
11925 pub fn draw_triangle(&mut self, x1: f64, y1: f64, x2: f64, y2: f64, x3: f64, y3: f64, r: f64, g: f64, b: f64, a: f64) {
11926 self.ensure_draw_state(0);
11927 let color = Self::color_to_f32(r, g, b, a);
11928 let base = self.vertices_2d.len() as u32;
11929
11930 self.vertices_2d.push(Vertex2D { position: [x1 as f32, y1 as f32], uv: [0.0, 0.0], color });
11931 self.vertices_2d.push(Vertex2D { position: [x2 as f32, y2 as f32], uv: [0.0, 0.0], color });
11932 self.vertices_2d.push(Vertex2D { position: [x3 as f32, y3 as f32], uv: [0.0, 0.0], color });
11933
11934 self.indices_2d.extend_from_slice(&[base, base + 1, base + 2]);
11935 }
11936
11937 pub fn draw_poly(&mut self, cx: f64, cy: f64, sides: f64, radius: f64, rotation: f64, r: f64, g: f64, b: f64, a: f64) {
11938 self.ensure_draw_state(0);

Callers 7

bloom_draw_triangleFunction · 0.80
bloom_draw_triangleFunction · 0.80
bloom_draw_triangleFunction · 0.80
bloom_draw_triangleFunction · 0.80
bloom_draw_triangleFunction · 0.80
bloom_draw_triangleFunction · 0.80
bloom_draw_triangleFunction · 0.80

Calls 2

ensure_draw_stateMethod · 0.80
pushMethod · 0.45

Tested by

no test coverage detected