unsafe fn checkCompileErrors(&self, shader: u32, type_: &str) {
        let mut success = gl::FALSE as GLint;
        let mut infoLog = Vec::with_capacity(1024);
        infoLog.set_len(1024 - 1); // subtract 1 to skip the trailing null character
        if type_ != "PROGRAM" {
            gl::GetShaderiv(shader, gl::COMPILE_STATUS, &mut success);
            if success != gl::TRUE as GLint {
                gl::GetShaderInfoLog(shader, 1024, ptr::null_mut(), infoLog.as_mut_ptr() as *mut GLchar);
                println!("ERROR::SHADER_COMPILATION_ERROR of type: {}\n{}\n \
                          -- --------------------------------------------------- -- ",
                         type_,
                         str::from_utf8(&infoLog).unwrap());
            }

        } else {
            gl::GetProgramiv(shader, gl::LINK_STATUS, &mut success);
            if success != gl::TRUE as GLint {
                gl::GetProgramInfoLog(shader, 1024, ptr::null_mut(), infoLog.as_mut_ptr() as *mut GLchar);
                println!("ERROR::PROGRAM_LINKING_ERROR of type: {}\n{}\n \
                          -- --------------------------------------------------- -- ",
                         type_,
                         str::from_utf8(&infoLog).unwrap());
            }
        }

    }
/// utility function for checking shader compilation/linking errors.
/// ------------------------------------------------------------------------
utility function for checking shader compilation/linking errors.
utility function for checking shader compilation / linking errors .
unsafe fn checkCompileErrors(&self, shader: u32, type_: &str) {
        let mut success = gl::FALSE as GLint;
        let mut infoLog = Vec::with_capacity(1024);
        infoLog.set_len(1024 - 1); // subtract 1 to skip the trailing null character
        if type_ != "PROGRAM" {
            gl::GetShaderiv(shader, gl::COMPILE_STATUS, &mut success);
            if success != gl::TRUE as GLint {
                gl::GetShaderInfoLog(shader, 1024, ptr::null_mut(), infoLog.as_mut_ptr() as *mut GLchar);
                println!("ERROR::SHADER_COMPILATION_ERROR of type: {}\n{}\n \
                          -- --------------------------------------------------- -- ",
                         type_,
                         str::from_utf8(&infoLog).unwrap());
            }
        } else {
            gl::GetProgramiv(shader, gl::LINK_STATUS, &mut success);
            if success != gl::TRUE as GLint {
                gl::GetProgramInfoLog(shader, 1024, ptr::null_mut(), infoLog.as_mut_ptr() as *mut GLchar);
                println!("ERROR::PROGRAM_LINKING_ERROR of type: {}\n{}\n \
                          -- --------------------------------------------------- -- ",
                         type_,
                         str::from_utf8(&infoLog).unwrap());
            }
        }
    }
unsafe fn checkCompileErrors ( & self , shader : u32 , type_ : & str ) { let mut success = gl :: FALSE as GLint ; let mut infoLog = Vec :: with_capacity ( 1024 ) ; infoLog . set_len ( 1024 - 1 ) ; // subtract 1 to skip the trailing null character if type_ != " " { gl :: GetShaderiv ( shader , gl :: COMPILE_STATUS , & mut success ) ; if success != gl :: TRUE as GLint { gl :: GetShaderInfoLog ( shader , 1024 , ptr :: null_mut ( ) , infoLog . as_mut_ptr ( ) as * mut GLchar ) ; println ! ( " \n \n \
 " type_ str from_utf8 ( infoLog ) unwrap ( ) ) ; } } else { gl :: GetProgramiv ( shader , gl :: LINK_STATUS , & mut success ) ; if success != gl :: TRUE as GLint { gl :: GetProgramInfoLog ( shader , 1024 , ptr :: null_mut ( ) , infoLog . as_mut_ptr ( ) as * mut GLchar ) ; println ! ( " \n \n \
 " type_ str from_utf8 ( infoLog ) unwrap ( ) ) ; } } }
utility function for checking shader compilation/linking errors.
utility function for checking shader compilation / linking errors .
&self
shader
u32
type_
&str