pub fn from_display(display: Display) -> Result<Self, ::glium::index::BufferCreationError> {
        let (w, h) = display.get_window().unwrap().get_inner_size().unwrap();
        let (w, h) = (w as f32 / 2.0, h as f32 / 2.0);

        let params = DrawParameters{
            blend : Blend::alpha_blending(),
            smooth: Some(Smooth::Nicest),
            .. Default::default()
        };

        IndexBuffer::new(&display, PrimitiveType::TriangleStrip, &[0u8, 1, 3, 2])
            .map(|indices|
                Graphics{
                    // Unwrap should be safe
                    program: Program::from_source(&display, include_str!("shaders/texture.vs"), include_str!("shaders/texture.fs"), None).unwrap(),
                    colour_program: Program::from_source(&display, include_str!("shaders/colour.vs"), include_str!("shaders/colour.fs"), None).unwrap(),
                    display: display,
                    params : params,
                    indices: indices,
                    h_size : (w, h)
                }
            )
    }
/// Creates a new `Graphics` instance using the given display
Creates a new `Graphics` instance using the given display
Creates a new ` Graphics ` instance using the given display
pub fn from_display(display: Display) -> Result<Self, ::glium::index::BufferCreationError> {
        let (w, h) = display.get_window().unwrap().get_inner_size().unwrap();
        let (w, h) = (w as f32 / 2.0, h as f32 / 2.0);
        let params = DrawParameters{
            blend : Blend::alpha_blending(),
            smooth: Some(Smooth::Nicest),
            .. Default::default()
        };
        IndexBuffer::new(&display, PrimitiveType::TriangleStrip, &[0u8, 1, 3, 2])
            .map(|indices|
                Graphics{
                    // Unwrap should be safe
                    program: Program::from_source(&display, include_str!("shaders/texture.vs"), include_str!("shaders/texture.fs"), None).unwrap(),
                    colour_program: Program::from_source(&display, include_str!("shaders/colour.vs"), include_str!("shaders/colour.fs"), None).unwrap(),
                    display: display,
                    params : params,
                    indices: indices,
                    h_size : (w, h)
                }
            )
    }
pub fn from_display ( display : Display ) -> Result < Self , :: glium :: index :: BufferCreationError > { let ( w , h ) = display . get_window ( ) . unwrap ( ) . get_inner_size ( ) . unwrap ( ) ; let ( w , h ) = ( w as f32 / 2.0 , h as f32 / 2.0 ) ; let params = DrawParameters { blend : Blend :: alpha_blending ( ) , smooth : Some ( Smooth :: Nicest ) , .. Default :: default ( ) } ; IndexBuffer :: new ( & display , PrimitiveType :: TriangleStrip , & [ 0u8 , 1 , 3 , 2 ] ) . map ( | indices | Graphics { // Unwrap should be safe program : Program :: from_source ( & display , include_str ! ( " " ) , include_str ! ( " " ) , None ) . unwrap ( ) , colour_program : Program :: from_source ( & display , include_str ! ( " " ) , include_str ! ( " " ) , None ) . unwrap ( ) , display : display , params : params , indices : indices , h_size : ( w , h ) } ) }
Creates a new `Graphics` instance using the given display
Creates a new ` Graphics ` instance using the given display
display
Display
display
Display