pub fn bind_to_gl_texture(&self, width: i32, height: i32, has_alpha: bool) {
        unsafe {
            let context = CGLGetCurrentContext();
            let gl_error = CGLTexImageIOSurface2D(context,
                                                  TEXTURE_RECTANGLE_ARB,
                                                  if has_alpha { RGBA as GLenum } else { RGB as GLenum },
                                                  width,
                                                  height,
                                                  BGRA as GLenum,
                                                  UNSIGNED_INT_8_8_8_8_REV,
                                                  self.as_concrete_TypeRef() as *mut libc::c_void,
                                                  0);

            if gl_error != kCGLNoError {
                let error_msg = CStr::from_ptr(CGLErrorString(gl_error));
                let error_msg = error_msg.to_string_lossy();
                // This will only actually leak memory if error_msg is a `Cow::Owned`, which
                // will only happen if the platform gives us invalid unicode.
                panic!("{}", error_msg.leak());
            }
        }
    }
/// Binds to the current GL texture.
Binds to the current GL texture.
Binds to the current GL texture .
pub fn bind_to_gl_texture(&self, width: i32, height: i32, has_alpha: bool) {
        unsafe {
            let context = CGLGetCurrentContext();
            let gl_error = CGLTexImageIOSurface2D(context,
                                                  TEXTURE_RECTANGLE_ARB,
                                                  if has_alpha { RGBA as GLenum } else { RGB as GLenum },
                                                  width,
                                                  height,
                                                  BGRA as GLenum,
                                                  UNSIGNED_INT_8_8_8_8_REV,
                                                  self.as_concrete_TypeRef() as *mut libc::c_void,
                                                  0);
            if gl_error != kCGLNoError {
                let error_msg = CStr::from_ptr(CGLErrorString(gl_error));
                let error_msg = error_msg.to_string_lossy();
                // This will only actually leak memory if error_msg is a `Cow::Owned`, which
                // will only happen if the platform gives us invalid unicode.
                panic!("{}", error_msg.leak());
            }
        }
    }
pub fn bind_to_gl_texture ( & self , width : i32 , height : i32 , has_alpha : bool ) { unsafe { let context = CGLGetCurrentContext ( ) ; let gl_error = CGLTexImageIOSurface2D ( context , TEXTURE_RECTANGLE_ARB , if has_alpha { RGBA as GLenum } else { RGB as GLenum } , width , height , BGRA as GLenum , UNSIGNED_INT_8_8_8_8_REV , self . as_concrete_TypeRef ( ) as * mut libc :: c_void , 0 ) ; if gl_error != kCGLNoError { let error_msg = CStr :: from_ptr ( CGLErrorString ( gl_error ) ) ; let error_msg = error_msg . to_string_lossy ( ) ; // This will only actually leak memory if error_msg is a `Cow::Owned`, which // will only happen if the platform gives us invalid unicode. panic ! ( " " error_msg leak ( ) ) ; } } }
Binds to the current GL texture.
Binds to the current GL texture .
&self
width
i32
height
i32
has_alpha
bool
&self
width
i32
height
i32
has_alpha
bool