fn check_compile_errors(&self, shader: u32, type_: &str) {
        if type_ != "PROGRAM" {
            let success = gl::get_shaderiv(shader, GL_COMPILE_STATUS);
            if success == 0 {
                let len = gl::get_shaderiv(shader, GL_INFO_LOG_LENGTH);

                match gl::get_shader_info_log(shader, len) {
                    Some(message) => {
                        println!("ERROR::SHADER_COMPILATION_ERROR of type: {}\n{}\n ", type_, message);
                    }
                    None => {
                        println!("ERROR::SHADER_COMPILATION_ERROR of type: {}\n ", type_,);
                    }
                };
            }
        } else {
            let success = gl::get_programiv(shader, GL_LINK_STATUS);

            if success == 0 {
                let len = gl::get_programiv(shader, GL_INFO_LOG_LENGTH);

                match gl::get_program_info_log(shader, len) {
                    Some(message) => {
                        println!("ERROR::PROGRAM_LINKING_ERROR of type: {}\n{}\n ", type_, message);
                    }
                    None => {
                        println!("ERROR::PROGRAM_LINKING_ERROR of type: {}\n ", type_);
                    }
                };
            }
        }
    }
/// utility function for checking shader compilation/linking errors.
utility function for checking shader compilation/linking errors.
utility function for checking shader compilation / linking errors .
fn check_compile_errors(&self, shader: u32, type_: &str) {
        if type_ != "PROGRAM" {
            let success = gl::get_shaderiv(shader, GL_COMPILE_STATUS);
            if success == 0 {
                let len = gl::get_shaderiv(shader, GL_INFO_LOG_LENGTH);
                match gl::get_shader_info_log(shader, len) {
                    Some(message) => {
                        println!("ERROR::SHADER_COMPILATION_ERROR of type: {}\n{}\n ", type_, message);
                    }
                    None => {
                        println!("ERROR::SHADER_COMPILATION_ERROR of type: {}\n ", type_,);
                    }
                };
            }
        } else {
            let success = gl::get_programiv(shader, GL_LINK_STATUS);
            if success == 0 {
                let len = gl::get_programiv(shader, GL_INFO_LOG_LENGTH);
                match gl::get_program_info_log(shader, len) {
                    Some(message) => {
                        println!("ERROR::PROGRAM_LINKING_ERROR of type: {}\n{}\n ", type_, message);
                    }
                    None => {
                        println!("ERROR::PROGRAM_LINKING_ERROR of type: {}\n ", type_);
                    }
                };
            }
        }
    }
fn check_compile_errors ( & self , shader : u32 , type_ : & str ) { if type_ != " " { let success = gl :: get_shaderiv ( shader , GL_COMPILE_STATUS ) ; if success == 0 { let len = gl :: get_shaderiv ( shader , GL_INFO_LOG_LENGTH ) ; match gl :: get_shader_info_log ( shader , len ) { Some ( message ) => { println ! ( " \n \n " type_ message ) ; } None => { println ! ( " \n " type_ ) ; } } ; } } else { let success = gl :: get_programiv ( shader , GL_LINK_STATUS ) ; if success == 0 { let len = gl :: get_programiv ( shader , GL_INFO_LOG_LENGTH ) ; match gl :: get_program_info_log ( shader , len ) { Some ( message ) => { println ! ( " \n \n " type_ message ) ; } None => { println ! ( " \n " type_ ) ; } } ; } } }
utility function for checking shader compilation/linking errors.
utility function for checking shader compilation / linking errors .
&self
shader
u32
type_
&str
&self
shader
u32
type_
&str