pub fn new(vertex_program: &str, vertex_attributes: Vec<&str>, fragment_program: &str, fragment_attributes: Vec<&str>) -> ShaderCollection<UniformAttribute> {
        let basic_vertex        = Self::compile(vertex_program,    &vertex_attributes,     GlShaderType::Vertex,   &vec![]);
        let basic_fragment      = Self::compile(fragment_program,  &fragment_attributes,   GlShaderType::Fragment, &vec![]);
        let basic               = ShaderProgram::from_shaders(vec![basic_vertex, basic_fragment]);

        let erase_vertex        = Self::compile(vertex_program,    &vertex_attributes,     GlShaderType::Vertex,   &vec!["ERASE_MASK"]);
        let erase_fragment      = Self::compile(fragment_program,  &fragment_attributes,   GlShaderType::Fragment, &vec!["ERASE_MASK"]);
        let erase               = ShaderProgram::from_shaders(vec![erase_vertex, erase_fragment]);

        let clip_vertex         = Self::compile(vertex_program,    &vertex_attributes,     GlShaderType::Vertex,   &vec!["CLIP_MASK"]);
        let clip_fragment       = Self::compile(fragment_program,  &fragment_attributes,   GlShaderType::Fragment, &vec!["CLIP_MASK"]);
        let clip                = ShaderProgram::from_shaders(vec![clip_vertex, clip_fragment]);

        let clip_erase_vertex   = Self::compile(vertex_program,    &vertex_attributes,     GlShaderType::Vertex,   &vec!["ERASE_MASK", "CLIP_MASK"]);
        let clip_erase_fragment = Self::compile(fragment_program,  &fragment_attributes,   GlShaderType::Fragment, &vec!["ERASE_MASK", "CLIP_MASK"]);
        let clip_erase          = ShaderProgram::from_shaders(vec![clip_erase_vertex, clip_erase_fragment]);

        ShaderCollection {
            basic,
            erase,
            clip,
            clip_erase
        }
    }
///
/// Creates a new shader collection from the specified vertex and fragment programs
///
Creates a new shader collection from the specified vertex and fragment programs
Creates a new shader collection from the specified vertex and fragment programs
pub fn new(vertex_program: &str, vertex_attributes: Vec<&str>, fragment_program: &str, fragment_attributes: Vec<&str>) -> ShaderCollection<UniformAttribute> {
        let basic_vertex        = Self::compile(vertex_program,    &vertex_attributes,     GlShaderType::Vertex,   &vec![]);
        let basic_fragment      = Self::compile(fragment_program,  &fragment_attributes,   GlShaderType::Fragment, &vec![]);
        let basic               = ShaderProgram::from_shaders(vec![basic_vertex, basic_fragment]);
        let erase_vertex        = Self::compile(vertex_program,    &vertex_attributes,     GlShaderType::Vertex,   &vec!["ERASE_MASK"]);
        let erase_fragment      = Self::compile(fragment_program,  &fragment_attributes,   GlShaderType::Fragment, &vec!["ERASE_MASK"]);
        let erase               = ShaderProgram::from_shaders(vec![erase_vertex, erase_fragment]);
        let clip_vertex         = Self::compile(vertex_program,    &vertex_attributes,     GlShaderType::Vertex,   &vec!["CLIP_MASK"]);
        let clip_fragment       = Self::compile(fragment_program,  &fragment_attributes,   GlShaderType::Fragment, &vec!["CLIP_MASK"]);
        let clip                = ShaderProgram::from_shaders(vec![clip_vertex, clip_fragment]);
        let clip_erase_vertex   = Self::compile(vertex_program,    &vertex_attributes,     GlShaderType::Vertex,   &vec!["ERASE_MASK", "CLIP_MASK"]);
        let clip_erase_fragment = Self::compile(fragment_program,  &fragment_attributes,   GlShaderType::Fragment, &vec!["ERASE_MASK", "CLIP_MASK"]);
        let clip_erase          = ShaderProgram::from_shaders(vec![clip_erase_vertex, clip_erase_fragment]);
        ShaderCollection {
            basic,
            erase,
            clip,
            clip_erase
        }
    }
pub fn new ( vertex_program : & str , vertex_attributes : Vec < & str > , fragment_program : & str , fragment_attributes : Vec < & str > ) -> ShaderCollection < UniformAttribute > { let basic_vertex = Self :: compile ( vertex_program , & vertex_attributes , GlShaderType :: Vertex , & vec ! [ ] ) ; let basic_fragment = Self :: compile ( fragment_program , & fragment_attributes , GlShaderType :: Fragment , & vec ! [ ] ) ; let basic = ShaderProgram :: from_shaders ( vec ! [ basic_vertex basic_fragment ] ) ; let erase_vertex = Self :: compile ( vertex_program , & vertex_attributes , GlShaderType :: Vertex , & vec ! [ " " ] ) ; let erase_fragment = Self :: compile ( fragment_program , & fragment_attributes , GlShaderType :: Fragment , & vec ! [ " " ] ) ; let erase = ShaderProgram :: from_shaders ( vec ! [ erase_vertex erase_fragment ] ) ; let clip_vertex = Self :: compile ( vertex_program , & vertex_attributes , GlShaderType :: Vertex , & vec ! [ " " ] ) ; let clip_fragment = Self :: compile ( fragment_program , & fragment_attributes , GlShaderType :: Fragment , & vec ! [ " " ] ) ; let clip = ShaderProgram :: from_shaders ( vec ! [ clip_vertex clip_fragment ] ) ; let clip_erase_vertex = Self :: compile ( vertex_program , & vertex_attributes , GlShaderType :: Vertex , & vec ! [ " " " " ] ) ; let clip_erase_fragment = Self :: compile ( fragment_program , & fragment_attributes , GlShaderType :: Fragment , & vec ! [ " " " " ] ) ; let clip_erase = ShaderProgram :: from_shaders ( vec ! [ clip_erase_vertex clip_erase_fragment ] ) ; ShaderCollection { basic , erase , clip , clip_erase } }
Creates a new shader collection from the specified vertex and fragment programs
Creates a new shader collection from the specified vertex and fragment programs
vertex_program
&str
vertex_attributes
Vec<&str>
fragment_program
&str
fragment_attributes
Vec<&str>