pub fn from_strings_env<'a, E, T, G>(
    tess: T,
    vertex: &str,
    geometry: G,
    fragment: &str,
    env: E,
  ) -> Result<BuiltProgram<S, Out, Uni>, ProgramError>
  where Uni: UniformInterface<E>,
        T: Into<Option<(&'a str, &'a str)>>,
        G: Into<Option<&'a str>> {
    let tess = match tess.into() {
      Some((tcs_str, tes_str)) => {
        let tcs =
          Stage::new(stage::Type::TessellationControlShader, tcs_str).map_err(ProgramError::StageError)?;
        let tes =
          Stage::new(stage::Type::TessellationEvaluationShader, tes_str).map_err(ProgramError::StageError)?;
        Some((tcs, tes))
      }
      None => None,
    };

    let gs = match geometry.into() {
      Some(gs_str) => {
        Some(Stage::new(stage::Type::GeometryShader, gs_str).map_err(ProgramError::StageError)?)
      }
      None => None,
    };

    let vs = Stage::new(stage::Type::VertexShader, vertex).map_err(ProgramError::StageError)?;
    let fs = Stage::new(stage::Type::FragmentShader, fragment).map_err(ProgramError::StageError)?;

    Self::from_stages_env(
      tess.as_ref().map(|&(ref tcs, ref tes)| (tcs, tes)),
      &vs,
      gs.as_ref(),
      &fs,
      env,
    )
  }
/// Create a new program by consuming strings.
Create a new program by consuming strings.
Create a new program by consuming strings .
pub fn from_strings_env<'a, E, T, G>(
    tess: T,
    vertex: &str,
    geometry: G,
    fragment: &str,
    env: E,
  ) -> Result<BuiltProgram<S, Out, Uni>, ProgramError>
  where Uni: UniformInterface<E>,
        T: Into<Option<(&'a str, &'a str)>>,
        G: Into<Option<&'a str>> {
    let tess = match tess.into() {
      Some((tcs_str, tes_str)) => {
        let tcs =
          Stage::new(stage::Type::TessellationControlShader, tcs_str).map_err(ProgramError::StageError)?;
        let tes =
          Stage::new(stage::Type::TessellationEvaluationShader, tes_str).map_err(ProgramError::StageError)?;
        Some((tcs, tes))
      }
      None => None,
    };
    let gs = match geometry.into() {
      Some(gs_str) => {
        Some(Stage::new(stage::Type::GeometryShader, gs_str).map_err(ProgramError::StageError)?)
      }
      None => None,
    };
    let vs = Stage::new(stage::Type::VertexShader, vertex).map_err(ProgramError::StageError)?;
    let fs = Stage::new(stage::Type::FragmentShader, fragment).map_err(ProgramError::StageError)?;
    Self::from_stages_env(
      tess.as_ref().map(|&(ref tcs, ref tes)| (tcs, tes)),
      &vs,
      gs.as_ref(),
      &fs,
      env,
    )
  }
pub fn from_strings_env < ' a , E , T , G > ( tess : T , vertex : & str , geometry : G , fragment : & str , env : E , ) -> Result < BuiltProgram < S , Out , Uni > , ProgramError > where Uni : UniformInterface < E > , T : Into < Option < ( & ' a str , & ' a str ) > > , G : Into < Option < & ' a str > > { let tess = match tess . into ( ) { Some ( ( tcs_str , tes_str ) ) => { let tcs = Stage :: new ( stage :: Type :: TessellationControlShader , tcs_str ) . map_err ( ProgramError :: StageError ) ? ; let tes = Stage :: new ( stage :: Type :: TessellationEvaluationShader , tes_str ) . map_err ( ProgramError :: StageError ) ? ; Some ( ( tcs , tes ) ) } None => None , } ; let gs = match geometry . into ( ) { Some ( gs_str ) => { Some ( Stage :: new ( stage :: Type :: GeometryShader , gs_str ) . map_err ( ProgramError :: StageError ) ? ) } None => None , } ; let vs = Stage :: new ( stage :: Type :: VertexShader , vertex ) . map_err ( ProgramError :: StageError ) ? ; let fs = Stage :: new ( stage :: Type :: FragmentShader , fragment ) . map_err ( ProgramError :: StageError ) ? ; Self :: from_stages_env ( tess . as_ref ( ) . map ( | & ( ref tcs , ref tes ) | ( tcs , tes ) ) , & vs , gs . as_ref ( ) , & fs , env , ) }
Create a new program by consuming strings.
Create a new program by consuming strings .
tess
T
vertex
&str
geometry
G
fragment
&str
env
E