pub fn new_circle(window: &Window, radius: f32, color: Color, shape_style: ShapeStyle) -> Self {
        let num_vertices = 63;
        let mut v = Vec::<ShapeVertex>::with_capacity(num_vertices + 1);
        for x in 0..=num_vertices {
            let inner: f64 = 2.0 * PI / num_vertices as f64 * x as f64;
            v.push(ShapeVertex {
                position: [inner.cos() as f32 * radius, inner.sin() as f32 * radius],
                color: color.into(),
            });
        }
        let vertex_buffer = VertexBuffer::new(&window.display, &v).unwrap();
        let (primitive_type, polygon_mode) = match shape_style {
            ShapeStyle::Fill => (PrimitiveType::TriangleFan, PolygonMode::Fill),
            ShapeStyle::Line => (PrimitiveType::LineLoop, PolygonMode::Line),
        };
        Self {
            vertex_buffer,
            indices: NoIndices(primitive_type),
            polygon_mode,
        }
    }
/// Create a solid circle with a stripe that always faces `direction`.
Create a solid circle with a stripe that always faces `direction`.
Create a solid circle with a stripe that always faces ` direction ` .
pub fn new_circle(window: &Window, radius: f32, color: Color, shape_style: ShapeStyle) -> Self {
        let num_vertices = 63;
        let mut v = Vec::<ShapeVertex>::with_capacity(num_vertices + 1);
        for x in 0..=num_vertices {
            let inner: f64 = 2.0 * PI / num_vertices as f64 * x as f64;
            v.push(ShapeVertex {
                position: [inner.cos() as f32 * radius, inner.sin() as f32 * radius],
                color: color.into(),
            });
        }
        let vertex_buffer = VertexBuffer::new(&window.display, &v).unwrap();
        let (primitive_type, polygon_mode) = match shape_style {
            ShapeStyle::Fill => (PrimitiveType::TriangleFan, PolygonMode::Fill),
            ShapeStyle::Line => (PrimitiveType::LineLoop, PolygonMode::Line),
        };
        Self {
            vertex_buffer,
            indices: NoIndices(primitive_type),
            polygon_mode,
        }
    }
pub fn new_circle ( window : & Window , radius : f32 , color : Color , shape_style : ShapeStyle ) -> Self { let num_vertices = 63 ; let mut v = Vec :: < ShapeVertex > :: with_capacity ( num_vertices + 1 ) ; for x in 0 ..= num_vertices { let inner : f64 = 2.0 * PI / num_vertices as f64 * x as f64 ; v . push ( ShapeVertex { position : [ inner . cos ( ) as f32 * radius , inner . sin ( ) as f32 * radius ] , color : color . into ( ) , } ) ; } let vertex_buffer = VertexBuffer :: new ( & window . display , & v ) . unwrap ( ) ; let ( primitive_type , polygon_mode ) = match shape_style { ShapeStyle :: Fill => ( PrimitiveType :: TriangleFan , PolygonMode :: Fill ) , ShapeStyle :: Line => ( PrimitiveType :: LineLoop , PolygonMode :: Line ) , } ; Self { vertex_buffer , indices : NoIndices ( primitive_type ) , polygon_mode , } }
Create a solid circle with a stripe that always faces `direction`.
Create a solid circle with a stripe that always faces ` direction ` .
window
&Window
radius
f32
color
Color
shape_style
ShapeStyle
window
&Window
radius
f32
color
Color
shape_style
ShapeStyle