pub fn new_rect(display: &Display, colour: [f32; 4], width: f32, height: f32) -> Result<Self, ::glium::vertex::BufferCreationError>{
        let (w, h) = (width/2., height/2.);
        VertexBuffer::new(display, &[
            ColourVertex::new([-w, -h], colour),
            ColourVertex::new([ w, -h], colour),
            ColourVertex::new([ w,  h], colour),
            ColourVertex::new([-w,  h], colour)
        ]).map(|vb| Quad{
            vertex_buffer: vb
        })
    }
/// Creates a new rectangular quad from the width and height with one colour
Creates a new rectangular quad from the width and height with one colour
Creates a new rectangular quad from the width and height with one colour
pub fn new_rect(display: &Display, colour: [f32; 4], width: f32, height: f32) -> Result<Self, ::glium::vertex::BufferCreationError>{
        let (w, h) = (width/2., height/2.);
        VertexBuffer::new(display, &[
            ColourVertex::new([-w, -h], colour),
            ColourVertex::new([ w, -h], colour),
            ColourVertex::new([ w,  h], colour),
            ColourVertex::new([-w,  h], colour)
        ]).map(|vb| Quad{
            vertex_buffer: vb
        })
    }
pub fn new_rect ( display : & Display , colour : [ f32 ; 4 ] , width : f32 , height : f32 ) -> Result < Self , :: glium :: vertex :: BufferCreationError > { let ( w , h ) = ( width / 2. , height / 2. ) ; VertexBuffer :: new ( display , & [ ColourVertex :: new ( [ - w , - h ] , colour ) , ColourVertex :: new ( [ w , - h ] , colour ) , ColourVertex :: new ( [ w , h ] , colour ) , ColourVertex :: new ( [ - w , h ] , colour ) ] ) . map ( | vb | Quad { vertex_buffer : vb } ) }
Creates a new rectangular quad from the width and height with one colour
Creates a new rectangular quad from the width and height with one colour
display
&Display
colour
[f32; 4]
width
f32
height
f32
display
&Display
colour
[f32; 4]
width
f32
height
f32