fn new<'a, T, G>(tess: T, vertex: &Stage, geometry: G, fragment: &Stage) -> Result<Self, ProgramError>
  where T: Into<Option<(&'a Stage, &'a Stage)>>,
        G: Into<Option<&'a Stage>> {
    unsafe {
      let handle = gl::CreateProgram();

      if let Some((tcs, tes)) = tess.into() {
        gl::AttachShader(handle, tcs.handle());
        gl::AttachShader(handle, tes.handle());
      }

      gl::AttachShader(handle, vertex.handle());

      if let Some(geometry) = geometry.into() {
        gl::AttachShader(handle, geometry.handle());
      }

      gl::AttachShader(handle, fragment.handle());

      let program = RawProgram { handle };
      program.link().map(move |_| program)
    }
  }
/// Create a new program by attaching shader stages.
Create a new program by attaching shader stages.
Create a new program by attaching shader stages .
fn new<'a, T, G>(tess: T, vertex: &Stage, geometry: G, fragment: &Stage) -> Result<Self, ProgramError>
  where T: Into<Option<(&'a Stage, &'a Stage)>>,
        G: Into<Option<&'a Stage>> {
    unsafe {
      let handle = gl::CreateProgram();
      if let Some((tcs, tes)) = tess.into() {
        gl::AttachShader(handle, tcs.handle());
        gl::AttachShader(handle, tes.handle());
      }
      gl::AttachShader(handle, vertex.handle());
      if let Some(geometry) = geometry.into() {
        gl::AttachShader(handle, geometry.handle());
      }
      gl::AttachShader(handle, fragment.handle());
      let program = RawProgram { handle };
      program.link().map(move |_| program)
    }
  }
fn new < ' a , T , G > ( tess : T , vertex : & Stage , geometry : G , fragment : & Stage ) -> Result < Self , ProgramError > where T : Into < Option < ( & ' a Stage , & ' a Stage ) > > , G : Into < Option < & ' a Stage > > { unsafe { let handle = gl :: CreateProgram ( ) ; if let Some ( ( tcs , tes ) ) = tess . into ( ) { gl :: AttachShader ( handle , tcs . handle ( ) ) ; gl :: AttachShader ( handle , tes . handle ( ) ) ; } gl :: AttachShader ( handle , vertex . handle ( ) ) ; if let Some ( geometry ) = geometry . into ( ) { gl :: AttachShader ( handle , geometry . handle ( ) ) ; } gl :: AttachShader ( handle , fragment . handle ( ) ) ; let program = RawProgram { handle } ; program . link ( ) . map ( move | _ | program ) } }
Create a new program by attaching shader stages.
Create a new program by attaching shader stages .
tess
T
vertex
&Stage
geometry
G
fragment
&Stage