fn tex_image_2d(&self,
                    target: GLenum,
                    level: GLint,
                    internal_format: GLint,
                    width: GLsizei,
                    height: GLsizei,
                    border: GLint,
                    format: GLenum,
                    ty: GLenum,
                    opt_data: Option<&[u8]>) {
        match opt_data {
            Some(data) => {
                unsafe {
                    self.ffi_gl_.TexImage2D(target, level, internal_format, width, height, border, format, ty,
                                            data.as_ptr() as *const GLvoid);
                }
            }
            None => {
                unsafe {
                    self.ffi_gl_.TexImage2D(target, level, internal_format, width, height, border, format, ty,
                                            ptr::null());
                }
            }
        }
    }
// FIXME: Does not verify buffer size -- unsafe!
Does not verify buffer size -- unsafe!
Does not verify buffer size -- unsafe!
fn tex_image_2d(&self,
                    target: GLenum,
                    level: GLint,
                    internal_format: GLint,
                    width: GLsizei,
                    height: GLsizei,
                    border: GLint,
                    format: GLenum,
                    ty: GLenum,
                    opt_data: Option<&[u8]>) {
        match opt_data {
            Some(data) => {
                unsafe {
                    self.ffi_gl_.TexImage2D(target, level, internal_format, width, height, border, format, ty,
                                            data.as_ptr() as *const GLvoid);
                }
            }
            None => {
                unsafe {
                    self.ffi_gl_.TexImage2D(target, level, internal_format, width, height, border, format, ty,
                                            ptr::null());
                }
            }
        }
    }
fn tex_image_2d ( & self , target : GLenum , level : GLint , internal_format : GLint , width : GLsizei , height : GLsizei , border : GLint , format : GLenum , ty : GLenum , opt_data : Option < & [ u8 ] > ) { match opt_data { Some ( data ) => { unsafe { self . ffi_gl_ . TexImage2D ( target , level , internal_format , width , height , border , format , ty , data . as_ptr ( ) as * const GLvoid ) ; } } None => { unsafe { self . ffi_gl_ . TexImage2D ( target , level , internal_format , width , height , border , format , ty , ptr :: null ( ) ) ; } } } }
FIXME: Does not verify buffer size -- unsafe!
FIXME : Does not verify buffer size -- unsafe!
&self
target
GLenum
level
GLint
internal_format
GLint
width
GLsizei
height
GLsizei
border
GLint
format
GLenum
ty
GLenum
opt_data
Option<&[u8]>
&self
target
GLenum
level
GLint
internal_format
GLint
width
GLsizei
height
GLsizei
border
GLint
format
GLenum
ty
GLenum
opt_data
Option<&[u8]>