/// Builds a new text system that must be used to build `TextDisplay` objects.
Builds a new text system that must be used to build `TextDisplay` objects.
Builds a new text system that must be used to build ` TextDisplay ` objects .
pub fn new<F>(facade: &F) -> TextSystem
    where
        F: Facade,
    {
        TextSystem {
            context: facade.get_context().clone(),
            program: program!(facade,
                140 => {
                    vertex: "
                        #version 140
                        uniform mat4 matrix;
                        in vec2 position;
                        in vec2 tex_coords;
                        out vec2 v_tex_coords;
                        void main() {
                            gl_Position = matrix * vec4(position, 0.0, 1.0);
                            v_tex_coords = tex_coords;
                        }
                    ",
                    fragment: "
                        #version 140
                        in vec2 v_tex_coords;
                        out vec4 f_color;
                        uniform vec4 color;
                        uniform sampler2D tex;
                        void main() {
                            vec4 c = vec4(color.rgb, color.a * texture(tex, v_tex_coords));
                            if (c.a <= 0.01) {
                                discard;
                            } else {
                                f_color = c;
                            }
                        }
                    "
                },
                110 => {
                    vertex: "
                        #version 110
                        attribute vec2 position;
                        attribute vec2 tex_coords;
                        varying vec2 v_tex_coords;
                        uniform mat4 matrix;
                        void main() {
                            gl_Position = matrix * vec4(position.x, position.y, 0.0, 1.0);
                            v_tex_coords = tex_coords;
                        }
                    ",
                    fragment: "
                        #version 110
                        varying vec2 v_tex_coords;
                        uniform vec4 color;
                        uniform sampler2D tex;
                        void main() {
                            gl_FragColor = vec4(color.rgb, color.a * texture2D(tex, v_tex_coords));
                            if (gl_FragColor.a <= 0.01) {
                                discard;
                            }
                        }
                    "
                },
            )
            .unwrap(),
        }
    }
pub fn new < F > ( facade : & F ) -> TextSystem where F : Facade , { TextSystem { context : facade . get_context ( ) . clone ( ) , program : program ! ( facade 140 { vertex " " fragment " " } 110 { vertex " " fragment " " } ) . unwrap ( ) , } }
Builds a new text system that must be used to build `TextDisplay` objects.
Builds a new text system that must be used to build ` TextDisplay ` objects .
facade
&F